Flutter iOS Embedder
FlutterEngine Class Reference

#import <FlutterEngine.h>

Inheritance diagram for FlutterEngine:
<FlutterPluginRegistry> FlutterEnginePartialMock FlutterEngineSpy FlutterHeadlessDartRunner PointerDataCapturingEngine

Instance Methods

(instancetype) - NS_SWIFT_UI_ACTOR
 
(instancetype) - initWithName:
 
(instancetype) - initWithName:project:
 
(instancetype) - initWithName:project:allowHeadlessExecution:
 
(instancetype) - initWithName:project:allowHeadlessExecution:restorationEnabled:
 
(BOOL) - NS_SWIFT_UI_ACTOR
 
(BOOL) - runWithEntrypoint:
 
(BOOL) - runWithEntrypoint:initialRoute:
 
(BOOL) - runWithEntrypoint:libraryURI:
 
(BOOL) - runWithEntrypoint:libraryURI:initialRoute:
 
(BOOL) - runWithEntrypoint:libraryURI:initialRoute:entrypointArgs:
 
(void) - destroyContext
 
(void) - ensureSemanticsEnabled
 
(BOOL isGpuDisabled) - FLUTTER_DEPRECATED
 
(nullable FlutterFMLTaskRunner *) - platformTaskRunner
 
(nullable FlutterFMLTaskRunner *) - uiTaskRunner
 
(nullable FlutterFMLTaskRunner *) - rasterTaskRunner
 
(flutter::Shell &) - shell
 
(flutter::PlatformViewIOS *) - platformView
 
(void) - setBinaryMessenger:
 
(void) - waitForFirstFrame:callback:
 
(FlutterEngine *) - spawnWithEntrypoint:libraryURI:initialRoute:entrypointArgs:
 
(const flutter::ThreadHost &) - threadHost
 
(void) - updateDisplays
 
(void) - sendDisplayWithScreenNativeSize:scale:
 
(void) - flutterTextInputView:performAction:withClient:
 
(void) - sceneWillEnterForeground:
 
(void) - sceneDidEnterBackground:
 
(void) - applicationWillEnterForeground:
 
(void) - applicationDidEnterBackground:
 
(NSString *) - lookupKeyForAsset:
 
(NSString *) - lookupKeyForAsset:fromPackage:
 
- Instance Methods inherited from <FlutterPluginRegistry>
(nullable NSObject< FlutterPluginRegistrar > *) - registrarForPlugin:
 
(BOOL) - hasPlugin:
 
(nullable NSObject *) - valuePublishedByPlugin:
 

Properties

FlutterViewController * viewController
 
FlutterMethodChannel * localizationChannel
 
FlutterMethodChannel * navigationChannel
 
FlutterMethodChannel * restorationChannel
 
FlutterMethodChannel * platformChannel
 
FlutterMethodChannel * textInputChannel
 
FlutterBasicMessageChannel * lifecycleChannel
 
FlutterBasicMessageChannel * systemChannel
 
FlutterBasicMessageChannel * settingsChannel
 
FlutterBasicMessageChannel * keyEventChannel
 
NSURL * vmServiceUrl
 
NSObject< FlutterBinaryMessenger > * binaryMessenger
 
NSObject< FlutterTextureRegistry > * textureRegistry
 
NSString * isolateId
 
FlutterEngineProcTable & embedderAPI
 
BOOL enableEmbedderAPI
 
BOOL allowHeadlessExecution
 
NSMutableDictionary * pluginPublications
 
FlutterRestorationPlugin * restorationPlugin
 

Detailed Description

The FlutterEngine class coordinates a single instance of execution for a FlutterDartProject. It may have zero or one FlutterViewController at a time, which can be specified via -setViewController:. FlutterViewController's initWithEngine initializer will automatically call -setViewController: for itself.

A FlutterEngine can be created independently of a FlutterViewController for headless execution. It can also persist across the lifespan of multiple FlutterViewController instances to maintain state and/or asynchronous tasks (such as downloading a large file).

A FlutterEngine can also be used to prewarm the Dart execution environment and reduce the latency of showing the Flutter screen when a FlutterViewController is created and presented. See https://docs.flutter.dev/development/add-to-app/performance for more details on loading performance.

Alternatively, you can simply create a new FlutterViewController with only a FlutterDartProject. That FlutterViewController will internally manage its own instance of a FlutterEngine, but will not guarantee survival of the engine beyond the life of the ViewController.

A newly initialized FlutterEngine will not actually run a Dart Isolate until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI is invoked. One of these methods must be invoked before calling -setViewController:.

FlutterEngine instances must be created and run on the main thread. The engine adopts the thread that runs it as its platform thread, which is also used for executing application UI code written in Dart. Running an engine on a background queue is not supported, apps and app extensions must dispatch to the main queue.

Definition at line 66 of file FlutterEngine.h.

Method Documentation

◆ applicationDidEnterBackground:

- (void) applicationDidEnterBackground: (NSNotification *)  notification

Provided by category FlutterEngine(Test).

◆ applicationWillEnterForeground:

- (void) applicationWillEnterForeground: (NSNotification *)  notification

Provided by category FlutterEngine(Test).

◆ destroyContext

- (void) destroyContext

Destroy running context for an engine.

This method can be used to force the FlutterEngine object to release all resources. After sending this message, the object will be in an unusable state until it is deallocated. Accessing properties or sending messages to it will result in undefined behavior or runtime errors.

The engine cannot be run again: -run and the -runWithEntrypoint: variants return NO.

Definition at line 212 of file FlutterEngine.mm.

626  {
627  if (self.destroyed) {
628  return;
629  }
630  self.destroyed = YES;
631  [self resetChannels];
632  self.isolateId = nil;
633  _shell.reset();
634  _profiler.reset();
635  _threadHost.reset();
636  _platformViewsController = nil;
639 }
std::shared_ptr< flutter::SamplingProfiler > _profiler
std::unique_ptr< flutter::Shell > _shell
FlutterFMLTaskRunner * _rasterTaskRunnerWrapper
FlutterFMLTaskRunner * _platformTaskRunnerWrapper

◆ ensureSemanticsEnabled

- (void) ensureSemanticsEnabled

Ensures that Flutter will generate a semantics tree.

This is enabled by default if certain accessibility services are turned on by the user, or when using a Simulator. This method allows a user to turn semantics on when they would not ordinarily be generated and the performance overhead is not a concern, e.g. for UI testing. Note that semantics should never be programmatically turned off, as it would potentially disable accessibility services an end user has requested.

This method must only be called after launching the engine via -runWithEntrypoint: or -runWithEntryPoint:libraryURI.

Although this method returns synchronously, it does not guarantee that a semantics tree is actually available when the method returns. It synchronously ensures that the next frame the Flutter framework creates will have a semantics tree.

You can subscribe to semantics updates via NSNotificationCenter by adding an observer for the name FlutterSemanticsUpdateNotification. The object parameter will be the FlutterViewController associated with the semantics update. This will asynchronously fire after a semantics tree has actually built and has been applied to a loaded Flutter view (which may be some time after the frame has been rendered). If the view is not loaded when the semantics tree is built, the notification is deferred until the cached semantics are applied when the view loads.

Definition at line 212 of file FlutterEngine.mm.

565  {
566  if (!self.platformView) {
567  return;
568  }
569  self.platformView->SetSemanticsEnabled(true);
570 }
flutter::PlatformViewIOS * platformView()

◆ FLUTTER_DEPRECATED

- (BOOL isGpuDisabled) FLUTTER_DEPRECATED ("This property is managed by the engine and will be removed from the public API.") 

Whether or not GPU calls are allowed.

Typically this is set when the app is backgrounded and foregrounded.

◆ flutterTextInputView:performAction:withClient:

- (void) flutterTextInputView: (FlutterTextInputView *)  textInputView
performAction: (FlutterTextInputAction)  action
withClient: (int)  client 

Provided by category FlutterEngine(Test).

◆ initWithName:

- (instancetype) initWithName: (NSString*)  NS_SWIFT_UI_ACTOR

Initialize this FlutterEngine.

The engine will execute the project located in the bundle with the identifier "io.flutter.flutter.app" (the default for Flutter projects).

A newly initialized engine will not run until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI: is called.

FlutterEngine created with this method will have allowHeadlessExecution set to YES. This means that the engine will continue to run regardless of whether a FlutterViewController is attached to it or not, until -destroyContext: is called or the process finishes.

Parameters
labelPrefixThe label prefix used to identify threads for this instance. Should be unique across FlutterEngine instances, and is used in instrumentation to label the threads used by this FlutterEngine.

Definition at line 212 of file FlutterEngine.mm.

223  :(NSString*)labelPrefix {
224  return [self initWithName:labelPrefix project:nil allowHeadlessExecution:YES];
225 }

◆ initWithName:project:

- (instancetype) initWithName: (NSString *)  labelPrefix
project: (nullable FlutterDartProject *)  NS_SWIFT_UI_ACTOR 

Initialize this FlutterEngine with a FlutterDartProject.

If the FlutterDartProject is not specified, the FlutterEngine will attempt to locate the project in a default location (the flutter_assets folder in the iOS application bundle).

A newly initialized engine will not run the FlutterDartProject until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI: is called.

FlutterEngine created with this method will have allowHeadlessExecution set to YES. This means that the engine will continue to run regardless of whether a FlutterViewController is attached to it or not, until -destroyContext: is called or the process finishes.

Parameters
labelPrefixThe label prefix used to identify threads for this instance. Should be unique across FlutterEngine instances, and is used in instrumentation to label the threads used by this FlutterEngine.
projectThe FlutterDartProject to run.

◆ initWithName:project:allowHeadlessExecution:

- (instancetype) initWithName: (NSString *)  labelPrefix
project: (nullable FlutterDartProject *)  project
allowHeadlessExecution: (BOOL)  NS_SWIFT_UI_ACTOR 

Initialize this FlutterEngine with a FlutterDartProject.

If the FlutterDartProject is not specified, the FlutterEngine will attempt to locate the project in a default location (the flutter_assets folder in the iOS application bundle).

A newly initialized engine will not run the FlutterDartProject until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI: is called.

Parameters
labelPrefixThe label prefix used to identify threads for this instance. Should be unique across FlutterEngine instances, and is used in instrumentation to label the threads used by this FlutterEngine.
projectThe FlutterDartProject to run.
allowHeadlessExecutionWhether or not to allow this instance to continue running after passing a nil FlutterViewController to -setViewController:.

◆ initWithName:project:allowHeadlessExecution:restorationEnabled:

- (instancetype) initWithName: (NSString *)  labelPrefix
project: (nullable FlutterDartProject *)  project
allowHeadlessExecution: (BOOL)  allowHeadlessExecution
restorationEnabled: (BOOL)  NS_SWIFT_UI_ACTOR 

Initialize this FlutterEngine with a FlutterDartProject.

If the FlutterDartProject is not specified, the FlutterEngine will attempt to locate the project in a default location (the flutter_assets folder in the iOS application bundle).

A newly initialized engine will not run the FlutterDartProject until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI: is called.

Parameters
labelPrefixThe label prefix used to identify threads for this instance. Should be unique across FlutterEngine instances, and is used in instrumentation to label the threads used by this FlutterEngine.
projectThe FlutterDartProject to run.
allowHeadlessExecutionWhether or not to allow this instance to continue running after passing a nil FlutterViewController to -setViewController:.
restorationEnabledWhether state restoration is enabled. When true, the framework will wait for the attached view controller to provide restoration data.

◆ lookupKeyForAsset:

- (NSString*) lookupKeyForAsset: (NSString *)  asset

Provided by category FlutterEngine(Test).

◆ lookupKeyForAsset:fromPackage:

- (NSString*) lookupKeyForAsset: (NSString *)  asset
fromPackage: (NSString *)  package 

Provided by category FlutterEngine(Test).

◆ NS_SWIFT_UI_ACTOR [1/2]

- (instancetype) NS_SWIFT_UI_ACTOR

Default initializer for a FlutterEngine.

Threads created by this FlutterEngine will appear as "FlutterEngine #" in Instruments. The prefix can be customized using initWithName.

The engine will execute the project located in the bundle with the identifier "io.flutter.flutter.app" (the default for Flutter projects).

A newly initialized engine will not run until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI: is called.

FlutterEngine created with this method will have allowHeadlessExecution set to YES. This means that the engine will continue to run regardless of whether a FlutterViewController is attached to it or not, until -destroyContext: is called or the process finishes.

Reimplemented in FlutterHeadlessDartRunner.

◆ NS_SWIFT_UI_ACTOR [2/2]

- (BOOL) NS_SWIFT_UI_ACTOR

Runs a Dart program on an Isolate from the main Dart library (i.e. the library that contains main()), using main() as the entrypoint (the default for Flutter projects), and using "/" (the default route) as the initial route.

The first call to this method creates a new Isolate and returns YES. Subsequent calls return NO immediately and have no effect.

This method must be called on the main thread. See the FlutterEngine class documentation.

Returns
YES if this call started the engine; NO if it was already invoked, has been destroyed, or could not be started.

Reimplemented in FlutterHeadlessDartRunner.

◆ platformTaskRunner

- (nullable FlutterFMLTaskRunner*) platformTaskRunner

The task runner for the platform thread (iOS main thread).

Provided by category FlutterEngine(TaskRunners).

◆ platformView

- (PlatformViewIOS* FlutterEngine(Test)):

Provided by category FlutterEngine(Test).

◆ rasterTaskRunner

- (nullable FlutterFMLTaskRunner*) rasterTaskRunner

The task runner for the raster thread, where GPU rasterisation commands are issued.

Provided by category FlutterEngine(TaskRunners).

◆ runWithEntrypoint:

- (BOOL) runWithEntrypoint: (nullable NSString *)  NS_SWIFT_UI_ACTOR

Runs a Dart program on an Isolate from the main Dart library (i.e. the library that contains main()), using "/" (the default route) as the initial route.

The first call to this method creates a new Isolate and returns YES. Subsequent calls return NO immediately and have no effect.

This method must be called on the main thread. See the FlutterEngine class documentation.

Parameters
entrypointThe name of a top-level function from the same Dart library that contains the app's main() function. If this is FlutterDefaultDartEntrypoint (or nil) it will default to main(). If it is not the app's main() function, that function must be decorated with @pragma(vm:entry-point) to ensure the method is not tree-shaken by the Dart compiler.
Returns
YES if this call started the engine; NO if it was already invoked, has been destroyed, or could not be started.

Reimplemented in FlutterEnginePartialMock.

◆ runWithEntrypoint:initialRoute:

- (BOOL) runWithEntrypoint: (nullable NSString *)  entrypoint
initialRoute: (nullable NSString *)  NS_SWIFT_UI_ACTOR 

Runs a Dart program on an Isolate from the main Dart library (i.e. the library that contains main()).

The first call to this method creates a new Isolate and returns YES. Subsequent calls return NO immediately and have no effect.

This method must be called on the main thread. See the FlutterEngine class documentation.

Parameters
entrypointThe name of a top-level function from the same Dart library that contains the app's main() function. If this is FlutterDefaultDartEntrypoint (or nil), it will default to main(). If it is not the app's main() function, that function must be decorated with @pragma(vm:entry-point) to ensure the method is not tree-shaken by the Dart compiler.
initialRouteThe name of the initial Flutter Navigator Route to load. If this is FlutterDefaultInitialRoute (or nil), it will default to the "/" route.
Returns
YES if this call started the engine; NO if it was already invoked, has been destroyed, or could not be started.

◆ runWithEntrypoint:libraryURI:

- (BOOL) runWithEntrypoint: (nullable NSString *)  entrypoint
libraryURI: (nullable NSString *)  NS_SWIFT_UI_ACTOR 

Runs a Dart program on an Isolate using the specified entrypoint and Dart library, which may not be the same as the library containing the Dart program's main() function.

The first call to this method creates a new Isolate and returns YES. Subsequent calls return NO immediately and have no effect.

This method must be called on the main thread. See the FlutterEngine class documentation.

Parameters
entrypointThe name of a top-level function from a Dart library. If this is FlutterDefaultDartEntrypoint (or nil); this will default to main(). If it is not the app's main() function, that function must be decorated with @pragma(vm:entry-point) to ensure the method is not tree-shaken by the Dart compiler.
uriThe URI of the Dart library which contains the entrypoint method (example "package:foo_package/main.dart"). If nil, this will default to the same library as the main() function in the Dart program.
Returns
YES if this call started the engine; NO if it was already invoked, has been destroyed, or could not be started.

◆ runWithEntrypoint:libraryURI:initialRoute:

- (BOOL) runWithEntrypoint: (nullable NSString *)  entrypoint
libraryURI: (nullable NSString *)  libraryURI
initialRoute: (nullable NSString *)  NS_SWIFT_UI_ACTOR 

Runs a Dart program on an Isolate using the specified entrypoint and Dart library, which may not be the same as the library containing the Dart program's main() function.

The first call to this method creates a new Isolate and returns YES. Subsequent calls return NO immediately and have no effect.

This method must be called on the main thread. See the FlutterEngine class documentation.

Parameters
entrypointThe name of a top-level function from a Dart library. If this is FlutterDefaultDartEntrypoint (or nil); this will default to main(). If it is not the app's main() function, that function must be decorated with @pragma(vm:entry-point) to ensure the method is not tree-shaken by the Dart compiler.
libraryURIThe URI of the Dart library which contains the entrypoint method (example "package:foo_package/main.dart"). If nil, this will default to the same library as the main() function in the Dart program.
initialRouteThe name of the initial Flutter Navigator Route to load. If this is FlutterDefaultInitialRoute (or nil), it will default to the "/" route.
Returns
YES if this call started the engine; NO if it was already invoked, has been destroyed, or could not be started.

◆ runWithEntrypoint:libraryURI:initialRoute:entrypointArgs:

- (BOOL) runWithEntrypoint: (nullable NSString *)  entrypoint
libraryURI: (nullable NSString *)  libraryURI
initialRoute: (nullable NSString *)  initialRoute
entrypointArgs: (nullable NSArray< NSString * > *)  NS_SWIFT_UI_ACTOR 

Runs a Dart program on an Isolate using the specified entrypoint and Dart library, which may not be the same as the library containing the Dart program's main() function.

The first call to this method creates a new Isolate and returns YES. Subsequent calls return NO immediately and have no effect.

This method must be called on the main thread. See the FlutterEngine class documentation.

Parameters
entrypointThe name of a top-level function from a Dart library. If this is FlutterDefaultDartEntrypoint (or nil); this will default to main(). If it is not the app's main() function, that function must be decorated with @pragma(vm:entry-point) to ensure the method is not tree-shaken by the Dart compiler.
libraryURIThe URI of the Dart library which contains the entrypoint method (example "package:foo_package/main.dart"). If nil, this will default to the same library as the main() function in the Dart program.
initialRouteThe name of the initial Flutter Navigator Route to load. If this is FlutterDefaultInitialRoute (or nil), it will default to the "/" route.
entrypointArgsArguments passed as a list of string to Dart's entrypoint function.
Returns
YES if this call started the engine; NO if it was already invoked, has been destroyed, or could not be started.

◆ sceneDidEnterBackground:

- (void) sceneDidEnterBackground: (ios(13.0))  API_AVAILABLE

Provided by category FlutterEngine(Test).

◆ sceneWillEnterForeground:

- (void) sceneWillEnterForeground: (ios(13.0))  API_AVAILABLE

Provided by category FlutterEngine(Test).

◆ sendDisplayWithScreenNativeSize:scale:

- (void) sendDisplayWithScreenNativeSize: (CGSize)  screenNativeSize
scale: (CGFloat)  scale 

Provided by category FlutterEngine(Test).

◆ setBinaryMessenger:

- (void) setBinaryMessenger: (FlutterBinaryMessengerRelay *)  binaryMessenger

Provided by category FlutterEngine(Test).

◆ shell

- (Shell& FlutterEngine(Test)):

Provided by category FlutterEngine(Test).

◆ spawnWithEntrypoint:libraryURI:initialRoute:entrypointArgs:

- (FlutterEngine*) spawnWithEntrypoint: (/*nullable */NSString *)  entrypoint
libraryURI: (/*nullable */NSString *)  libraryURI
initialRoute: (/*nullable */NSString *)  initialRoute
entrypointArgs: (/*nullable */NSArray< NSString * > *)  NS_SWIFT_UI_ACTOR 

Provided by category FlutterEngine(Test).

◆ threadHost

- (const ThreadHost& FlutterEngine(Test)):

Provided by category FlutterEngine(Test).

◆ uiTaskRunner

- (nullable FlutterFMLTaskRunner*) uiTaskRunner

The task runner for the UI thread, where framework code runs.

Reimplemented in FlutterEnginePartialMock.

Provided by category FlutterEngine(TaskRunners).

◆ updateDisplays

- (void) updateDisplays

Provided by category FlutterEngine(Test).

◆ waitForFirstFrame:callback:

- (void) waitForFirstFrame: (NSTimeInterval)  timeout
callback: (void(^)(BOOL didTimeout))  callback 

Provided by category FlutterEngine(Test).

Property Documentation

◆ allowHeadlessExecution

- (BOOL) allowHeadlessExecution
readnonatomicassign

Provided by category FlutterEngine(Test).

Definition at line 25 of file FlutterEngine+Test.h.

◆ binaryMessenger

- (NSObject< FlutterBinaryMessenger > *) binaryMessenger
readnonatomicassign

The FlutterBinaryMessenger associated with this FlutterEngine (used for communicating with channels).

Definition at line 456 of file FlutterEngine.h.

◆ embedderAPI

- (FlutterEngineProcTable&) embedderAPI
readnonatomicassign

Provided by category FlutterEngine(Test).

Definition at line 23 of file FlutterEngine+Test.h.

◆ enableEmbedderAPI

- (BOOL) enableEmbedderAPI
readnonatomicassign

Provided by category FlutterEngine(Test).

Definition at line 24 of file FlutterEngine+Test.h.

◆ isolateId

- (NSString*) isolateId
readnonatomiccopy

The UI Isolate ID of the engine.

This property will be nil if the engine is not running.

Definition at line 468 of file FlutterEngine.h.

◆ keyEventChannel

- (FlutterBasicMessageChannel*) keyEventChannel
readnonatomicassign

The FlutterBasicMessageChannel used for communicating key events from physical keyboards

Can be nil after destroyContext is called.

Definition at line 441 of file FlutterEngine.h.

◆ lifecycleChannel

- (FlutterBasicMessageChannel*) lifecycleChannel
readnonatomicassign

The FlutterBasicMessageChannel used to communicate app lifecycle events to the Dart Isolate.

Can be nil after destroyContext is called.

See also
Lifecycle Channel

Definition at line 414 of file FlutterEngine.h.

◆ localizationChannel

- (FlutterMethodChannel*) localizationChannel
readnonatomicassign

The FlutterMethodChannel used for localization related platform messages, such as setting the locale.

Can be nil after destroyContext is called.

Definition at line 364 of file FlutterEngine.h.

◆ navigationChannel

- (FlutterMethodChannel*) navigationChannel
readnonatomicassign

The FlutterMethodChannel used for navigation related platform messages.

Can be nil after destroyContext is called.

See also
Navigation Channel
Navigator Widget

Definition at line 374 of file FlutterEngine.h.

◆ platformChannel

- (FlutterMethodChannel*) platformChannel
readnonatomicassign

The FlutterMethodChannel used for core platform messages, such as information about the screen orientation.

Can be nil after destroyContext is called.

Definition at line 392 of file FlutterEngine.h.

◆ pluginPublications

- (NSMutableDictionary*) pluginPublications
readnonatomicassign

Provided by category FlutterEngine(Test).

Definition at line 26 of file FlutterEngine+Test.h.

◆ restorationChannel

- (FlutterMethodChannel*) restorationChannel
readnonatomicassign

The FlutterMethodChannel used for restoration related platform messages.

Can be nil after destroyContext is called.

See also
Restoration Channel

Definition at line 384 of file FlutterEngine.h.

◆ restorationPlugin

- (FlutterRestorationPlugin*) restorationPlugin
readwritenonatomicstrong

Provided by category FlutterEngine(Test).

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

◆ settingsChannel

- (FlutterBasicMessageChannel*) settingsChannel
readnonatomicassign

The FlutterBasicMessageChannel used for communicating user settings such as clock format and text scale.

Can be nil after destroyContext is called.

Definition at line 433 of file FlutterEngine.h.

◆ systemChannel

- (FlutterBasicMessageChannel*) systemChannel
readnonatomicassign

The FlutterBasicMessageChannel used for communicating system events, such as memory pressure events.

Can be nil after destroyContext is called.

See also
System Channel

Definition at line 425 of file FlutterEngine.h.

◆ textInputChannel

- (FlutterMethodChannel*) textInputChannel
readnonatomicassign

The FlutterMethodChannel used to communicate text input events to the Dart Isolate.

Can be nil after destroyContext is called.

See also
Text Input Channel

Definition at line 403 of file FlutterEngine.h.

◆ textureRegistry

- (NSObject< FlutterTextureRegistry > *) textureRegistry
readnonatomicassign

The FlutterTextureRegistry associated with this FlutterEngine (used to register textures).

Definition at line 461 of file FlutterEngine.h.

◆ viewController

- (FlutterViewController*) viewController
readwritenonatomicweak

Sets the FlutterViewController for this instance. The FlutterEngine must be running (e.g. a successful call to -runWithEntrypoint: or -runWithEntrypoint:libraryURI) before calling this method. Callers may pass nil to remove the viewController and have the engine run headless in the current process.

A FlutterEngine can only have one FlutterViewController at a time. If there is already a FlutterViewController associated with this instance, this method will replace the engine's current viewController with the newly specified one.

Setting the viewController will signal the engine to start animations and drawing, and unsetting it will signal the engine to stop animations and drawing. However, neither will impact the state of the Dart program's execution.

Definition at line 356 of file FlutterEngine.h.

◆ vmServiceUrl

- (NSURL *) vmServiceUrl
readnonatomicassign

The NSURL of the Dart VM Service for the service isolate.

This is only set in debug and profile runtime modes, and only after the Dart VM Service is ready. In release mode or before the Dart VM Service has started, it returns nil.

Definition at line 450 of file FlutterEngine.h.


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