unique<R> method
Implementation
Iterable<T> unique<R>([R Function(T e)? keyGetter]) {
Set<dynamic> keys = {};
dynamic Function(T e) getKey = keyGetter ?? (T e) => e;
return where((element) {
var key = getKey(element);
if (keys.contains(key)) {
return false;
} else {
keys.add(key);
return true;
}
});
}