extension ListExtension on List { /// Return a new list with only distinct elements List distinct() { final s = Set(); return this.where((element) => s.add(element)).toList(); } Iterable takeIndex(List indexes) => indexes.map((e) => this[e]); }