minByOrNull<R extends Comparable<R> > method
T?
minByOrNull<R extends Comparable<R> >(
- R by(
- T item
- T? ifNull
Implementation
T? minByOrNull<R extends Comparable<R>>(R by(T item), [T? ifNull]) {
T? _min;
for (final t in this) {
if (_min == null || (by(t).compareTo(by(_min))) < 0) {
_min = t;
}
}
return _min ?? ifNull;
}