sortedBySC method

  1. @Deprecated('Dart natively supports this function. Read DartDoc comment for more info.')
List<T> sortedBySC(
  1. Comparator<T> comparator
)

Deprecation hint: Read the migration guide for more details on migrating.

Returns this as sorted list using the comparator function.

Example:

[3, 1, 5, 9, 7].sortedBy((a,b) => a.compareTo(b)); // [1, 3, 5, 7, 9]

Implementation

@Deprecated(
    'Dart natively supports this function. Read DartDoc comment for more info.')
List<T> sortedBySC(Comparator<T> comparator) {
  var list = toList();
  list.sort(comparator);
  return list;
}