StreamSubscriber<T> mixin

A minimal set of methods to add and manage StreamSubscriptions on any class.

Once mixed into a class, listeners can be created and removed with the addListener and removeListener methods respectively.

Call notifyListeners to notify all listeners of any of an event and optionally pass event data down the StreamSink.

The StreamController is created once on initialization as updateNotifier. Once closed, it cannot be reopened.

Any class that mixes in StreamSubscriber should call closeStream or dispose when it is no longer needed. If the implementing class overrides dispose, closeStream should be called by the overridden dispose method unless its called elsewhere.

Mixin Applications

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListener bool
Returns true if there are any active listeners.
no setter
numberOfListeners int
Returns the number of active listeners.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(OnUpdate<T> onUpdate) StreamSubscription<T>
Creates, stores and returns a listener.
dispose() → void
Cancels any active listeners and closes the stream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners(T event) → void
Notifies all subscribed listeners of an event.
removeListener() → void
Cancels and removes a StreamSubscription.
toString() String
A string representation of this object.
inherited

Operators

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