StreamCollection<C, K, V> constructor

StreamCollection<C, K, V>(
  1. C collection, {
  2. OnUpdate<C>? onUpdate,
  3. OnEvent<CollectionEvent<K, V>>? onEvent,
  4. OnChange<CollectionChangeEvent<K, V>>? onChange,
})

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);