Flutter Engine
The Flutter Engine
|
Public Member Functions | |
FlutterEngine | provideFlutterEngine (@NonNull Context context) |
Provides a io.flutter.embedding.engine.FlutterEngine
instance to be used by a
or
FlutterActivityFlutterFragment
.
io.flutter.embedding.engine.FlutterEngine
instances require significant time to warm up. Therefore, a developer might choose to hold onto an existing io.flutter.embedding.engine.FlutterEngine
and connect it to various FlutterActivity
s and/or FlutterFragment
s. This interface facilitates providing a cached, pre-warmed io.flutter.embedding.engine.FlutterEngine
.
Definition at line 22 of file FlutterEngineProvider.java.
FlutterEngine io.flutter.embedding.android.FlutterEngineProvider.provideFlutterEngine | ( | @NonNull Context | context | ) |
Returns the io.flutter.embedding.engine.FlutterEngine
that should be used by a child FlutterFragment
.
This method may return a new io.flutter.embedding.engine.FlutterEngine
, an existing, cached FlutterEngine
, or null to express that the FlutterEngineProvider
would like the FlutterFragment
to provide its own FlutterEngine
instance.
context | The current context. e.g. An activity. |
Implemented in io.flutter.embedding.android.FlutterActivity, io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.Host, io.flutter.embedding.android.FlutterFragment, io.flutter.embedding.android.FlutterFragmentActivity, io.flutter.embedding.android.FlutterActivityTest.FlutterActivityWithProvidedEngine, io.flutter.embedding.android.FlutterFragmentActivityTest.FlutterFragmentActivityWithProvidedEngine, dev.flutter.scenarios.SpawnedEngineActivity, and dev.flutter.scenarios.SpawnMultiEngineActivity.