Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
io.flutter.embedding.android.FlutterPlayStoreSplitApplication Class Reference
Inheritance diagram for io.flutter.embedding.android.FlutterPlayStoreSplitApplication:

Public Member Functions

void onCreate ()
 

Detailed Description

Flutter's extension of SplitCompatApplication that injects a PlayStoreDeferredComponentManager with FlutterInjector to enable Split AOT Flutter apps.

To use this class, either have your custom application class extend FlutterPlayStoreSplitApplication or use it directly in the app's AndroidManifest.xml by adding the following line:


<manifest
...
<application
android:name="io.flutter.embedding.android.FlutterPlayStoreSplitApplication"
...>
</application>
</manifest>

This class is meant to be used with the Google Play store. Custom non-play store applications do not need to extend com.google.android.play.core.splitcompat.SplitCompatApplication and should inject a custom io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager implementation like so:


FlutterInjector.setInstance(
new FlutterInjector.Builder().setDeferredComponentManager(yourCustomManager).build());

Definition at line 42 of file FlutterPlayStoreSplitApplication.java.

Member Function Documentation

◆ onCreate()

void io.flutter.embedding.android.FlutterPlayStoreSplitApplication.onCreate ( )
inline

Definition at line 45 of file FlutterPlayStoreSplitApplication.java.

45 {
46 super.onCreate();
47 // Create and inject a PlayStoreDeferredComponentManager, which is the default manager for
48 // interacting with the Google Play Store.
49 PlayStoreDeferredComponentManager deferredComponentManager =
50 new PlayStoreDeferredComponentManager(this, null);
51 FlutterInjector.setInstance(
52 new FlutterInjector.Builder()
53 .setDeferredComponentManager(deferredComponentManager)
54 .build());
55 }

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