removeDuplicates<R> method
Implementation
Iterable<E> removeDuplicates<R>([R Function(E)? key]) {
if (isEmpty) return this;
if (isPrimitive) return toSet();
if (key == null) return this;
final map = fold<Map<R, E>>({}, (map, item) {
map[key(item)] = item;
return map;
});
return map.values;
}