description

# Set<E>.unmodifiable constructor

Set<E>.unmodifiable(

1. Iterable<E> elements

)

Creates an unmodifiable Set from `elements`.

The new set behaves like the result of Set.of, except that the set returned by this constructor is not modifiable.

    final characters = <String>{'A', 'B', 'C'};
    final unmodifiableSet = Set.unmodifiable(characters);

## Implementation

    factory Set.unmodifiable(Iterable<E> elements) =>
        UnmodifiableSetView<E>(<E>{...elements});