UnmodifiableCollectiveSet<E>.bind constructor

UnmodifiableCollectiveSet<E>.bind(
  1. Collective bind, {
  2. bool unmodifiableElement = true,
  3. CollectiveSetProperties<E>? properties,
  4. Iterable<E>? elements,
})

Creates an unmodifiable wrapper around an existing CollectiveSet.

Parameters:

  • bind: The set to make unmodifiable
  • unmodifiableElement: If true, makes elements unmodifiable when they're Cells
  • properties: Optional custom properties
  • elements: Optional override elements

Implementation

UnmodifiableCollectiveSet.bind(Collective bind, {bool unmodifiableElement = true, CollectiveSetProperties<E>? properties, Iterable<E>? elements})
    : super(properties ?? CollectiveSetProperties<E>(), unmodifiableElement: unmodifiableElement,
    elements: elements ?? (unmodifiableElement ? bind.whereType<E>() : bind.whereType<E>().map<E>((e) => e is Cell ? e.unmodifiable as E : e))
);