onEach<T> method
Null safety
- Stream<
T> stream, - void onData(
- T
Subscribes to the provided stream
and invokes the onData
callback
when the stream
emits new data.
onEach completes when the event handler is cancelled or when
the provided stream
has ended.
Implementation
Future<void> onEach<T>(Stream<T> stream, void Function(T) onData);