pair method

Stream<bool> pair(
  1. ScannedDevice scannedDevice
)

Implementation

Stream<bool> pair(ScannedDevice scannedDevice) {
  return Stream.fromFuture(
    _checkPermissions().then(
      (value) => _channel.invokeMethod('pair', [scannedDevice.id]),
    ),
  ).flatMap((outcome) {
    if (outcome == null) {
      return _pairSubject;
    } else {
      throw UnknownException("Couldn't pair device: $outcome");
    }
  });
}