screenCaptureChanged function
Capture/mirroring state; the current state is sent first.
Returns a broadcast Stream of events from the screenCaptureChanged event channel.
Each call to this method creates a new EventChannel, so it should
not be called multiple times for the same instanceName. To deliver
events to multiple listeners, call this method once and listen to the
returned broadcast stream multiple times instead.
Implementation
Stream<bool> screenCaptureChanged({String instanceName = ''}) {
if (instanceName.isNotEmpty) {
instanceName = '.$instanceName';
}
final EventChannel screenCaptureChangedChannel = EventChannel(
'dev.flutter.pigeon.device_safety_info.DeviceSafetyEvents.screenCaptureChanged$instanceName',
pigeonMethodCodec,
);
return screenCaptureChangedChannel.receiveBroadcastStream().map((
dynamic event,
) {
return event as bool;
});
}