sort method

Future<void> sort(
  1. Field field,
  2. Order order
)

Implementation

Future<void> sort(Field field, Order order) async {
  final Sort sort = Sort(fieldId: field.id, order: order);
  emit(state.copyWith(
    isLoading: true,
    sort: sort == state.sort ? null : sort,
  ));
  await makeFiltersBackup();
  await _loadData(modelId: state.model.id);
}