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