sortBy method

CoffeeRequestGet<T> sortBy(
  1. dynamic property,
  2. SortDirection sort
)

Creates a filter for sorting.

property: The property to sort by, either a String or a Function. sort: The direction to sort (SortDirection.asc or SortDirection.desc).

Returns a CoffeeRequestGet<T> configured for sorting.

Usage Example

sortBy('name', SortDirection.asc)
sortBy((Model model) => model.name, SortDirection.desc)

Implementation

CoffeeRequestGet<T> sortBy(dynamic property, SortDirection sort) {
  _queryParameters.add(cqf.sortBy(property, sort));
  return this;
}