19 {
20 [super viewDidLoad];
21 self.view.backgroundColor = UIColor.grayColor;
22
23 UIButton* showFlutterButton = [UIButton buttonWithType:UIButtonTypeSystem];
24 showFlutterButton.translatesAutoresizingMaskIntoConstraints = NO;
25 showFlutterButton.backgroundColor = UIColor.blueColor;
26 [showFlutterButton setTitle:@"Show Flutter" forState:UIControlStateNormal];
27 showFlutterButton.tintColor = UIColor.whiteColor;
28 showFlutterButton.clipsToBounds = YES;
29 [showFlutterButton addTarget:self
30 action:@selector(showFlutter:)
31 forControlEvents:UIControlEventTouchUpInside];
32
33 [self.view addSubview:showFlutterButton];
34 [[showFlutterButton.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor] setActive:YES];
35 [[showFlutterButton.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor] setActive:YES];
36 [[showFlutterButton.heightAnchor constraintEqualToConstant:50] setActive:YES];
37 [[showFlutterButton.widthAnchor constraintEqualToConstant:150] setActive:YES];
38
39 [_engine runWithEntrypoint:nil];
40}