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

    name

    The name that will present in the threads shared across the engines in this group.

    project

    The FlutterDartProject that all FlutterEngines in this group will be executing.

  • Creates a running FlutterEngine that shares components with this group.

    See

    FlutterEngineGroup

    Declaration

    Objective-C

    - (nonnull FlutterEngine *)
        makeEngineWithEntrypoint:(nullable NSString *)entrypoint
                      libraryURI:(nullable NSString *)libraryURI;

    Parameters

    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. IF nil, this will default to the same library as the main() function in the Dart program.

  • Creates a running FlutterEngine that 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

    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. 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.

  • Creates a running FlutterEngine that shares components with this group.

    See

    FlutterEngineGroupOptions

    Declaration

    Objective-C

    - (nonnull FlutterEngine *)makeEngineWithOptions:
        (nullable FlutterEngineGroupOptions *)options;

    Parameters

    options

    Options that control how a FlutterEngine should be created.