StreamCollection<C, K, V> class
abstract
The base class for an observable collection of elements (list, map, or set.)
- Inheritance
-
- Object
- StreamValue<
C> - StreamEventProvider<
C, CollectionEvent< K, V> > - StreamCollection
- Implementers
Constructors
-
StreamCollection(C collection, {OnUpdate<
C> ? onUpdate, OnEvent<CollectionEvent< ? onEvent, OnChange<K, V> >CollectionChangeEvent< ? onChange})K, V> > - The base class for an observable collection of elements (list, map, or set.)
Properties
- hasChangeEvent → bool
-
Returns
true
if there are any active change listeners or if onChange is set.no setter - hasChangeListener → bool
-
Returns
true
if there are any active change listeners.no setter - hasEvent → bool
-
Returns
true
if there are any active event listeners or if onEvent is set.no setterinherited - hasEventListener → bool
-
Returns
true
if there are any active event listeners.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListener → bool
-
Returns
true
if there are any active listeners.no setterinherited - hasUpdate → bool
-
Returns
true
if there are any active update listeners or if onUpdate is set.no setterinherited - isObserved → bool
-
Returns
true
if there are any active listeners or if onUpdate is notnull
.no setteroverride - numberOfChangeListeners → int
-
Returns the number of active change listeners.
no setter
- numberOfEventListeners → int
-
Returns the number of active event listeners.
no setterinherited
- numberOfListeners → int
-
Returns the number of active listeners.
no setterinherited
-
onChange
↔ OnChange<
CollectionChangeEvent< ?K, V> > -
A synchronous event called individually for every element added,
removed, or updated in the collection.
getter/setter pair
-
onEvent
↔ OnEvent<
CollectionEvent< ?K, V> > -
Called when an element is added, removed, or updated in the
list/map before onUpdate is called and before the listeners
are notified of the new value.
getter/setter pairinherited
-
onUpdate
↔ OnUpdate<
C> ? -
Called after value is updated, before the listeners are notified.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ C
-
The value being observed.
getter/setter pairinherited
- wasDisposed ↔ bool
-
Set to
true
when dispose is called.getter/setter pairinherited
Methods
-
addChangeListener(
OnChange< CollectionChangeEvent< onChange) → StreamSubscription<K, V> >CollectionChangeEvent< K, V> > -
Registers a new StreamSubscription that provides a
CollectionChangeEvent
denoting when an element has been added, removed, or updated in the collection. -
addEventListener(
OnEvent< CollectionEvent< onEvent) → StreamSubscription<K, V> >CollectionEvent< K, V> > -
Registers a new StreamSubscription that provides a
CollectionEvent denoting when any elements have been added,
removed, or updated in the collection.
inherited
-
addListener(
OnUpdate< C> onUpdate) → StreamSubscription<C> -
Creates, stores and returns a listener.
inherited
-
dispose(
) → void -
Cancels any active listeners and closes the stream.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyAllListeners(
CollectionEventType type, K? key, V? value) → void - Notifies every active update, event, and change listener, as well as the onUpdate, onEvent, and onChange parameters of an event affecting a single element.
-
notifyChangeListeners(
CollectionChangeEvent< K, V> event) → void -
Notifies all subscribed changes listeners of an
event
. -
notifyEventListeners(
CollectionEvent< K, V> event) → void -
Notifies all subscribed event listeners of an
event
.inherited -
notifyListeners(
C event) → void -
Notifies all subscribed listeners of an
event
.inherited -
removeChangeListener(
) → void - Cancels and removes a change listener.
-
removeEventListener(
) → void -
Cancels and removes an event listener.
inherited
-
removeListener(
) → void -
Cancels and removes a StreamSubscription.
inherited
-
setValue(
C value) → void -
Sets the observable value to
value
without notifying the event listeners.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited