Flutter Engine
The Flutter Engine
|
#import <FlutterEngine.h>
Class Methods | |
(BOOL) | + isProfilerEnabled [implementation] |
(NSString *) | + generateThreadLabel: [implementation] |
(flutter::ThreadHost) | + makeThreadHost: [implementation] |
(static void) | + SetEntryPoint [implementation] |
(static void) | + SetThreadPriority [implementation] |
Protected Attributes | |
__pad0__: NSObject <FlutterTextureRegistry | |
FlutterPluginRegistry | |
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 http://flutter.dev/docs/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:
.
Coordinates a single instance of execution of a Flutter engine.
A FlutterEngine can only be attached with one controller from the native code.
Definition at line 61 of file FlutterEngine.h.
|
implementation |
Used to notify the active view when undo manager state (can redo/can undo) changes, in order to force keyboards to update undo/redo buttons.
Reimplemented from <FlutterUndoManagerDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Attach a view controller to the engine as its default controller.
Since FlutterEngine can only handle the implicit view for now, the given controller will always be assigned to the implicit view, if there isn't an implicit view yet. If the engine already has an implicit view, this call throws an assertion.
The engine holds a weak reference to the attached view controller.
If the given view controller is already attached to an engine, this call throws an assertion.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Announces accessibility messages.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Clears out a channel's message handler if that handler is still the one that was created as a result of setMessageHandlerOnChannel:binaryMessageHandler:
.
connection | The result from setMessageHandlerOnChannel:binaryMessageHandler: . |
Reimplemented from <FlutterBinaryMessenger>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Notify plugins of dealloc. This should happen first in dealloc since the plugins may be talking to things like the binaryMessenger.
nil out weak references.
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
An internal method that removes the view controller with the given ID.
This method clears the ID of the controller, removes the controller from the map. This is an no-op if the view ID is not associated with any view controllers.
Definition at line 484 of file FlutterEngine.mm.
- (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.
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Dispatches semantics action back to the framework. The semantics must be enabled by calling the updateSemanticsEnabled before dispatching semantics actions.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Function pointers for interacting with the embedder.h API.
Provided by category FlutterEngine(Test).
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Handles a platform message from the engine.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Invoked right before the engine is restarted.
This should reset states to as if the application has just started. It usually indicates a hot restart (Shift-R in Flutter CLI.)
Definition at line 484 of file FlutterEngine.mm.
- (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 (which may be some time after the frame has been rendered).
Reimplemented in FlutterEngineSpy.
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
The executable name for the current process.
Definition at line 484 of file FlutterEngine.mm.
- (NSURL *observatoryUrl) FLUTTER_DEPRECATED | ("Use vmServiceUrl instead") |
The depcreated 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
.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterIndirectScribbleDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterIndirectScribbleDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Provided by category FlutterEngine(Test).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterTextInputDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
A callback that is called when iOS queries accessibility information of the Flutter view.
This is useful to predict the current iOS accessibility status. For example, there is no API to listen whether voice control is turned on or off. The Flutter engine uses this callback to enable semantics in order to catch the case that voice control is on.
Reimplemented from <FlutterViewEngineDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Handles accessibility events.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Called when the |FlutterAppDelegate| gets the applicationDidUnhide notification.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Handles messages received from the Flutter engine on the _*Channel channels.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Pass changes to the framework through the undo manager channel.
Reimplemented from <FlutterUndoManagerDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Called when the |FlutterAppDelegate| gets the applicationWillBecomeActive notification.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Called when the |FlutterAppDelegate| gets the applicationWillResignActive notification.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Returns whether the specified plugin has been registered.
pluginKey | The unique key identifying the plugin. |
YES
if registrarForPlugin
has been called with pluginKey
. Reimplemented from <FlutterPluginRegistry>.
Definition at line 822 of file FlutterEngine.mm.
- (instancetype) init |
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.
Definition at line 157 of file FlutterEngine.mm.
- (instancetype) initWithName: | (NSString*) | labelPrefix |
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.
labelPrefix | The 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 157 of file FlutterEngine.mm.
- (nonnull instancetype) initWithName: | (nonnull NSString *) | labelPrefix | |
project: | (nullable FlutterDartProject *) | project | |
Initializes an engine with the given project.
labelPrefix | Currently unused; in the future, may be used for labelling threads as with the iOS FlutterEngine. |
project | The project configuration. If nil, a default FlutterDartProject will be used. |
|
implementation |
Reimplemented in FlutterHeadlessDartRunner.
Definition at line 157 of file FlutterEngine.mm.
- (instancetype) initWithName: | (NSString *) | labelPrefix | |
project: | (nullable FlutterDartProject *) | project | |
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.
labelPrefix | The 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. |
project | The FlutterDartProject to run. |
- (nonnull instancetype) initWithName: | (nonnull NSString *) | labelPrefix | |
project: | (nullable FlutterDartProject *) | project | |
allowHeadlessExecution: | (BOOL) | NS_DESIGNATED_INITIALIZER | |
Initializes an engine that can run headlessly with the given project.
labelPrefix | Currently unused; in the future, may be used for labelling threads as with the iOS FlutterEngine. |
project | The project configuration. If nil, a default FlutterDartProject will be used. |
|
implementation |
Reimplemented in FlutterHeadlessDartRunner.
Definition at line 157 of file FlutterEngine.mm.
- (instancetype) initWithName: | (NSString *) | labelPrefix | |
project: | (nullable FlutterDartProject *) | project | |
allowHeadlessExecution: | (BOOL) | allowHeadlessExecution | |
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.
labelPrefix | The 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. |
project | The FlutterDartProject to run. |
allowHeadlessExecution | Whether or not to allow this instance to continue running after passing a nil FlutterViewController to -setViewController: . |
|
implementation |
Reimplemented in FlutterHeadlessDartRunner.
Definition at line 157 of file FlutterEngine.mm.
- (instancetype) initWithName: | (NSString *) | labelPrefix | |
project: | (nullable FlutterDartProject *) | project | |
allowHeadlessExecution: | (BOOL) | allowHeadlessExecution | |
restorationEnabled: | (BOOL) | NS_DESIGNATED_INITIALIZER | |
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.
labelPrefix | The 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. |
project | The FlutterDartProject to run. |
allowHeadlessExecution | Whether or not to allow this instance to continue running after passing a nil FlutterViewController to -setViewController: . |
restorationEnabled | Whether state restoration is enabled. When true, the framework will wait for the attached view controller to provide restoration data. |
- (instancetype) initWithScenario: | (NSString*) | scenario | |
withCompletion: | (nullable void(^)(void)) | engineRunCompletion | |
Provided by category FlutterEngine(ScenariosTest).
Definition at line 1 of file FlutterEngine+ScenariosTest.m.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterViewEngineDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Loads the AOT snapshots and instructions from the elf bundle (app_elf_snapshot.so) into _aotData, if it is present in the assets directory.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
The FlutterCompositor object currently in use by the FlutterEngine.
May be nil if the compositor has not been initialized yet.
Provided by category FlutterEngine(Test).
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
TODO(gaaclarke): Remove optional when macos supports Background Platform Channels.
Reimplemented from <FlutterBinaryMessenger>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Marks texture with the given id as available. Returns YES on success.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Reimplemented in FlutterEnginePartialMock.
Provided by category FlutterEngine(TestLowMemory).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
- (nonnull instancetype) NS_UNAVAILABLE |
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterViewEngineDelegate>.
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Requests that the task be posted back the to the Flutter engine at the target time. The target time is in the clock used by the Flutter engine.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Registers a FlutterTexture
for usage in Flutter and returns an id that can be used to reference that texture when calling into Flutter with channels. Textures must be registered on the platform thread. On success returns the pointer to the registered texture, else returns 0.
Reimplemented from <FlutterTextureRegistry>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Registers an external texture with the given id. Returns YES on success.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
An internal method that adds the view controller with the given ID.
This method assigns the controller with the ID, puts the controller into the map, and does assertions related to the implicit view ID.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Returns a registrar for registering a plugin.
pluginKey | The unique key identifying the plugin. |
Reimplemented from <FlutterPluginRegistry>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
- (BOOL) run |
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 will create a new Isolate. Subsequent calls will return immediately and have no effect.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
True if the engine is currently running.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
- (BOOL) runWithEntrypoint: | (nullable NSString *) | entrypoint |
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 will create a new Isolate. Subsequent calls will return immediately and have no effect.
entrypoint | The 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. |
- (BOOL) runWithEntrypoint: | (nullable NSString *) | entrypoint |
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 will create a new Isolate. Subsequent calls will return immediately.
entrypoint | The name of a top-level function from the same Dart library that contains the app's main() function. If this is 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. |
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
- (BOOL) runWithEntrypoint: | (nullable NSString *) | entrypoint | |
initialRoute: | (nullable NSString *) | initialRoute | |
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 will create a new Isolate. Subsequent calls will return immediately and have no effect.
entrypoint | The 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. |
initialRoute | The name of the initial Flutter Navigator Route to load. If this is FlutterDefaultInitialRoute (or nil), it will default to the "/" route. |
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
- (BOOL) runWithEntrypoint: | (nullable NSString *) | entrypoint | |
libraryURI: | (nullable NSString *) | uri | |
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 will create a new Isolate. Subsequent calls will return immediately and have no effect.
entrypoint | The 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. |
uri | The 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. |
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
- (BOOL) runWithEntrypoint: | (nullable NSString *) | entrypoint | |
libraryURI: | (nullable NSString *) | libraryURI | |
initialRoute: | (nullable NSString *) | initialRoute | |
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 will create a new Isolate. Subsequent calls will return immediately and have no effect.
entrypoint | The 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. |
libraryURI | The 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. |
initialRoute | The name of the initial Flutter Navigator Route to load. If this is FlutterDefaultInitialRoute (or nil), it will default to the "/" route. |
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
- (BOOL) runWithEntrypoint: | (nullable NSString *) | entrypoint | |
libraryURI: | (nullable NSString *) | libraryURI | |
initialRoute: | (nullable NSString *) | initialRoute | |
entrypointArgs: | (nullable NSArray< NSString * > *) | entrypointArgs | |
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 will create a new Isolate. Subsequent calls will return immediately and have no effect.
entrypoint | The 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. |
libraryURI | The 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. |
initialRoute | The name of the initial Flutter Navigator Route to load. If this is FlutterDefaultInitialRoute (or nil), it will default to the "/" route. |
entrypointArgs | Arguments passed as a list of string to Dart's entrypoint function. |
- (void) sceneDidEnterBackground: | (ios(13.0)) | API_AVAILABLE |
Provided by category FlutterEngine(Test).
- (void) sceneWillEnterForeground: | (ios(13.0)) | API_AVAILABLE |
Provided by category FlutterEngine(Test).
|
implementation |
Returns an array of screen objects representing all of the screens available on the system.
Reimplemented in MockableFlutterEngine.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Sends a binary message to the Flutter side on the specified channel, expecting an asynchronous reply.
channel | The channel name. |
message | The message. |
callback | A callback for receiving a reply. |
Reimplemented from <FlutterBinaryMessenger>.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Dispatches the given pointer event data to engine.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Sends the list of user-preferred locales to the Flutter engine.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Handles changes to the application state, sending them to the framework.
state | One of the lifecycle constants in app_lifecycle_state.h, corresponding to the Dart enum AppLifecycleState. |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Creates an accessibility channel and sets up the message handler.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Creates a platform view channel and sets up the method handler.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 157 of file FlutterEngine.mm.
- (void) shutDownEngine |
Shuts the Flutter engine if it is running. The FlutterEngine instance must always be shutdown before it may be collected. Not shutting down the FlutterEngine instance before releasing it will result in the leak of that engine instance.
Note: Called from dealloc. Should not use accessors or other methods.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Shuts down the engine if view requirement is not met, and headless execution is not allowed.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
The command line arguments array for the engine.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Reimplemented from <FlutterViewEngineDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Tests).
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Reimplemented in FlutterEnginePartialMock.
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Notifies Flutter that the content of the previously registered texture has been updated.
This will trigger a call to -[FlutterTexture copyPixelBuffer]
on the raster thread.
Reimplemented from <FlutterTextureRegistry>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
The NSUndoManager
that should be managed by the FlutterUndoManagerPlugin
. When the delegate is FlutterEngine
this will be the FlutterViewController
's undo manager.
Reimplemented from <FlutterUndoManagerDelegate>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Unregisters a FlutterTexture
that has previously regeistered with registerTexture:
. Textures must be unregistered on the platform thread.
textureId | The result that was previously returned from registerTexture: . |
Reimplemented from <FlutterTextureRegistry>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Unregisters an external texture with the given id. Returns YES on success.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 157 of file FlutterEngine.mm.
|
implementation |
Informs the engine that the specified view controller's window metrics have changed.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Returns a value published by the specified plugin.
pluginKey | The unique key identifying the plugin. |
NSNull
if nothing has been published. Will be nil
if the plugin has not been registered. Reimplemented from <FlutterPluginRegistry>.
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Notify the engine that a view for the given view controller has been loaded.
Definition at line 484 of file FlutterEngine.mm.
|
implementation |
Provided by category FlutterEngine(Test).
Definition at line 822 of file FlutterEngine.mm.
|
implementation |
Definition at line 484 of file FlutterEngine.mm.
|
protected |
Definition at line 29 of file FlutterEngine.h.
|
protected |
Definition at line 31 of file FlutterEngine.h.
|
readnonatomicassign |
The FlutterBinaryMessenger
associated with this FlutterEngine (used for communicating with channels).
Definition at line 437 of file FlutterEngine.h.
|
readnonatomicassign |
The FlutterBinaryMessenger
for communicating with this engine.
Definition at line 91 of file FlutterEngine.h.
|
readwritenonatomicassignimplementation |
Provided by category FlutterEngine(Test).
Definition at line 110 of file FlutterEngine.mm.
|
readwritenonatomicretainimplementation |
Definition at line 106 of file FlutterEngine.mm.
|
readwritenonatomiccopyimplementation |
Definition at line 105 of file FlutterEngine.mm.
|
readwritenonatomicassign |
Whether or not GPU calls are allowed.
Typically this is set when the app is backgrounded and foregrounded.
Definition at line 456 of file FlutterEngine.h.
|
readnonatomiccopy |
The UI Isolate ID of the engine.
This property will be nil if the engine is not running.
Definition at line 449 of file FlutterEngine.h.
|
readwritenonatomicstrongimplementation |
A mutable array that holds one bool value that determines if responses to platform messages are clear to execute. This value should be read or written only inside of a synchronized block and will return NO
after the FlutterEngine has been dealloc'd.
Definition at line 99 of file FlutterEngine.mm.
|
readnonatomicassign |
The FlutterBasicMessageChannel
used for communicating key events from physical keyboards
Can be nil after destroyContext
is called.
Definition at line 412 of file FlutterEngine.h.
|
readnonatomicassign |
The FlutterBasicMessageChannel
used to communicate app lifecycle events to the Dart Isolate.
Can be nil after destroyContext
is called.
Definition at line 385 of file FlutterEngine.h.
|
readnonatomicassign |
The FlutterMethodChannel
used for localization related platform messages, such as setting the locale.
Can be nil after destroyContext
is called.
Definition at line 335 of file FlutterEngine.h.
|
readnonatomicassign |
The FlutterMethodChannel
used for navigation related platform messages.
Can be nil after destroyContext
is called.
Definition at line 345 of file FlutterEngine.h.
|
readwritenonatomicassignimplementation |
This just returns the NSPasteboard so that it can be mocked in the tests.
Definition at line 112 of file FlutterEngine_Internal.h.
|
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 363 of file FlutterEngine.h.
|
readwritenonatomicstrongimplementation |
All delegates added via plugin calls to addApplicationDelegate.
Definition at line 104 of file FlutterEngine.mm.
|
readnonatomicassignimplementation |
Definition at line 101 of file FlutterEngine.mm.
|
readnonatomicassignimplementation |
All registrars returned from registrarForPlugin:
Definition at line 110 of file FlutterEngine.mm.
|
readnonatomicassignimplementation |
Definition at line 102 of file FlutterEngine.mm.
|
readnonatomicassignimplementation |
Provides the renderer config needed to initialize the engine and also handles external texture management.
Definition at line 91 of file FlutterEngine_Internal.h.
|
readnonatomicassign |
The FlutterMethodChannel
used for restoration related platform messages.
Can be nil after destroyContext
is called.
Definition at line 355 of file FlutterEngine.h.
|
readwritenonatomicassignimplementation |
True if the semantics is enabled. The Flutter framework starts sending semantics update through the embedder as soon as it is set to YES.
Definition at line 102 of file FlutterEngine_Internal.h.
|
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 404 of file FlutterEngine.h.
|
readnonatomicassign |
The FlutterBasicMessageChannel
used for communicating system events, such as memory pressure events.
Can be nil after destroyContext
is called.
Definition at line 396 of file FlutterEngine.h.
|
readnonatomicassignimplementation |
Provides the |FlutterEngineTerminationHandler| to be used for this engine.
Definition at line 122 of file FlutterEngine_Internal.h.
|
readnonatomicassign |
The FlutterMethodChannel
used to communicate text input events to the Dart Isolate.
Can be nil after destroyContext
is called.
Definition at line 374 of file FlutterEngine.h.
|
readnonatomicassign |
The FlutterTextureRegistry
associated with this FlutterEngine (used to register textures).
Definition at line 442 of file FlutterEngine.h.
|
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.
The FlutterViewController
of this engine, if any.
This view is used by legacy APIs that assume a single view.
Setting this field from nil to a non-nil view controller also updates the view controller's engine and ID.
Setting this field from non-nil to nil will terminate the engine if allowHeadlessExecution is NO.
Setting this field from non-nil to a different non-nil FlutterViewController is prohibited and will throw an assertion error.
Definition at line 327 of file FlutterEngine.h.
|
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 431 of file FlutterEngine.h.