uniqueValues method
Removes duplicate values, keeping the first occurrence.
Implementation
Map<K, V> uniqueValues() {
final seen = <V>{};
return Map.fromEntries(entries.where((e) => seen.add(e.value)));
}
Removes duplicate values, keeping the first occurrence.
Map<K, V> uniqueValues() {
final seen = <V>{};
return Map.fromEntries(entries.where((e) => seen.add(e.value)));
}