forEach<T> method
Null safety
when the stream
emits new data and the result of onData
is emitted.
forEach completes when the event handler is cancelled or when
the provided stream
has ended.
Implementation
Future<void> forEach<T>(
Stream<T> stream,
FutureOr<State> Function(T) onData,
);