order<_> method

QueryBuilder<T> order<_>(
  1. QueryProperty<T, _> p, {
  2. int flags = 0,
})

Configure how the results are ordered. Pass a combination of Order flags.

For example:

final query = box
    .query()
    .order(Person_.name, flags: Order.ascending)
    .build();

Implementation

// Using Dart's cascade operator does not allow for nice chaining with build(),
// so explicitly return this for a more fluent interface.
// ignore: avoid_returning_this
QueryBuilder<T> order<_>(QueryProperty<T, _> p, {int flags = 0}) {
  checkObx(C.qb_order(_cBuilder, p._model.id.id, flags));
  return this;
}