minBy<R extends Comparable> method
T?
minBy<R extends Comparable>(
- R f(
- T
Returns the element with the minimum value of f, or null if empty.
Implementation
T? minBy<R extends Comparable<dynamic>>(R Function(T) f) {
if (isEmpty) return null;
return reduce((a, b) => f(a).compareTo(f(b)) <= 0 ? a : b);
}