doOn method

Stream<T> doOn({
  1. void listen()?,
  2. FutureOr<void> cancel()?,
  3. void pause()?,
  4. void resume()?,
  5. void data(
    1. T data
    )?,
  6. void error(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  7. void done()?,
  8. void each(
    1. Notification<T> notification
    )?,
})

Invokes the given callback at the corresponding point the the stream lifecycle. For example, if you pass in an onDone callback, it will be invoked when the stream finishes emitting items.

Implementation

Stream<T> doOn({
  void Function()? listen,
  FutureOr<void> Function()? cancel,
  void Function()? pause,
  void Function()? resume,
  void Function(T data)? data,
  void Function(Object error, StackTrace stackTrace)? error,
  void Function()? done,
  void Function(Notification<T> notification)? each,
}) =>
    DoStreamTransformer(
      onListen: listen,
      onCancel: cancel,
      onPause: pause,
      onResume: resume,
      onData: data,
      onError: error,
      onDone: done,
      onEach: each,
    ).bind(this);