# FlutterEngineGroup

Objective-C

    @interface FlutterEngineGroup : NSObject

Swift

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

See

https://github.com/flutter/flutter/issues/72009

- `-init`

  Unavailable

  Undocumented

  #### Declaration

  Objective-C

      - (instancetype)init NS_UNAVAILABLE;

- `-initWithName:project:`

  Initialize a new FlutterEngineGroup.

  #### Declaration

  Objective-C

      - (nonnull instancetype)initWithName:(nonnull NSString *)name
                                   project:(nullable FlutterDartProject *)project;

  Swift

      init(name: String, project: FlutterDartProject?)

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

- `-makeEngineWithEntrypoint:libraryURI:`

  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;

  Swift

      func makeEngine(withEntrypoint entrypoint: String?, libraryURI: String?) -> FlutterEngine

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

- `-makeEngineWithEntrypoint:libraryURI:initialRoute:`

  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;

  Swift

      func makeEngine(withEntrypoint entrypoint: String?, libraryURI: String?, initialRoute: String?) -> FlutterEngine

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

- `-makeEngineWithOptions:`

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

  See

  FlutterEngineGroupOptions

  #### Declaration

  Objective-C

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

  Swift

      func makeEngine(with options: FlutterEngineGroupOptions?) -> FlutterEngine

  #### Parameters

  `options` | Options that control how a FlutterEngine should be created.

© 2023 Flutter. All rights reserved. (Last updated: 2023-05-08)

Generated by jazzy ♪♫ v0.14.3, a Realm project.