listAccumulator<T> function

List<T> listAccumulator<T>({
  1. required T value,
  2. List<T>? previous,
})

An Accumulator that adds all the values to a list.

Implementation

List<T> listAccumulator<T>({required T value, List<T>? previous}) =>
    (previous ?? <T>[])..add(value);