On this page
Set.from factory constructor
Set.from(Creates a Set that contains all elements.
All the elements should be assignable to E. The elements iterable itself can have any type, so this constructor can be used to down-cast a Set, for example as:
Set<SuperType> superSet = ...;
Set<SubType> subSet =
new Set<SubType>.from(superSet.where((e) => e is SubType));
The created Set is a LinkedHashSet. As such, it considers elements that are equal (using ==) to be indistinguishable, and requires them to have a compatible Object.hashCode implementation.
The set is equivalent to one created by new LinkedHashSet<E>.from(elements).
Source
factory Set.from(Iterable elements) = LinkedHashSet<E>.from;
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-core/Set/Set.from.html