asList method

List<T> asList()

Returns a List containing the elements of this iterable. If the Iterable is already a List, return the same instance (nothing new is created). Otherwise, create a new List from it. See also: Dart's native toList, which always creates a new list.

Implementation

List<T> asList() => (this is List<T>) ? (this as List<T>) : toList();