stopNotifications method
Implementation
@override
Future<bool> stopNotifications(String deviceId, String service,
String characteristic, int timeout) async {
final key =
"notification|$deviceId|${service.toLowerCase()}|${characteristic.toLowerCase()}";
_notificationStreams[key]?.cancel();
_notificationStreams.remove(key);
final result = await _methodChannel
.invokeMethod<Map<dynamic, dynamic>?>('stopNotifications', {
'deviceId': deviceId,
'service': service,
'characteristic': characteristic,
'timeout': timeout,
});
if (result == null || result["value"] == null) {
throw PlatformException(
code: "stopNotifications(): error retrieving value");
}
return result["value"];
}