sorted method

List<T> sorted({
  1. bool descending = false,
})

Implementation

List<T> sorted({bool descending = false}) => descending
    ? ([...this]..sort(descendingComparator))
    : ([...this]..sort(ascendingComparator));