Flutter Engine
The Flutter Engine
|
Public Member Functions | |
CachedEngineIntentBuilder ( @NonNull Class<? extends FlutterActivity > activityClass, @NonNull String engineId) | |
CachedEngineIntentBuilder | destroyEngineWithActivity (boolean destroyEngineWithActivity) |
CachedEngineIntentBuilder | backgroundMode (@NonNull BackgroundMode backgroundMode) |
Intent | build (@NonNull Context context) |
Builder to create an Intent
that launches a FlutterActivity
with an existing io.flutter.embedding.engine.FlutterEngine
that is cached in io.flutter.embedding.engine.FlutterEngineCache
.
Definition at line 370 of file FlutterActivity.java.
|
inline |
Constructor that allows this CachedEngineIntentBuilder
to be used by subclasses of FlutterActivity
.
Subclasses of FlutterActivity
should provide their own static version of FlutterActivity#withCachedEngine(String)
, which returns an instance of
constructed with a
CachedEngineIntentBuilderClass
reference to the
subclass, e.g.:
FlutterActivity
return new CachedEngineIntentBuilder(MyFlutterActivity.class, engineId);
activityClass | A subclass of FlutterActivity . |
engineId | The engine id. |
Definition at line 390 of file FlutterActivity.java.
|
inline |
The mode of FlutterActivity
's background, either BackgroundMode#opaque
or BackgroundMode#transparent
.
The default background mode is BackgroundMode#opaque
.
Choosing a background mode of BackgroundMode#transparent
will configure the inner FlutterView
of this FlutterActivity
to be configured with a FlutterTextureView
to support transparency. This choice has a non-trivial performance impact. A transparent background should only be used if it is necessary for the app design being implemented.
A FlutterActivity
that is configured with a background mode of BackgroundMode#transparent
must have a theme applied to it that includes the following property: <item name="android:windowIsTranslucent">true</item>
.
backgroundMode | The background mode |
Definition at line 430 of file FlutterActivity.java.
|
inline |
Creates and returns an Intent
that will launch a FlutterActivity
with the desired configuration.
context | The context. e.g. An Activity. |
Definition at line 443 of file FlutterActivity.java.
|
inline |
Whether the cached io.flutter.embedding.engine.FlutterEngine
should be destroyed and removed from the cache when this FlutterActivity
is destroyed.
The default value is false
.
destroyEngineWithActivity | Whether to destroy the engine. |
Definition at line 405 of file FlutterActivity.java.