distinct property

Iterable<E> distinct

Returns a Iterable containing only distinct elements from the given collection.

Implementation

Iterable<E> get distinct {
  final set = <E>{};

  return where((element) => set.add(element));
}