sortedBy<K extends Comparable<K> > method
Null safety
- K keyOf(
- T element
Creates a sorted list of the elements of the iterable.
The elements are ordered by the natural ordering of the
property keyOf
of the element.
Implementation
List<T> sortedBy<K extends Comparable<K>>(K Function(T element) keyOf) {
var elements = [...this];
mergeSortBy<T, K>(elements, keyOf, compareComparable);
return elements;
}