sort<T> method
Implementation
void sort<T>(Comparable<T> Function(Dessert d) getField, bool ascending) {
desserts.sort((a, b) {
final aValue = getField(a);
final bValue = getField(b);
return ascending
? Comparable.compare(aValue, bValue)
: Comparable.compare(bValue, aValue);
});
notifyListeners();
}