Flutter Engine
The Flutter Engine
|
Public Member Functions | |
Service | getService () |
Object | getLifecycle () |
void | addOnModeChangeListener (@NonNull ServiceAware.OnModeChangeListener listener) |
void | removeOnModeChangeListener (@NonNull ServiceAware.OnModeChangeListener listener) |
Binding that gives ServiceAware
plugins access to an associated Service
.
Definition at line 12 of file ServicePluginBinding.java.
void io.flutter.embedding.engine.plugins.service.ServicePluginBinding.addOnModeChangeListener | ( | @NonNull ServiceAware.OnModeChangeListener | listener | ) |
Adds the given listener
to be notified when the associated Service
goes from background to foreground, or foreground to background.
Object io.flutter.embedding.engine.plugins.service.ServicePluginBinding.getLifecycle | ( | ) |
Returns the Lifecycle
associated with the attached Service
.
Use the flutter_plugin_android_lifecycle plugin to turn the returned Object
into a Lifecycle
object. See (https://github.com/flutter/plugins/tree/master/packages/flutter_plugin_android_lifecycle). Flutter plugins that rely on Lifecycle
are forced to use the flutter_plugin_android_lifecycle plugin so that the version of the Android Lifecycle library is exposed to pub, which allows Flutter to manage different versions library over time.
Service io.flutter.embedding.engine.plugins.service.ServicePluginBinding.getService | ( | ) |
Returns the Service
that is currently attached to the io.flutter.embedding.engine.FlutterEngine
that owns this ServicePluginBinding
.
void io.flutter.embedding.engine.plugins.service.ServicePluginBinding.removeOnModeChangeListener | ( | @NonNull ServiceAware.OnModeChangeListener | listener | ) |
Removes the given listener
, which was previously added with addOnModeChangeListener(ServiceAware.OnModeChangeListener)
.