sortedByNumSC method
- @Deprecated('Dart natively supports this function. Read DartDoc comment for more info.')
- num valueProvider(
- T element
Deprecation hint: Read the migration guide for more details on migrating.
Returns this as sorted list using the valueProvider
function that produces
numerical values as base for sorting.
Example:
[2, 1, 3].sortedByNum((n) => n); // [1, 2, 3]
persons.sortedByNum((p) => p.age).reversed; // oldest persons first
Implementation
@Deprecated(
'Dart natively supports this function. Read DartDoc comment for more info.')
List<T> sortedByNumSC(num Function(T element) valueProvider) {
return sortedBySC((a, b) => valueProvider(a).compareTo(valueProvider(b)));
}