Class FlutterFragmentActivity.NewEngineIntentBuilder
- java.lang.Object
-
- io.flutter.embedding.android.FlutterFragmentActivity.NewEngineIntentBuilder
-
- Enclosing class:
- FlutterFragmentActivity
public static class FlutterFragmentActivity.NewEngineIntentBuilder extends Object
Builder to create anIntent
that launches aFlutterFragmentActivity
with a newFlutterEngine
and the desired configuration.
-
-
Constructor Summary
Constructors Constructor Description NewEngineIntentBuilder(Class<? extends FlutterFragmentActivity> activityClass)
Constructor that allows thisNewEngineIntentBuilder
to be used by subclasses ofFlutterFragmentActivity
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlutterFragmentActivity.NewEngineIntentBuilder
backgroundMode(FlutterActivityLaunchConfigs.BackgroundMode backgroundMode)
The mode ofFlutterFragmentActivity
's background, eitherFlutterActivityLaunchConfigs.BackgroundMode.opaque
orFlutterActivityLaunchConfigs.BackgroundMode.transparent
.Intent
build(Context context)
Creates and returns anIntent
that will launch aFlutterFragmentActivity
with the desired configuration.FlutterFragmentActivity.NewEngineIntentBuilder
dartEntrypointArgs(List<String> dartEntrypointArgs)
The Dart entrypoint arguments will be passed as a list of string to Dart's entrypoint function.FlutterFragmentActivity.NewEngineIntentBuilder
initialRoute(String initialRoute)
The initial route that a Flutter app will render in thisFlutterFragmentActivity
, defaults to "/".
-
-
-
Constructor Detail
-
NewEngineIntentBuilder
public NewEngineIntentBuilder(@NonNull Class<? extends FlutterFragmentActivity> activityClass)
Constructor that allows thisNewEngineIntentBuilder
to be used by subclasses ofFlutterFragmentActivity
.Subclasses of
FlutterFragmentActivity
should provide their own static version ofFlutterFragmentActivity.withNewEngine()
, which returns an instance ofNewEngineIntentBuilder
constructed with aClass
reference to theFlutterFragmentActivity
subclass, e.g.:return new NewEngineIntentBuilder(MyFlutterActivity.class);
-
-
Method Detail
-
initialRoute
@NonNull public FlutterFragmentActivity.NewEngineIntentBuilder initialRoute(@NonNull String initialRoute)
The initial route that a Flutter app will render in thisFlutterFragmentActivity
, defaults to "/".
-
backgroundMode
@NonNull public FlutterFragmentActivity.NewEngineIntentBuilder backgroundMode(@NonNull FlutterActivityLaunchConfigs.BackgroundMode backgroundMode)
The mode ofFlutterFragmentActivity
's background, eitherFlutterActivityLaunchConfigs.BackgroundMode.opaque
orFlutterActivityLaunchConfigs.BackgroundMode.transparent
.The default background mode is
FlutterActivityLaunchConfigs.BackgroundMode.opaque
.Choosing a background mode of
FlutterActivityLaunchConfigs.BackgroundMode.transparent
will configure the innerFlutterView
of thisFlutterFragmentActivity
to be configured with aFlutterTextureView
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
FlutterFragmentActivity
that is configured with a background mode ofFlutterActivityLaunchConfigs.BackgroundMode.transparent
must have a theme applied to it that includes the following property:<item name="android:windowIsTranslucent">true</item>
.
-
dartEntrypointArgs
@NonNull public FlutterFragmentActivity.NewEngineIntentBuilder dartEntrypointArgs(@Nullable List<String> dartEntrypointArgs)
The Dart entrypoint arguments will be passed as a list of string to Dart's entrypoint function.A value of null means do not pass any arguments to Dart's entrypoint function.
- Parameters:
dartEntrypointArgs
- The Dart entrypoint arguments.- Returns:
- The engine intent builder.
-
-