maxBy<C extends Comparable<C> > method
E?
maxBy<C extends Comparable<C> >(
- C getComparable(
- E
Returns the maximum value in iterable, according to the order specified by a
Comparable returned by getComparable, or null if iterable is empty.
Implementation
E? maxBy<C extends Comparable<C>>(C Function(E) getComparable) {
return max((a, b) {
final aComparable = getComparable(a);
final bComparable = getComparable(b);
return aComparable.compareTo(bComparable);
});
}