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 TypeMethodDescriptionvoidattachToBroadcastReceiver(BroadcastReceiver broadcastReceiver, androidx.lifecycle.Lifecycle lifecycle) Call this method from theBroadcastReceiverthat is running theFlutterEnginethat is associated with thisBroadcastReceiverControlSurface.voidCall this method from theBroadcastReceiverthat is attached to thisBroadcastReceiverControlSurfaces'sFlutterEnginewhen theBroadcastReceiveris about to be destroyed.
-
Method Details
-
attachToBroadcastReceiver
void attachToBroadcastReceiver(@NonNull BroadcastReceiver broadcastReceiver, @NonNull androidx.lifecycle.Lifecycle lifecycle) Call this method from theBroadcastReceiverthat is running theFlutterEnginethat is associated with thisBroadcastReceiverControlSurface.Once a
BroadcastReceiveris created, and its associatedFlutterEngineis executing Dart code, theBroadcastReceivershould invoke this method. At that point theFlutterEngineis considered "attached" to theBroadcastReceiverand allBroadcastReceiverAwareplugins are given access to theBroadcastReceiver. -
detachFromBroadcastReceiver
void detachFromBroadcastReceiver()Call this method from theBroadcastReceiverthat is attached to thisBroadcastReceiverControlSurfaces'sFlutterEnginewhen theBroadcastReceiveris about to be destroyed.This method gives each
BroadcastReceiverAwareplugin an opportunity to clean up its references before theis destroyed.
-