sortList method

void sortList(
  1. int sorting(
    1. T a,
    2. T b
    )
)

Implementation

void sortList(int Function(T a, T b) sorting) {
  _lastSorting = sorting;
  _sortedList.clear();
  _sortedList
      .addAll(List<T>.from(_filteredList.isEmpty ? _list : _filteredList));
  _sortedList.sort(sorting);
  _controllerListener?.onListChanged(_sortedList);
}