StreamSinkCompleter<T> class
A sink where the destination is provided later.
The sink is a normal sink that you can add events to to immediately, but until setDestinationSink is called, the events will be buffered.
The same effect can be achieved by using a StreamController and adding it to the sink using StreamConsumer.addStream when the destination sink is ready. This class attempts to shortcut some of the overhead when possible. For example, if the sink only has events added after the destination sink has been set, those events are added directly to the sink.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sink
→ StreamSink<
T> -
The sink for this completer.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDestinationSink(
StreamSink< T> destinationSink) → void - Sets a sink as the destination for events from the StreamSinkCompleter's sink.
-
setError(
Object error, [StackTrace? stackTrace]) → void -
Completes this to a closed sink whose StreamSink.done future emits
error
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromFuture<
T> (Future< StreamSink< sinkFuture) → StreamSink<T> >T> -
Convert a
Future<StreamSink>
to aStreamSink
.