StreamCollection<C, K, V> constructor
StreamCollection<C, K, V> (
- C collection, {
- OnUpdate<
C> ? onUpdate, - OnEvent<
CollectionEvent< ? onEvent,K, V> > - OnChange<
CollectionChangeEvent< ? onChange,K, V> >
The base class for an observable collection of elements (list, map, or set.)
collection
must not be null
.
onUpdate
is a synchronous event called each time the collection
is modified and receives the entire collection as a parameter.
onEvent
is a synchronous event called each time the collection
is modified, and receives a list of all of the affected elements.
onChange is a synchronous event called individually for every element added, removed, or updated in the collection.
Implementation
StreamCollection(
C collection, {
OnUpdate<C>? onUpdate,
OnEvent<CollectionEvent<K, V>>? onEvent,
this.onChange,
}) : assert(collection != null),
super(collection, onUpdate: onUpdate, onEvent: onEvent);