description

# MultiStreamController<T> class Null safety

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 generally means only delivering events synchronously in response to other asynchronous events, because that is a time when an asynchronous event could happen.

Implemented types
  - StreamController<T>
Annotations
  - @Since("2.9")

## Constructors

MultiStreamController()

## Properties

done → Future
  A future which is completed when the stream controller is done sending events. [...]
  read-only, inherited
hashCode → int
  The hash code for this object. [...]
  read-only, inherited
hasListener → bool
  Whether there is a subscriber on the Stream.
  read-only, inherited
isClosed → bool
  Whether the stream controller is closed for adding more events. [...]
  read-only, inherited
isPaused → bool
  Whether the subscription would need to buffer events. [...]
  read-only, inherited
onCancel ↔ (FutureOr<void> Function?()?)
  The callback which is called when the stream is canceled. [...]
  read / write, inherited
onListen ↔ (void Function?()?)
  The callback which is called when the stream is listened to. [...]
  read / write, inherited
onPause ↔ (void Function?()?)
  The callback which is called when the stream is paused. [...]
  read / write, inherited
onResume ↔ (void Function?()?)
  The callback which is called when the stream is resumed. [...]
  read / write, inherited
runtimeType → Type
  A representation of the runtime type of the object.
  read-only, inherited
sink → StreamSink<T>
  Returns a view of this object that only exposes the StreamSink interface.
  read-only, inherited
stream → Stream<T>
  The stream that this controller is controlling.
  read-only, inherited

## 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 non-existent method or property is accessed. [...]
  inherited
toString() → String
  Returns a string representation of this object.
  inherited

## Operators

operator ==(Object other) → bool
  The equality operator. [...]
  inherited