Package io.flutter.embedding.android
Interface FlutterEngineProvider
-
- All Known Implementing Classes:
FlutterActivity
,FlutterFragment
,FlutterFragmentActivity
public interface FlutterEngineProvider
Provides aFlutterEngine
instance to be used by aFlutterActivity
orFlutterFragment
.FlutterEngine
instances require significant time to warm up. Therefore, a developer might choose to hold onto an existingFlutterEngine
and connect it to variousFlutterActivity
s and/orFlutterFragment
s. This interface facilitates providing a cached, pre-warmedFlutterEngine
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FlutterEngine
provideFlutterEngine(Context context)
Returns theFlutterEngine
that should be used by a childFlutterFragment
.
-
-
-
Method Detail
-
provideFlutterEngine
@Nullable FlutterEngine provideFlutterEngine(@NonNull Context context)
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.
-
-