StreamNotifier<T> class

Wraps an Stream<T> and provides an value getter.

Lazily subscribes to the stream when the first listener/subscription is added.

Constructors

StreamNotifier(Stream<T> stream)
Wraps the stream.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Maybe<T>
Returns Just the current value when present, otherwise returns None.
no setter

Methods

addListener(void onValue(T), {void onDone()?, Function? onError}) → void
Add listeners to this stream.
cancel() Future<void>
Stop receiving events and notifying listeners.
eagerListen(void onValue(Maybe<T>), {void onDone()?, void onError(Object)?}) EagerNotifierSubscription<T>
Create an EagerNotifierSubscription for this stream which notifies the current state. It allows accessing the value also.
listen(void onValue(T), {void onDone()?, void onError(Object)?}) NotifierSubscription<T>
Create an NotifierSubscription for this stream. It allows accessing the value also.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(void onValue(T), {void onDone()?, Function? onError, bool doNotCancel = false}) FutureOr<void>
Remove listeners from this stream.
toString() String
A string representation of this object.
inherited

Operators

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