listen method

  1. @override
StreamSubscription<T> listen(
  1. void onData(
    1. T data
    )?, {
  2. Function? onError,
  3. 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);