compareByFieldNatural<T, F> function
Comparator<T>
compareByFieldNatural<T, F>(
- F fieldValue(
- T t
- Comparator<
F> comparator = compareNaturalOrder,
Implementation
Comparator<T> compareByFieldNatural<T, F>(
F Function(T t) fieldValue, {
Comparator<F> comparator = compareNaturalOrder,
}) {
return (a, b) {
return comparator(
fieldValue(a),
fieldValue(b),
);
};
}