Class FlutterFragmentActivity.NewEngineInGroupIntentBuilder
- Enclosing class:
- FlutterFragmentActivity
Intent that launches a FlutterFragmentActivity with a new
FlutterEngine by FlutterEngineGroup#createAndRunEngine.-
Constructor Summary
ConstructorsConstructorDescriptionNewEngineInGroupIntentBuilder(Class<? extends FlutterFragmentActivity> activityClass, String engineGroupId) Constructor that allows thisNewEngineInGroupIntentBuilderto be used by subclasses ofFlutterActivity. -
Method Summary
Modifier and TypeMethodDescriptionbackgroundMode(FlutterActivityLaunchConfigs.BackgroundMode backgroundMode) The mode ofFlutterFragmentActivity's background, eitherFlutterActivityLaunchConfigs.BackgroundMode.opaqueorFlutterActivityLaunchConfigs.BackgroundMode.transparent.Creates and returns anIntentthat will launch aFlutterFragmentActivitywith the desired configuration.dartEntrypoint(String dartEntrypoint) The Dart entrypoint that will be executed as soon as the Dart snapshot is loaded, default to "main".initialRoute(String initialRoute) The initial route that a Flutter app will render in thisFlutterFragmentActivity, defaults to "/".
-
Constructor Details
-
NewEngineInGroupIntentBuilder
public NewEngineInGroupIntentBuilder(@NonNull Class<? extends FlutterFragmentActivity> activityClass, @NonNull String engineGroupId) Constructor that allows thisNewEngineInGroupIntentBuilderto be used by subclasses ofFlutterActivity.Subclasses of
FlutterFragmentActivityshould provide their own static version ofFlutterFragmentActivity.withNewEngineInGroup(java.lang.String), which returns an instance ofNewEngineInGroupIntentBuilderconstructed with aClassreference to theFlutterFragmentActivitysubclass, e.g.:return new NewEngineInGroupIntentBuilder(FlutterFragmentActivity.class, cacheedEngineGroupId);- Parameters:
activityClass- A subclass ofFlutterFragmentActivity.engineGroupId- The engine group id.
-
-
Method Details
-
dartEntrypoint
@NonNull public FlutterFragmentActivity.NewEngineInGroupIntentBuilder dartEntrypoint(@NonNull String dartEntrypoint) The Dart entrypoint that will be executed as soon as the Dart snapshot is loaded, default to "main".- Parameters:
dartEntrypoint- The dart entrypoint's name- Returns:
- The engine group intent builder
-
initialRoute
@NonNull public FlutterFragmentActivity.NewEngineInGroupIntentBuilder initialRoute(@NonNull String initialRoute) The initial route that a Flutter app will render in thisFlutterFragmentActivity, defaults to "/". -
backgroundMode
@NonNull public FlutterFragmentActivity.NewEngineInGroupIntentBuilder backgroundMode(@NonNull FlutterActivityLaunchConfigs.BackgroundMode backgroundMode) The mode ofFlutterFragmentActivity'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 thisFlutterFragmentActivityto 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
FlutterFragmentActivitythat 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>. -
build
Creates and returns anIntentthat will launch aFlutterFragmentActivitywith the desired configuration.
-