toListE method

List<T> toListE ({bool growable: false })

Converts the enumerable to a Dart List.

Iterates over the entire enumerable, storing the elements in a list. Once iteration completes, this list is returned.

By default, the returned list is fixed-length, but can be made growable by setting the growable parameter to true.

The length of the resulting List is guaranteed to the the same length as the enumerable.

Implementation

List<T> toListE({bool growable = false}) {
  final list = <T>[];
  final iterator = this.iterator;
  while (iterator.moveNext()) {
    list.add(iterator.current);
  }

  return List.from(list, growable: growable);
}