#import <FlutterEngine.h>
Instance Methods | |
(nonnull instancetype) | - initWithName:project: |
(nonnull instancetype) | - initWithName:project:allowHeadlessExecution: |
(nonnull instancetype) | - NS_UNAVAILABLE |
(BOOL) | - runWithEntrypoint: |
(void) | - shutDownEngine |
(nonnull FlutterThreadSynchronizer *) | - testThreadSynchronizer |
Protected Attributes | |
__pad0__: NSObject <FlutterTextureRegistry | |
FlutterPluginRegistry | |
Properties | |
FlutterViewController * | viewController |
id< FlutterBinaryMessenger > | binaryMessenger |
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 30 of file FlutterEngine.h.
- (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. |
- (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. |
- (nonnull instancetype) NS_UNAVAILABLE |
- (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. |
- (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 1130 of file FlutterEngine.mm.
References _threadSynchronizer.
Referenced by flutter::testing::FlutterEngineTest::ShutDownEngine(), flutter::testing::FlutterEngineTest::TearDown(), and flutter::testing::TEST_F().
- (nonnull FlutterThreadSynchronizer*) testThreadSynchronizer |
Provided by category FlutterEngine(Tests).
|
protected |
Definition at line 31 of file FlutterEngine.h.
|
protected |
Definition at line 31 of file FlutterEngine.h.
|
readnonatomicassign |
The FlutterBinaryMessenger
for communicating with this engine.
Definition at line 91 of file FlutterEngine.h.
Referenced by flutter::testing::TEST_F().
|
readwritenonatomicweak |
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 86 of file FlutterEngine.h.
Referenced by flutter::testing::TEST_F().