Flutter Engine
The Flutter Engine
Instance Methods | Properties | List of all members
ScreenBeforeFlutter Class Reference

#import <ScreenBeforeFlutter.h>

Inheritance diagram for ScreenBeforeFlutter:

Instance Methods

(id- initWithEngineRunCompletion:
 
(FlutterViewController *) - showFlutter:
 
(void) - viewDidLoad [implementation]
 

Properties

FlutterEngineengine
 

Detailed Description

Definition at line 10 of file ScreenBeforeFlutter.h.

Method Documentation

◆ initWithEngineRunCompletion:

- (id) initWithEngineRunCompletion: (dispatch_block_t)  engineRunCompletion

Definition at line 1 of file ScreenBeforeFlutter.m.

12 :(dispatch_block_t)engineRunCompletion {
13 self = [super init];
14 _engine = [[FlutterEngine alloc] initWithScenario:@"poppable_screen"
15 withCompletion:engineRunCompletion];
16 return self;
17}
fml::scoped_nsobject< FlutterEngine > _engine

◆ showFlutter:

- (FlutterViewController *) showFlutter: (dispatch_block_t)  showCompletion

Definition at line 1 of file ScreenBeforeFlutter.m.

42 :(dispatch_block_t)showCompletion {
43 FlutterViewController* flutterVC = [[FlutterViewController alloc] initWithEngine:_engine
44 nibName:nil
45 bundle:nil];
46 [self presentViewController:flutterVC animated:NO completion:showCompletion];
47 return flutterVC;
48}

◆ viewDidLoad

- (void) viewDidLoad
implementation

Definition at line 1 of file ScreenBeforeFlutter.m.

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}

Property Documentation

◆ engine

- (FlutterEngine *) engine
readnonatomicassign

Definition at line 15 of file ScreenBeforeFlutter.h.


The documentation for this class was generated from the following files: