Interface ServicePluginBinding
public interface ServicePluginBinding
Binding that gives
ServiceAware plugins access to an associated Service.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the givenlistenerto be notified when the associatedServicegoes from background to foreground, or foreground to background.Returns theLifecycleassociated with the attachedService.Returns theServicethat is currently attached to theFlutterEnginethat owns thisServicePluginBinding.voidRemoves the givenlistener, which was previously added withaddOnModeChangeListener(ServiceAware.OnModeChangeListener).
-
Method Details
-
getService
Returns theServicethat is currently attached to theFlutterEnginethat owns thisServicePluginBinding. -
getLifecycle
Returns theLifecycleassociated with the attachedService.Use the flutter_plugin_android_lifecycle plugin to turn the returned
Objectinto aLifecycleobject. See (https://github.com/flutter/plugins/tree/master/packages/flutter_plugin_android_lifecycle). Flutter plugins that rely onLifecycleare 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. -
addOnModeChangeListener
Adds the givenlistenerto be notified when the associatedServicegoes from background to foreground, or foreground to background. -
removeOnModeChangeListener
Removes the givenlistener, which was previously added withaddOnModeChangeListener(ServiceAware.OnModeChangeListener).
-