CustomSet<T> constructor
CustomSet<T> ([
- Iterable<
T> ? elements
Creates a set from an iterable of elements.
Duplicate elements are automatically removed.
If elements is null, creates an empty set.
Example:
final numbers = CustomSet<int>([1, 2, 3, 4]);
final fromSet = CustomSet<int>({5, 6, 7});
Implementation
CustomSet([Iterable<T>? elements])
: _elements = elements != null ? elements.toSet() : <T>{};