sortBy<TKey extends Comparable> method
Sorts this List by comparing the keys returned by the selector
.
Implementation
void sortBy<TKey extends Comparable>(TKey Function(TValue) selector,
[bool ascending = true]) {
sort((a, b) => ascending
? Comparable.compare(selector(a), selector(b))
: Comparable.compare(selector(b), selector(a)));
}