copyDistinct method

List<T> copyDistinct()

Returns a copy with duplicates removed while preserving order

Implementation

List<T> copyDistinct() {
  final seen = <T>{};
  return where((e) => seen.add(e)).toList();
}