StreamList<E>.of constructor

StreamList<E>.of(
  1. Iterable<E> elements, {
  2. bool growable = true,
  3. OnUpdate<List<E>>? onUpdate,
  4. OnEvent<CollectionEvent<int, E>>? onEvent,
  5. OnChange<CollectionChangeEvent<int, E>>? onChange,
})

Creates a list from elements.

The Iterator of elements provides the order of the elements.

This constructor creates a growable list when growable is true; otherwise, it returns a fixed-length list.

Implementation

factory StreamList.of(
  Iterable<E> elements, {
  bool growable = true,
  OnUpdate<List<E>>? onUpdate,
  OnEvent<CollectionEvent<int, E>>? onEvent,
  OnChange<CollectionChangeEvent<int, E>>? onChange,
}) {
  return StreamList(
    value: List<E>.of(elements, growable: growable),
    onUpdate: onUpdate,
    onEvent: onEvent,
    onChange: onChange,
  );
}