Flutter Engine
The Flutter Engine
|
Public Member Functions | |
void | attachToService ( @NonNull Service service, @Nullable Lifecycle lifecycle, boolean isForeground) |
void | detachFromService () |
void | onMoveToForeground () |
void | onMoveToBackground () |
Control surface through which a Service
attaches to a io.flutter.embedding.engine.FlutterEngine
.
A Service
that contains a io.flutter.embedding.engine.FlutterEngine
should coordinate itself with the io.flutter.embedding.engine.FlutterEngine
's
.
ServiceControlSurface
Definition at line 20 of file ServiceControlSurface.java.
void io.flutter.embedding.engine.plugins.service.ServiceControlSurface.attachToService | ( | @NonNull Service | service, |
@Nullable Lifecycle | lifecycle, | ||
boolean | isForeground | ||
) |
Call this method from the Service
that is running the io.flutter.embedding.engine.FlutterEngine
that is associated with this
.
ServiceControlSurface
Once a Service
is created, and its associated io.flutter.embedding.engine.FlutterEngine
is executing Dart code, the Service
should invoke this method. At that point the io.flutter.embedding.engine.FlutterEngine
is considered "attached" to the Service
and all ServiceAware
plugins are given access to the Service
.
isForeground
should be true if the given Service
is running in the foreground, false otherwise.
void io.flutter.embedding.engine.plugins.service.ServiceControlSurface.detachFromService | ( | ) |
Call this method from the Service
that is attached to this
's
ServiceControlSurfacesio.flutter.embedding.engine.FlutterEngine
when the Service
is about to be destroyed.
This method gives each ServiceAware
plugin an opportunity to clean up its references before the is destroyed
.
void io.flutter.embedding.engine.plugins.service.ServiceControlSurface.onMoveToBackground | ( | ) |
Call this method from the Service
that is attached to this
's
ServiceControlSurfaceio.flutter.embedding.engine.FlutterEngine
when the Service
goes from foreground to background.
void io.flutter.embedding.engine.plugins.service.ServiceControlSurface.onMoveToForeground | ( | ) |
Call this method from the Service
that is attached to this
's
ServiceControlSurfaceio.flutter.embedding.engine.FlutterEngine
when the Service
goes from background to foreground.