in lib/src/close_guarantee_channel.dart [51:66]
StreamSubscription<T> listen(void Function(T)? onData,
{Function? onError, void Function()? onDone, bool? cancelOnError}) {
// If the channel is already disconnected, we shouldn't dispatch anything
// but a done event.
if (_channel._disconnected) {
onData = null;
onError = null;
}
var subscription = _inner.listen(onData,
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
if (!_channel._disconnected) {
_channel._subscription = subscription;
}
return subscription;
}