sortedBy method
Returns a new list with all elements sorted according to the order
specified by the compare
function.
Implementation
List<T> sortedBy(Comparator<T> compare, {bool growable = true}) {
final list = toList(growable: growable);
list.sort(compare);
return list;
}