getConnectedDeviceStreamById method

  1. @override
Stream<NearbyDevice?> getConnectedDeviceStreamById(
  1. String deviceId
)
override

Implementation

@override
Stream<NearbyDevice?> getConnectedDeviceStreamById(String deviceId) {
  const connectedDeviceChannel = EventChannel(
    "nearby_service_connected_device",
  );
  return connectedDeviceChannel.receiveBroadcastStream(deviceId).map((e) {
    final updatedResult = ResultHandler.instance.handle(e);
    return NearbyDeviceMapper.instance.mapToDevice(updatedResult);
  });
}