toList method

  1. @override
List<E> toList({
  1. bool growable = true,
})
override

As Iterable.toList.

Note that the implementation is efficient: it returns a copy-on-write wrapper around the data from this BuiltList. So, if no mutations are made to the result, no copy is made.

This allows efficient use of APIs that ask for a mutable collection but don't actually mutate it.

Implementation

@override
List<E> toList({bool growable = true}) => CopyOnWriteList<E>(_list, growable);