Iterable<T> distinctBy(bool Function(T) key) { var seen = <dynamic>{}; return where((item) => seen.add(key(item))); }