contains method

bool contains(
  1. K key
)

Tests key according to mode. All-matching mode returns true unless the key is excluded; the caller is responsible for query membership.

Implementation

bool contains(K key) => switch (mode) {
  CollectionSelectionMode.none => false,
  CollectionSelectionMode.single ||
  CollectionSelectionMode.multiple => selectedKeys.contains(key),
  CollectionSelectionMode.allMatching => !excludedKeys.contains(key),
};