clipboardChanged function

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

Epoch milliseconds of each clipboard change.

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