Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
io.flutter.embedding.engine.plugins.service.ServicePluginBinding Interface Reference

Public Member Functions

Service getService ()
 
Object getLifecycle ()
 
void addOnModeChangeListener (@NonNull ServiceAware.OnModeChangeListener listener)
 
void removeOnModeChangeListener (@NonNull ServiceAware.OnModeChangeListener listener)
 

Detailed Description

Binding that gives ServiceAware plugins access to an associated Service.

Definition at line 12 of file ServicePluginBinding.java.

Member Function Documentation

◆ addOnModeChangeListener()

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.

◆ getLifecycle()

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.

◆ getService()

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.

◆ removeOnModeChangeListener()

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).


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