sortedByNumSC method

  1. @Deprecated('Dart natively supports this function. Read DartDoc comment for more info.')
List<T> sortedByNumSC(
  1. num valueProvider(
    1. 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)));
}