cancelSubscription method Null safety
- StreamSubscription? subscription
Cancels the subscription. The subscriber will stop receiving events
Implementation
Future<void> cancelSubscription(StreamSubscription? subscription) async {
await subscription?.cancel();
_subscriptions.remove(subscription);
}