asSet method

Set<T> asSet()

Creates a Set containing the same elements as this iterable. If the Iterable is already a Set, return the same instance (nothing new is created). Otherwise, create a new Set from it. See also: Dart's native toSet, which always creates a new set.

Implementation

Set<T> asSet() => (this is Set<T>) ? (this as Set<T>) : toSet();