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