mapRemoveValue<K, V> static method

void mapRemoveValue<K, V>(
  1. Map<K, List<V>> map,
  2. K key,
  3. V value
)

Removes a value from a map of lists.

Implementation

static void mapRemoveValue<K, V>(Map<K, List<V>> map, K key, V value) {
  if (value == null) return;
  // ignore: require_future_error_handling
  map.update(key, (List<V> list) => list..remove(value), ifAbsent: () => <V>[]);
}