listen method
StreamSubscription<T>
listen(
- void onData(
- T data
- Function? onError,
- void onDone()?,
override
Adds a subscription to this stream.
Returns a StreamSubscription which handles events from this stream using the provided onData
, onError
and onDone
handlers.
The handlers can be changed on the subscription, but they start out as the provided functions.
Implementation
@override
StreamSubscription<T> listen(void Function(T data)? onData, {Function? onError, void Function()? onDone}) => _controller.stream.listen(onData, onError: onError, onDone: onDone);