Interface BroadcastReceiverControlSurface
public interface BroadcastReceiverControlSurface
Control surface through which a
BroadcastReceiver
attaches to a FlutterEngine
.
A BroadcastReceiver
that contains a FlutterEngine
should coordinate itself with the FlutterEngine
's
BroadcastReceiverControlSurface
.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attachToBroadcastReceiver
(BroadcastReceiver broadcastReceiver, androidx.lifecycle.Lifecycle lifecycle) Call this method from theBroadcastReceiver
that is running theFlutterEngine
that is associated with thisBroadcastReceiverControlSurface
.void
Call this method from theBroadcastReceiver
that is attached to thisBroadcastReceiverControlSurfaces
'sFlutterEngine
when theBroadcastReceiver
is about to be destroyed.
-
Method Details
-
attachToBroadcastReceiver
void attachToBroadcastReceiver(@NonNull BroadcastReceiver broadcastReceiver, @NonNull androidx.lifecycle.Lifecycle lifecycle) Call this method from theBroadcastReceiver
that is running theFlutterEngine
that is associated with thisBroadcastReceiverControlSurface
.Once a
BroadcastReceiver
is created, and its associatedFlutterEngine
is executing Dart code, theBroadcastReceiver
should invoke this method. At that point theFlutterEngine
is considered "attached" to theBroadcastReceiver
and allBroadcastReceiverAware
plugins are given access to theBroadcastReceiver
. -
detachFromBroadcastReceiver
void detachFromBroadcastReceiver()Call this method from theBroadcastReceiver
that is attached to thisBroadcastReceiverControlSurfaces
'sFlutterEngine
when theBroadcastReceiver
is about to be destroyed.This method gives each
BroadcastReceiverAware
plugin an opportunity to clean up its references before theis destroyed
.
-