public interface FlutterEngineProvider
FlutterEngine instance to be used by a FlutterActivity or FlutterFragment.
FlutterEngine instances require significant time to warm
up. Therefore, a developer might choose to hold onto an existing FlutterEngine and connect it to various FlutterActivitys
and/or FlutterFragments. This interface facilitates providing a cached, pre-warmed FlutterEngine.
| Modifier and Type | Method and Description |
|---|---|
FlutterEngine |
provideFlutterEngine(Context context)
Returns the
FlutterEngine that should be used by a child
FlutterFragment. |
@Nullable FlutterEngine provideFlutterEngine(@NonNull Context context)
FlutterEngine that should be used by a child
FlutterFragment.
This method may return a new FlutterEngine, an existing,
cached FlutterEngine, or null to express that the FlutterEngineProvider would
like the FlutterFragment to provide its own FlutterEngine instance.