Interface ServicePluginBinding
-
public interface ServicePluginBindingBinding that givesServiceAwareplugins access to an associatedService.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddOnModeChangeListener(ServiceAware.OnModeChangeListener listener)Adds the givenlistenerto be notified when the associatedServicegoes from background to foreground, or foreground to background.ObjectgetLifecycle()Returns theLifecycleassociated with the attachedService.ServicegetService()Returns theServicethat is currently attached to theFlutterEnginethat owns thisServicePluginBinding.voidremoveOnModeChangeListener(ServiceAware.OnModeChangeListener listener)Removes the givenlistener, which was previously added withaddOnModeChangeListener(ServiceAware.OnModeChangeListener).
-
-
-
Method Detail
-
getService
@NonNull Service getService()
Returns theServicethat is currently attached to theFlutterEnginethat owns thisServicePluginBinding.
-
getLifecycle
@Nullable Object 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
void addOnModeChangeListener(@NonNull ServiceAware.OnModeChangeListener listener)Adds the givenlistenerto be notified when the associatedServicegoes from background to foreground, or foreground to background.
-
removeOnModeChangeListener
void removeOnModeChangeListener(@NonNull ServiceAware.OnModeChangeListener listener)Removes the givenlistener, which was previously added withaddOnModeChangeListener(ServiceAware.OnModeChangeListener).
-
-