toUnmodifiableList method
Transforms this iterable into an unmodifiable List.
This function is non-deterministic if this iterable is unordered, e.g. HashSet.
See toList for creating a modifiable List.
[1, 2, 3].toUnmodifiableList(); // [1, 2, 3]
Implementation
@useResult
List<E> toUnmodifiableList() => List.unmodifiable(this);