Package io.flutter.embedding.android
Interface FlutterEngineProvider
- All Known Implementing Classes:
FlutterActivity
,FlutterFragment
,FlutterFragmentActivity
public interface FlutterEngineProvider
Provides a
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 FlutterActivity
s
and/or FlutterFragment
s. This interface facilitates providing a cached, pre-warmed FlutterEngine
.
-
Method Summary
Modifier and TypeMethodDescriptionprovideFlutterEngine
(Context context) Returns theFlutterEngine
that should be used by a childFlutterFragment
.
-
Method Details
-
provideFlutterEngine
Returns theFlutterEngine
that should be used by a childFlutterFragment
.This method may return a new
FlutterEngine
, an existing, cachedFlutterEngine
, or null to express that theFlutterEngineProvider
would like theFlutterFragment
to provide its ownFlutterEngine
instance.- Parameters:
context
- The current context. e.g. An activity.- Returns:
- The Flutter engine.
-