minBy method
Item with the smallest value, or null when empty. products.minBy((p) => p.price)
Implementation
T? minBy(Comparable<Object?> Function(T item) value) => isEmpty ? null : reduce((T a, T b) => value(a).compareTo(value(b)) <= 0 ? a : b);
Item with the smallest value, or null when empty. products.minBy((p) => p.price)
T? minBy(Comparable<Object?> Function(T item) value) => isEmpty ? null : reduce((T a, T b) => value(a).compareTo(value(b)) <= 0 ? a : b);