StreamSinkTransformer<S, T>.fromHandlers constructor
- void handleData(
- S,
- EventSink<
T>
- void handleError(
- Object,
- StackTrace,
- EventSink<
T>
- void handleDone(
- EventSink<
T>
- EventSink<
Creates a StreamSinkTransformer that delegates events to the given handlers.
The handlers work exactly as they do for StreamTransformer.fromHandlers. They're called for each incoming event, and any actions on the sink they're passed are forwarded to the inner sink. If a handler is omitted, the event is passed through unaltered.
Implementation
factory StreamSinkTransformer.fromHandlers(
{void Function(S, EventSink<T>)? handleData,
void Function(Object, StackTrace, EventSink<T>)? handleError,
void Function(EventSink<T>)? handleDone}) {
return HandlerTransformer<S, T>(handleData, handleError, handleDone);
}