StreamSinkTransformer<S, T> class Null safety

A StreamSinkTransformer transforms the events being passed to a sink.

This works on the same principle as a StreamTransformer. Each transformer defines a bind method that takes in the original StreamSink and returns the transformed version. However, where a StreamTransformer transforms events after they leave the stream, this transforms them before they enter the sink.

Transformers must be able to have bind called used multiple times.

Constructors

StreamSinkTransformer.fromHandlers({void handleData(S, EventSink<T>)?, void handleError(Object, StackTrace, EventSink<T>)?, void handleDone(EventSink<T>)?})
Creates a StreamSinkTransformer that delegates events to the given handlers.
factory
StreamSinkTransformer.fromStreamTransformer(StreamTransformer<S, T> transformer)
Creates a StreamSinkTransformer that transforms events and errors using transformer.
const
factory

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

bind(StreamSink<T> sink) StreamSink<S>
Transforms the events passed to sink.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

typed<S, T>(StreamSinkTransformer transformer) StreamSinkTransformer<S, T>
Creates a wrapper that coerces the type of transformer.
Deprecated("Will be removed in future version")">@Deprecated("Will be removed in future version")