containsAll method

  1. @override
bool containsAll(
  1. Iterable<Object?> items
)
override

Whether this set contains all the elements of other.

final characters = <String>{'A', 'B', 'C'};
final containsAB = characters.containsAll({'A', 'B'});
print(containsAB); // true
final containsAD = characters.containsAll({'A', 'D'});
print(containsAD); // false

Implementation

@override
bool containsAll(Iterable<Object?> items) {
  for (final item in items) {
    if (!contains(item)) return false;
  }
  return true;
}