Set<E>.unmodifiable constructor

  1. @Since("2.12")
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.

Implementation

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

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-core/Set/Set.unmodifiable.html