Class FlutterActivity.NewEngineIntentBuilder
- java.lang.Object
-
- io.flutter.embedding.android.FlutterActivity.NewEngineIntentBuilder
-
- Enclosing class:
- FlutterActivity
public static class FlutterActivity.NewEngineIntentBuilder extends Object
Builder to create anIntentthat launches aFlutterActivitywith a newFlutterEngineand the desired configuration.
-
-
Constructor Summary
Constructors Constructor Description NewEngineIntentBuilder(Class<? extends FlutterActivity> activityClass)Constructor that allows thisNewEngineIntentBuilderto be used by subclasses ofFlutterActivity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlutterActivity.NewEngineIntentBuilderbackgroundMode(FlutterActivityLaunchConfigs.BackgroundMode backgroundMode)The mode ofFlutterActivity's background, eitherFlutterActivityLaunchConfigs.BackgroundMode.opaqueorFlutterActivityLaunchConfigs.BackgroundMode.transparent.Intentbuild(Context context)Creates and returns anIntentthat will launch aFlutterActivitywith the desired configuration.FlutterActivity.NewEngineIntentBuilderdartEntrypointArgs(List<String> dartEntrypointArgs)The Dart entrypoint arguments will be passed as a list of string to Dart's entrypoint function.FlutterActivity.NewEngineIntentBuilderinitialRoute(String initialRoute)The initial route that a Flutter app will render in thisFlutterFragment, defaults to "/".
-
-
-
Constructor Detail
-
NewEngineIntentBuilder
public NewEngineIntentBuilder(@NonNull Class<? extends FlutterActivity> activityClass)Constructor that allows thisNewEngineIntentBuilderto be used by subclasses ofFlutterActivity.Subclasses of
FlutterActivityshould provide their own static version ofFlutterActivity.withNewEngine(), which returns an instance ofNewEngineIntentBuilderconstructed with aClassreference to theFlutterActivitysubclass, e.g.:return new NewEngineIntentBuilder(MyFlutterActivity.class);
-
-
Method Detail
-
initialRoute
@NonNull public FlutterActivity.NewEngineIntentBuilder initialRoute(@NonNull String initialRoute)
The initial route that a Flutter app will render in thisFlutterFragment, defaults to "/".- Parameters:
initialRoute- The route.- Returns:
- The engine intent builder.
-
backgroundMode
@NonNull public FlutterActivity.NewEngineIntentBuilder backgroundMode(@NonNull FlutterActivityLaunchConfigs.BackgroundMode backgroundMode)
The mode ofFlutterActivity's background, eitherFlutterActivityLaunchConfigs.BackgroundMode.opaqueorFlutterActivityLaunchConfigs.BackgroundMode.transparent.The default background mode is
FlutterActivityLaunchConfigs.BackgroundMode.opaque.Choosing a background mode of
FlutterActivityLaunchConfigs.BackgroundMode.transparentwill configure the innerFlutterViewof thisFlutterActivityto be configured with aFlutterTextureViewto 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
FlutterActivitythat is configured with a background mode ofFlutterActivityLaunchConfigs.BackgroundMode.transparentmust have a theme applied to it that includes the following property:<item name="android:windowIsTranslucent">true</item>.- Parameters:
backgroundMode- The background mode.- Returns:
- The engine intent builder.
-
dartEntrypointArgs
@NonNull public FlutterActivity.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.
-
-