sort<T> static method

List<T> sort<T>(
  1. Iterable<T> list, {
  2. int compare(
    1. T,
    2. T
    )?,
})

Returns a sorted copy of list.

Implementation

static List<T> sort<T>(Iterable<T> list, {int Function(T, T)? compare}) =>
    list.toList()..sort(compare);