uniqueValues<K, V> function
Implementation
List<MapEntry<K, V>> uniqueValues<K, V>(Iterable<MapEntry<K, V>> entries) {
final uniqueValues = <V>{};
final unique = <MapEntry<K, V>>[];
for (var entry in entries) {
if (!uniqueValues.contains(entry.value)) {
uniqueValues.add(entry.value);
unique.add(MapEntry(entry.key, entry.value));
}
}
return unique;
}