<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> <!-- Show a splash screen on the activity. Automatically removed when Flutter draws its first frame --> <!-- <item name="android:windowBackground">@drawable/launch_background</item>--> <item name="android:windowFullscreen">true</item> </style>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.flutterEngine = [[FlutterEngine alloc] initWithName:@"my flutter engine"]; // Runs the default Dart entrypoint with a default Flutter route. [self.flutterEngine run]; // Used to connect plugins (only if you have plugins with iOS platform code). [GeneratedPluginRegistrant registerWithRegistry:self.flutterEngine]; return [super application:application didFinishLaunchingWithOptions:launchOptions]; }
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. // Make a button to call the showFlutter function when pressed. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button addTarget:self action:@selector(showFlutter) forControlEvents:UIControlEventTouchUpInside]; [button setTitle:@"Show Flutter!" forState:UIControlStateNormal]; button.backgroundColor = UIColor.blueColor; button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0); [self.view addSubview:button]; }