mapContainsValue<K, V> static method

  1. @useResult
bool mapContainsValue<K, V>({
  1. required Map<K, List<V>> map,
  2. required K key,
  3. required V value,
})

Returns true if the list at key within map contains value.

Implementation

@useResult
static bool mapContainsValue<K, V>({
  required Map<K, List<V>> map,
  required K key,
  required V value,
}) {
  if (value == null) {
    return false;
  }

  return map[key]?.contains(value) ?? false;
}