listenToStream<T> abstract method
Returns a StreamSubscription which handles events from the stream using
the provided onData
, onError
and onDone
handlers.
Consult documentation for Stream.listen for more info.
If the returned StreamSubscription
is cancelled manually (i.e. canceled
before disposal of the parent object) Disposable will clean up the
internal reference allowing the subscription to be garbage collected.
Neither parameter may be null
.
Implementation
StreamSubscription<T> listenToStream<T>(
Stream<T> stream, void onData(T event),
{Function? onError, void onDone()?, bool? cancelOnError});