DoOnStreamExtensions<T> extension

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.

on

Methods

doOn({void listen()?, FutureOr<void> cancel()?, void pause()?, void resume()?, void data(T data)?, void error(Object error, StackTrace stackTrace)?, void done()?, void each(Notification<T> notification)?}) Stream<T>
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.