screenshotTaken function

Stream<int> screenshotTaken({
  1. String instanceName = '',
})

Epoch milliseconds of each screenshot.

Returns a broadcast Stream of events from the screenshotTaken 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<int> screenshotTaken({String instanceName = ''}) {
  if (instanceName.isNotEmpty) {
    instanceName = '.$instanceName';
  }
  final EventChannel screenshotTakenChannel = EventChannel(
    'dev.flutter.pigeon.device_safety_info.DeviceSafetyEvents.screenshotTaken$instanceName',
    pigeonMethodCodec,
  );
  return screenshotTakenChannel.receiveBroadcastStream().map((dynamic event) {
    return event as int;
  });
}