uniq method

void uniq()

Make all values unique, preserving the order

Implementation

void uniq() {
  if (values.length <= 1) {
    return;
  }

  // ignore: prefer_collection_literals
  final uniques = LinkedHashMap<T, bool>();
  for (final s in values) {
    uniques[s] = true;
  }
  values.clear();
  values.addAll(uniques.keys);
}