An enhanced stream controller provided by Stream.multi.
Acts like a normal asynchronous controller, but also allows adding events synchronously. As with any synchronous event delivery, the sender should be very careful to not deliver events at times when a new listener might not be ready to receive them. That usually means only delivering events synchronously in response to other asynchronous events, because that is a time when an asynchronous event could happen.
- Implemented types
Properties
- done â Future
-
A future which is completed when the stream controller is done
sending events.
no setterinherited
- hashCode â int
-
The hash code for this object.
no setterinherited
- hasListener â bool
-
Whether there is a subscriber on the Stream.
no setterinherited
- isClosed â bool
-
Whether the stream controller is closed for adding more events.
no setterinherited
- isPaused â bool
-
Whether the subscription would need to buffer events.
no setterinherited
-
onCancel
â FutureOr<
void> Function()? -
The callback which is called when the stream is canceled.
getter/setter pairinherited
- onListen â void Function()?
-
The callback which is called when the stream is listened to.
getter/setter pairinherited
- onPause â void Function()?
-
The callback which is called when the stream is paused.
getter/setter pairinherited
- onResume â void Function()?
-
The callback which is called when the stream is resumed.
getter/setter pairinherited
- runtimeType â Type
-
A representation of the runtime type of the object.
no setterinherited
-
sink
â StreamSink<
T> -
Returns a view of this object that only exposes the StreamSink interface.
no setterinherited
-
stream
â Stream<
T> -
The stream that this controller is controlling.
no setterinherited
Methods
-
add(
T event) â void -
Sends a data
event
.inherited -
addError(
Object error, [StackTrace? stackTrace]) â void -
Sends or enqueues an error event.
inherited
-
addErrorSync(
Object error, [StackTrace? stackTrace]) â void - Adds and delivers an error event.
-
addStream(
Stream< T> source, {bool? cancelOnError}) â Future -
Receives events from
source
and puts them into this controller's stream.inherited -
addSync(
T value) â void - Adds and delivers an event.
-
close(
) â Future -
Closes the stream.
inherited
-
closeSync(
) â void - Closes the controller and delivers a done event.
-
noSuchMethod(
Invocation invocation) â dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) â String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) â bool -
The equality operator.
inherited