isSupersetOf method

bool isSupersetOf(
  1. Set<Object?> other
)

Utility extension methods for working with sets in Dart.

Provides helpful methods for checking subset and superset relationships between sets, particularly when working with sets of nullable objects.

Example:

final a = {1, 2};
final b = {1, 2, 3};
print(a.isSubsetOf(b)); // true
print(b.isSupersetOf(a)); // true

Returns true if this set is a superset of other, meaning it contains all elements of other. Internally delegates to isSubsetOf.

Example:

final a = {1, 2, 3};
final b = {2};
print(a.isSupersetOf(b)); // true

Implementation

bool isSupersetOf(Set<Object?> other) {
  return other.isSubsetOf(this);
}