To put it simple:
How do i check if a StreamSubscription is canceled?
There is no
_myCustomSub.isCanceled
It seems you'd have to use one of two methods:
await
the future that signals that the StreamSubscription was canceled.Don't know of any other way.
I've run into a similar situation and my solution was to make my StreamSubscription nullable and set it to null after cancel().
await _newAlertsStreamSubscription?.cancel().then((_) {
_newAlertsStreamSubscription = null;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With