sort method

  1. @override
void sort([
  1. int compare(
    1. T a,
    2. T b
    )?
])
override

Sorts this list according to the order specified by the compare function. Listeners are notified after sorting is completed.

The compare function must act as a Comparator. The default List implementations use Comparable.compare if compare is omitted.

Implementation

@override
void sort([int Function(T a, T b)? compare]) {
  assert(_debugAssertNotDisposed());
  _list!.sort(compare);
  notifyListeners();
}