uniqueValues<K, V> method

Map<K, V> uniqueValues<K, V>()

Remove duplicate values from the map. Returns a new map with unique values.

Implementation

Map<K, V> uniqueValues<K, V>() {
  final map = <K, V>{};
  for (final key in keys) {
    if (!map.containsValue(this[key])) {
      map[key as K] = this[key] as V;
    }
  }
  return map;
}