distinctBy method

Iterable<T> distinctBy(
  1. dynamic selector(
    1. T input
    )
)

Implementation

Iterable<T> distinctBy(dynamic selector(T input)) {
  final set = Set<dynamic>();
  return this.where((item) {
    final key = selector(item);
    return set.add(key);
  });
}