Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | Properties | List of all members
AppDelegate Class Reference

#include <AppDelegate.h>

Inheritance diagram for AppDelegate:
FlutterAppDelegate

Instance Methods

(BOOL- application:didFinishLaunchingWithOptions: [implementation]
 
(void) - applicationWillResignActive: [implementation]
 
(void) - applicationDidEnterBackground: [implementation]
 
(void) - applicationWillEnterForeground: [implementation]
 
(void) - applicationDidBecomeActive: [implementation]
 
(void) - applicationWillTerminate: [implementation]
 
(UISceneConfiguration *) - application:configurationForConnectingSceneSession:options: [implementation]
 
(void) - application:didDiscardSceneSessions: [implementation]
 
(FlutterEngine *) - engineForTest: [implementation]
 
(FlutterViewController *) - flutterViewControllerForTest:withEngine: [implementation]
 
(void) - setupFlutterViewControllerTest: [implementation]
 
(void) - displayLinkFired [implementation]
 
(id- init [implementation]
 
(NSApplicationTerminateReply) - applicationShouldTerminate: [implementation]
 
(void) - applicationDidFinishLaunching: [implementation]
 
- Instance Methods inherited from FlutterAppDelegate
(void) - dealloc [implementation]
 
(BOOL- application:willFinishLaunchingWithOptions: [implementation]
 
(FlutterViewController *) - rootFlutterViewController [implementation]
 
(void) - application:didRegisterUserNotificationSettings: [implementation]
 
(void) - application:didRegisterForRemoteNotificationsWithDeviceToken: [implementation]
 
(void) - application:didFailToRegisterForRemoteNotificationsWithError: [implementation]
 
(void) - application:didReceiveLocalNotification: [implementation]
 
(void) - userNotificationCenter:willPresentNotification:withCompletionHandler: [implementation]
 
(void) - userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: [implementation]
 
(BOOL- openURL: [implementation]
 
(BOOL- application:openURL:options: [implementation]
 
(BOOL- application:handleOpenURL: [implementation]
 
(BOOL- application:openURL:sourceApplication:annotation: [implementation]
 
(void) - application:performActionForShortcutItem:completionHandler: [implementation]
 
(void) - application:handleEventsForBackgroundURLSession:completionHandler: [implementation]
 
(BOOL- application:continueUserActivity:restorationHandler: [implementation]
 
(NSObject< FlutterPluginRegistrar > *) - registrarForPlugin: [implementation]
 
(BOOL- hasPlugin: [implementation]
 
(NSObject *) - valuePublishedByPlugin: [implementation]
 
(void) - addApplicationLifeCycleDelegate: [implementation]
 
(BOOL- respondsToSelector: [implementation]
 
(BOOL- delegateRespondsSelectorToPlugins: [implementation]
 
(id- forwardingTargetForSelector: [implementation]
 
(void) - logCapabilityConfigurationWarningIfNeeded: [implementation]
 
(BOOL- application:shouldSaveApplicationState: [implementation]
 
(BOOL- application:shouldRestoreApplicationState: [implementation]
 
(BOOL- application:shouldSaveSecureApplicationState: [implementation]
 
(BOOL- application:shouldRestoreSecureApplicationState: [implementation]
 
(int64_t) - lastAppModificationTime [implementation]
 
(void) - applicationWillFinishLaunching: [implementation]
 
(void) - addApplicationLifecycleDelegate: [implementation]
 
(void) - removeApplicationLifecycleDelegate: [implementation]
 
(NSString *) - applicationName [implementation]
 
(void) - application:openURLs: [implementation]
 
(NSApplicationTerminateReply) - applicationShouldTerminate: [implementation]
 
- Instance Methods inherited from <FlutterAppLifecycleProvider>
(void) - addApplicationLifecycleDelegate:
 
(void) - removeApplicationLifecycleDelegate:
 

Properties

UIWindow * window
 
BOOL done
 
- Properties inherited from FlutterAppDelegate
FlutterAppLifeCycleProvider UIWindow * window
 
IBOutlet NSMenu * applicationMenu
 
IBOutlet NSWindow * mainFlutterWindow
 
FlutterViewController *(^ rootFlutterViewControllerGetter )(void) [implementation]
 
FlutterAppLifecycleRegistrarlifecycleRegistrar [implementation]
 
FlutterEngineTerminationHandlerterminationHandler [implementation]
 

Additional Inherited Members

- Protected Attributes inherited from FlutterAppDelegate
 : UIResponder <UIApplicationDelegate
 
 FlutterPluginRegistry
 

Detailed Description

Definition at line 10 of file AppDelegate.h.

Method Documentation

◆ application:configurationForConnectingSceneSession:options:

- (UISceneConfiguration *) application: (UIApplication*)  application
configurationForConnectingSceneSession: (UISceneSession*)  connectingSceneSession
options: (UISceneConnectionOptions*)  options 
implementation

Definition at line 1 of file AppDelegate.m.

21 :(UIApplication*)application
22 configurationForConnectingSceneSession:(UISceneSession*)connectingSceneSession
23 options:(UISceneConnectionOptions*)options {
24 // Called when a new scene session is being created.
25 // Use this method to select a configuration to create the new scene with.
26 return [[UISceneConfiguration alloc] initWithName:@"Default Configuration"
27 sessionRole:connectingSceneSession.role];
28}
const char * options

◆ application:didDiscardSceneSessions:

- (void) application: (UIApplication*)  application
didDiscardSceneSessions: (NSSet<UISceneSession*>*)  sceneSessions 
implementation

Definition at line 1 of file AppDelegate.m.

30 :(UIApplication*)application
31 didDiscardSceneSessions:(NSSet<UISceneSession*>*)sceneSessions {
32 // Called when the user discards a scene session.
33 // If any sessions were discarded while the application was not running, this will be called
34 // shortly after application:didFinishLaunchingWithOptions. Use this method to release any
35 // resources that were specific to the discarded scenes, as they will not return.
36}

◆ application:didFinishLaunchingWithOptions:

- (BOOL) application: (UIApplication*)  application
didFinishLaunchingWithOptions: (NSDictionary*)  launchOptions 
implementation

Reimplemented from FlutterAppDelegate.

Definition at line 1 of file AppDelegate.m.

13 :(UIApplication*)application
14 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
15 return YES;
16}

◆ applicationDidBecomeActive:

- (void) applicationDidBecomeActive: (UIApplication*)  application
implementation

Reimplemented from FlutterAppDelegate.

Definition at line 1 of file AppDelegate.m.

27 :(UIApplication*)application {
28}

◆ applicationDidEnterBackground:

- (void) applicationDidEnterBackground: (UIApplication*)  application
implementation

Reimplemented from FlutterAppDelegate.

Definition at line 1 of file AppDelegate.m.

21 :(UIApplication*)application {
22}

◆ applicationDidFinishLaunching:

- (void) applicationDidFinishLaunching: (NSNotification *)  notification
implementation

Definition at line 15 of file main_mac.mm.

34 :(NSNotification *)notification {
35 [NSApp stop:nil];
36}

◆ applicationShouldTerminate:

- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *)  sender
implementation

Definition at line 15 of file main_mac.mm.

29 :(NSApplication *)sender {
30 _done = TRUE;
31 return NSTerminateCancel;
32}

◆ applicationWillEnterForeground:

- (void) applicationWillEnterForeground: (UIApplication*)  application
implementation

Reimplemented from FlutterAppDelegate.

Definition at line 1 of file AppDelegate.m.

24 :(UIApplication*)application {
25}

◆ applicationWillResignActive:

- (void) applicationWillResignActive: (UIApplication*)  application
implementation

Reimplemented from FlutterAppDelegate.

Definition at line 1 of file AppDelegate.m.

18 :(UIApplication*)application {
19}

◆ applicationWillTerminate:

- (void) applicationWillTerminate: (UIApplication*)  application
implementation

Reimplemented from FlutterAppDelegate.

Definition at line 1 of file AppDelegate.m.

30 :(UIApplication*)application {
31}

◆ displayLinkFired

- (void) displayLinkFired
implementation

Definition at line 34 of file main_ios.mm.

75 {
76 // TODO: Hook into CAMetalLayer's drawing event loop or our own run loop observer.
77 // Need to handle animated slides/redraw mode, so we need something that will wake up the
78 // run loop.
80
81 fApp->onIdle();
82}
static void PaintWindow()
std::unique_ptr< sk_app::Application > fApp
Definition main_ios.mm:34

◆ engineForTest:

- (FlutterEngine *) engineForTest: (NSString*)  scenarioIdentifier
implementation

Definition at line 1 of file AppDelegate.m.

124 :(NSString*)scenarioIdentifier {
125 if ([scenarioIdentifier isEqualToString:@"spawn_engine_works"]) {
126 FlutterEngine* spawner = [[FlutterEngine alloc] initWithName:@"FlutterControllerTest"
127 project:nil];
128 [spawner run];
129 return [spawner spawnWithEntrypoint:nil libraryURI:nil initialRoute:nil entrypointArgs:nil];
130 } else {
131 FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"FlutterControllerTest"
132 project:nil];
133 [engine run];
134 return engine;
135 }
136}
FlutterEngine engine
Definition main.cc:68
FlutterEngine * spawnWithEntrypoint:libraryURI:initialRoute:entrypointArgs:(/*nullable */NSString *entrypoint, [libraryURI]/*nullable */NSString *libraryURI, [initialRoute]/*nullable */NSString *initialRoute, [entrypointArgs]/*nullable */NSArray< NSString * > *entrypointArgs)

◆ flutterViewControllerForTest:withEngine:

- (FlutterViewController *) flutterViewControllerForTest: (NSString*)  scenarioIdentifier
withEngine: (FlutterEngine*)  engine 
implementation

Definition at line 1 of file AppDelegate.m.

138 :(NSString*)scenarioIdentifier
139 withEngine:(FlutterEngine*)engine {
140 if ([scenarioIdentifier isEqualToString:@"tap_status_bar"]) {
141 return [[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil];
142 } else {
143 return [[NoStatusBarFlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil];
144 }
145}
if(end==-1)

◆ init

- (id) init
implementation

Reimplemented from FlutterAppDelegate.

Definition at line 15 of file main_mac.mm.

23 {
24 self = [super init];
25 _done = FALSE;
26 return self;
27}
return FALSE

◆ setupFlutterViewControllerTest:

- (void) setupFlutterViewControllerTest: (NSString*)  scenarioIdentifier
implementation

Definition at line 1 of file AppDelegate.m.

147 :(NSString*)scenarioIdentifier {
148 FlutterEngine* engine = [self engineForTest:scenarioIdentifier];
149 FlutterViewController* flutterViewController =
150 [self flutterViewControllerForTest:scenarioIdentifier withEngine:engine];
151 flutterViewController.view.accessibilityIdentifier = @"flutter_view";
152
153 [engine.binaryMessenger
154 setMessageHandlerOnChannel:@"waiting_for_status"
155 binaryMessageHandler:^(NSData* _Nullable message, FlutterBinaryReply _Nonnull reply) {
157 methodChannelWithName:@"driver"
158 binaryMessenger:engine.binaryMessenger
160 [channel invokeMethod:@"set_scenario" arguments:@{@"name" : scenarioIdentifier}];
161 }];
162 // Can be used to synchronize timing in the test for a signal from Dart.
163 [engine.binaryMessenger
164 setMessageHandlerOnChannel:@"display_data"
165 binaryMessageHandler:^(NSData* _Nullable message, FlutterBinaryReply _Nonnull reply) {
166 NSDictionary* dict = [NSJSONSerialization JSONObjectWithData:message
167 options:0
168 error:nil];
169 UITextField* text = [[UITextField alloc] initWithFrame:CGRectMake(0, 400, 300, 100)];
170 text.text = dict[@"data"];
171 [flutterViewController.view addSubview:text];
172 }];
173
174 TextPlatformViewFactory* textPlatformViewFactory =
175 [[TextPlatformViewFactory alloc] initWithMessenger:engine.binaryMessenger];
176 NSObject<FlutterPluginRegistrar>* registrar =
177 [engine registrarForPlugin:@"scenarios/TextPlatformViewPlugin"];
178 [registrar registerViewFactory:textPlatformViewFactory
179 withId:@"scenarios/textPlatformView"
180 gestureRecognizersBlockingPolicy:FlutterPlatformViewGestureRecognizersBlockingPolicyEager];
181 [registrar registerViewFactory:textPlatformViewFactory
182 withId:@"scenarios/textPlatformView_blockPolicyUntilTouchesEnded"
183 gestureRecognizersBlockingPolicy:
184 FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded];
185
186 UIViewController* rootViewController = flutterViewController;
187 // Make Flutter View's origin x/y not 0.
188 if ([scenarioIdentifier isEqualToString:@"non_full_screen_flutter_view_platform_view"]) {
189 rootViewController = [[NoStatusBarViewController alloc] init];
190 [rootViewController.view addSubview:flutterViewController.view];
191 flutterViewController.view.frame = CGRectMake(150, 150, 500, 500);
192 }
193
194 self.window.rootViewController = rootViewController;
195
196 if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--assert-ca-layer-type"]) {
197 if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--enable-software-rendering"]) {
198 NSAssert([flutterViewController.view.layer isKindOfClass:[CALayer class]],
199 @"Expected CALayer for software rendering.");
200 } else {
201 NSAssert([flutterViewController.view.layer isKindOfClass:[CAMetalLayer class]],
202 @"Expected CAMetalLayer for non-software rendering.");
203 }
204 }
205}
FlutterBinaryMessengerConnection setMessageHandlerOnChannel:binaryMessageHandler:(NSString *channel, [binaryMessageHandler] FlutterBinaryMessageHandler handler)
NSObject< FlutterPluginRegistrar > * registrarForPlugin:(NSString *pluginKey)
instancetype sharedInstance()
instancetype methodChannelWithName:binaryMessenger:codec:(NSString *name,[binaryMessenger] NSObject< FlutterBinaryMessenger > *messenger,[codec] NSObject< FlutterMethodCodec > *codec)

Property Documentation

◆ done

- (BOOL) done
readwritenonatomicassign

Definition at line 15 of file main_mac.mm.

◆ window

- (UIWindow *) window
readwritenonatomicstrong

Definition at line 12 of file AppDelegate.h.


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