distinctBy<K> method
Returns a Iterable containing only elements from the given collection
having distinct keys returned by the given selector
function.
Implementation
Iterable<E> distinctBy<K>(K Function(E element) selector) {
final set = <K>{};
return where((element) => set.add(selector(element)));
}