LinkedHashSet<E>.of constructor

LinkedHashSet<E>.of(
  1. Iterable<E> elements
)

Create a linked hash set from elements.

Creates a linked hash set as by LinkedHashSet<E>() and adds each element of elements to this set in the order they are iterated. Example:

final baseSet = <int>{1, 2, 3};
final setOf = LinkedHashSet<num>.of(baseSet);
print(setOf); // {1, 2, 3}

Implementation

factory LinkedHashSet.of(Iterable<E> elements) =>
    LinkedHashSet<E>()..addAll(elements);