isEqualTo method

bool isEqualTo(
  1. Set<Object> other
)

Returns true if this and other contain exactly the same elements.

Example:

var set = {'a', 'b', 'c'};
set.isEqualTo({'b', 'a', 'c'}); // true
set.isEqualTo({'b', 'a', 'f'}); // false
set.isEqualTo({'a', 'b'}); // false
set.isEqualTo({'a', 'b', 'c', 'd'}); // false

Implementation

bool isEqualTo(Set<Object> other) =>
    this.length == other.length && this.containsAll(other);