Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
FlutterAppDelegate Class Reference

#include <FlutterAppDelegate.h>

Inheritance diagram for FlutterAppDelegate:
<FlutterAppLifecycleProvider> AppDelegate

Protected Attributes

 : UIResponder <UIApplicationDelegate
 
 FlutterPluginRegistry
 

Properties

FlutterAppLifeCycleProvider UIWindow * window
 
NSObject< FlutterPluginRegistrant > * pluginRegistrant
 
IBOutlet NSMenu * applicationMenu
 
IBOutlet NSWindow * mainFlutterWindow
 
FlutterViewController *(^ rootFlutterViewControllerGetter )(void)
 
FlutterPluginAppLifeCycleDelegatelifeCycleDelegate
 

Additional Inherited Members

- Instance Methods inherited from <FlutterAppLifecycleProvider>
(void) - addApplicationLifecycleDelegate:
 
(void) - removeApplicationLifecycleDelegate:
 

Detailed Description

UIApplicationDelegate subclass for simple apps that want default behavior.

This class implements the following behaviors:

  • Status bar touches are forwarded to the key window's root view FlutterViewController, in order to trigger scroll to top.
  • Keeps the Flutter connection open in debug mode when the phone screen locks.

App delegates for Flutter applications are not required to inherit from this class. Developers of custom app delegate classes should copy and paste code as necessary from FlutterAppDelegate.mm.

|NSApplicationDelegate| subclass for simple apps that want default behavior.

This class implements the following behaviors:

  • Updates the application name of items in the application menu to match the name in the app's Info.plist, assuming it is set to APP_NAME initially. |applicationMenu| must be set before the application finishes launching for this to take effect.
  • Updates the main Flutter window's title to match the name in the app's Info.plist. |mainFlutterWindow| must be set before the application finishes launching for this to take effect.
  • Forwards NSApplicationDelegate callbacks to plugins that register for them.

App delegates for Flutter applications are not required to inherit from this class. Developers of custom app delegate classes should copy and paste code as necessary from FlutterAppDelegate.mm.

Definition at line 27 of file FlutterAppDelegate.h.

Member Data Documentation

◆ __pad0__

- __pad0__
protected

Definition at line 26 of file FlutterAppDelegate.h.

◆ FlutterPluginRegistry

- FlutterPluginRegistry
protected

Definition at line 28 of file FlutterAppDelegate.h.

Property Documentation

◆ applicationMenu

- (IBOutlet NSMenu*) applicationMenu
readwritenonatomicweak

The application menu in the menu bar.

Definition at line 59 of file FlutterAppDelegate.h.

◆ lifeCycleDelegate

- (FlutterPluginAppLifeCycleDelegate*) lifeCycleDelegate
readwritenonatomicstrong

Provided by category FlutterAppDelegate(Test).

Definition at line 27 of file FlutterSceneLifeCycle+Test.h.

◆ mainFlutterWindow

- (IBOutlet NSWindow*) mainFlutterWindow
readwritenonatomicweak

The primary application window containing a FlutterViewController. This is primarily intended for use in single-window applications.

Definition at line 65 of file FlutterAppDelegate.h.

Referenced by flutter::FlutterPlatformNodeDelegateMac::GetNSWindow().

◆ pluginRegistrant

- (NSObject< FlutterPluginRegistrant > *) pluginRegistrant
readwritenonatomicstrong

A user-assignable FlutterPluginRegistrant for deferred plugin registration.

For applications adopting the UISceneDelegate lifecycle, the recommended approach is to update the application's UIApplicationDelegate to conform to FlutterImplicitEngineDelegate and perform plugin registration via the generated plugin registrant in the didInitializeImplicitFlutterEngine callback.

Alternatively, assigning a FlutterPluginRegistrant to this property allows Flutter to automatically handle plugin registration when a FlutterEngine becomes available, avoiding the need to implement delegate callbacks.

The FlutterAppDelegate itself can be assigned to this property without creating a retain cycle (e.g., self.pluginRegistrant = self;).

See also
|FlutterImplicitEngineDelegate|
https://docs.flutter.dev/release/breaking-changes/uiscenedelegate

Definition at line 50 of file FlutterAppDelegate.h.

◆ rootFlutterViewControllerGetter

- (FlutterViewController *(^ rootFlutterViewControllerGetter) (void))
readwritenonatomiccopy

Provided by category FlutterAppDelegate(Test).

◆ window

- (FlutterAppLifeCycleProvider UIWindow*) window
readwritenonatomicstrong

Definition at line 30 of file FlutterAppDelegate.h.


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