toUnique method

List<T> toUnique()

Converts this iterable to a Set.

Example:

[1, 2, 2, 3].toSet(); // {1, 2, 3}

Implementation

List<T> toUnique() => Set<T>.from(this).toList();