sorted method

List<T> sorted({
  1. bool growable = true,
})

Returns a new list with all elements sorted according to natural sort order.

Implementation

List<T> sorted({bool growable = true}) {
  final list = toList(growable: growable);
  list.sort();
  return list;
}