callActivity function

Stream<CallEventMsg> callActivity({
  1. String instanceName = '',
})

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