FlutterEngineGroup
@interface FlutterEngineGroup : NSObject
Represents a collection of FlutterEngines who share resources which allows them to be created with less time const and occupy less memory than just creating multiple FlutterEngines.
Deleting a FlutterEngineGroup doesn’t invalidate existing FlutterEngines, but it eliminates the possibility to create more FlutterEngines in that group.
Warning
This class is a work-in-progress and may change.-
Unavailable
Undocumented
Declaration
Objective-C
- (instancetype)init NS_UNAVAILABLE; -
Initialize a new FlutterEngineGroup.
Declaration
Objective-C
- (nonnull instancetype)initWithName:(nonnull NSString *)name project:(nullable FlutterDartProject *)project;Parameters
nameThe name that will present in the threads shared across the engines in this group.
projectThe
FlutterDartProjectthat all FlutterEngines in this group will be executing. -
Creates a running
FlutterEnginethat shares components with this group.See
FlutterEngineGroup
Declaration
Objective-C
- (nonnull FlutterEngine *) makeEngineWithEntrypoint:(nullable NSString *)entrypoint libraryURI:(nullable NSString *)libraryURI;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. IF nil, this will default to the same library as the
main()function in the Dart program. -
Creates a running
FlutterEnginethat shares components with this group.See
FlutterEngineGroup
Declaration
Objective-C
- (nonnull FlutterEngine *) makeEngineWithEntrypoint:(nullable NSString *)entrypoint libraryURI:(nullable NSString *)libraryURI initialRoute:(nullable NSString *)initialRoute;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. IF nil, this will default to the same library as the
main()function in the Dart program.initialRouteThe name of the initial Flutter
NavigatorRouteto load. If this is FlutterDefaultInitialRoute (or nil), it will default to the “/” route. -
Creates a running
FlutterEnginethat shares components with this group.See
FlutterEngineGroupOptions
Declaration
Objective-C
- (nonnull FlutterEngine *)makeEngineWithOptions: (nullable FlutterEngineGroupOptions *)options;Parameters
optionsOptions that control how a FlutterEngine should be created.
View on GitHub
Install in Dash
FlutterEngineGroup Class Reference