dart:async
MultiStreamController<T> class
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
-
- Annotations
-
Constructors
- MultiStreamController()
Properties
- done → Future
read-only, inherited
- A future which is completed when the stream controller is done sending events.
- hashCode → int
read-only, inherited
- The hash code for this object.
- hasListener → bool
read-only, inherited
- Whether there is a subscriber on the Stream.
- isClosed → bool
read-only, inherited
- Whether the stream controller is closed for adding more events.
- isPaused → bool
read-only, inherited
- Whether the subscription would need to buffer events.
- onCancel ↔ (FutureOr<void> Function?()?)
read / write, inherited
- The callback which is called when the stream is canceled.
- onListen ↔ (void Function?()?)
read / write, inherited
- The callback which is called when the stream is listened to.
- onPause ↔ (void Function?()?)
read / write, inherited
- The callback which is called when the stream is paused.
- onResume ↔ (void Function?()?)
read / write, inherited
- The callback which is called when the stream is resumed.
- runtimeType → Type
read-only, inherited
- A representation of the runtime type of the object.
- sink → StreamSink<T>
read-only, inherited
- Returns a view of this object that only exposes the StreamSink interface.
- stream → Stream<T>
read-only, inherited
- The stream that this controller is controlling.
Methods
- add(T event) → void
inherited
- Sends a data
event. - addError(Object error, [StackTrace? stackTrace]) → void
inherited
- Sends or enqueues an error event.
- addErrorSync(Object error, [StackTrace? stackTrace]) → void
- Adds and delivers an error event.
- addStream(Stream<T> source, {bool? cancelOnError}) → Future
inherited
- Receives events from
source and puts them into this controller's stream. - addSync(T value) → void
- Adds and delivers an event.
- close() → Future
inherited
- Closes the stream.
- closeSync() → void
- Closes the controller and delivers a done event.
- noSuchMethod(Invocation invocation) → dynamic
inherited
- Invoked when a non-existent method or property is accessed.
- toString() → String
inherited
- A string representation of this object.
Operators
- operator ==(Object other) → bool
inherited
- The equality operator.