Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
io.flutter.embedding.android.FlutterFragmentActivity.NewEngineInGroupIntentBuilder Class Reference

Public Member Functions

 NewEngineInGroupIntentBuilder ( @NonNull Class<? extends FlutterFragmentActivity > activityClass, @NonNull String engineGroupId)
 
NewEngineInGroupIntentBuilder dartEntrypoint (@NonNull String dartEntrypoint)
 
NewEngineInGroupIntentBuilder initialRoute (@NonNull String initialRoute)
 
NewEngineInGroupIntentBuilder backgroundMode (@NonNull BackgroundMode backgroundMode)
 
Intent build (@NonNull Context context)
 

Detailed Description

Builder to create an Intent that launches a FlutterFragmentActivity with a new FlutterEngine by FlutterEngineGroup::createAndRunEngine.

Definition at line 281 of file FlutterFragmentActivity.java.

Constructor & Destructor Documentation

◆ NewEngineInGroupIntentBuilder()

io.flutter.embedding.android.FlutterFragmentActivity.NewEngineInGroupIntentBuilder.NewEngineInGroupIntentBuilder ( @NonNull Class<? extends FlutterFragmentActivity activityClass,
@NonNull String  engineGroupId 
)
inline

Constructor that allows this NewEngineInGroupIntentBuilder to be used by subclasses of FlutterActivity.

Subclasses of FlutterFragmentActivity should provide their own static version of withNewEngineInGroup, which returns an instance of
NewEngineInGroupIntentBuilder
constructed with a Class reference to the
FlutterFragmentActivity
subclass, e.g.:

return new NewEngineInGroupIntentBuilder(FlutterFragmentActivity.class,
cacheedEngineGroupId);

Parameters
activityClassA subclass of FlutterFragmentActivity.
engineGroupIdThe engine group id.

Definition at line 303 of file FlutterFragmentActivity.java.

305 {
306 this.activityClass = activityClass;
307 this.cachedEngineGroupId = engineGroupId;
308 }

Member Function Documentation

◆ backgroundMode()

NewEngineInGroupIntentBuilder io.flutter.embedding.android.FlutterFragmentActivity.NewEngineInGroupIntentBuilder.backgroundMode ( @NonNull BackgroundMode  backgroundMode)
inline

The mode of FlutterFragmentActivity'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 FlutterFragmentActivity 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 FlutterFragmentActivity 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>.

Definition at line 350 of file FlutterFragmentActivity.java.

350 {
351 this.backgroundMode = backgroundMode.name();
352 return this;
353 }

◆ build()

Intent io.flutter.embedding.android.FlutterFragmentActivity.NewEngineInGroupIntentBuilder.build ( @NonNull Context  context)
inline

Creates and returns an Intent that will launch a FlutterFragmentActivity with the desired configuration.

Definition at line 360 of file FlutterFragmentActivity.java.

360 {
361 return new Intent(context, activityClass)
362 .putExtra(EXTRA_DART_ENTRYPOINT, dartEntrypoint)
363 .putExtra(EXTRA_INITIAL_ROUTE, initialRoute)
364 .putExtra(EXTRA_CACHED_ENGINE_GROUP_ID, cachedEngineGroupId)
365 .putExtra(EXTRA_BACKGROUND_MODE, backgroundMode)
366 .putExtra(EXTRA_DESTROY_ENGINE_WITH_ACTIVITY, true);
367 }

◆ dartEntrypoint()

NewEngineInGroupIntentBuilder io.flutter.embedding.android.FlutterFragmentActivity.NewEngineInGroupIntentBuilder.dartEntrypoint ( @NonNull String  dartEntrypoint)
inline

The Dart entrypoint that will be executed as soon as the Dart snapshot is loaded, default to "main".

Parameters
dartEntrypointThe dart entrypoint's name
Returns
The engine group intent builder

Definition at line 318 of file FlutterFragmentActivity.java.

318 {
319 this.dartEntrypoint = dartEntrypoint;
320 return this;
321 }

◆ initialRoute()

NewEngineInGroupIntentBuilder io.flutter.embedding.android.FlutterFragmentActivity.NewEngineInGroupIntentBuilder.initialRoute ( @NonNull String  initialRoute)
inline

The initial route that a Flutter app will render in this FlutterFragmentActivity, defaults to "/".

Definition at line 328 of file FlutterFragmentActivity.java.

328 {
329 this.initialRoute = initialRoute;
330 return this;
331 }

The documentation for this class was generated from the following file: