extension SortIterable on Iterable { Iterable sortedBy(Comparable Function(T k) key) => List.of(this)..sort((a, b) => key(a).compareTo(key(b))); }