order<D> method

QueryBuilder<T> order<D>(
  1. QueryProperty<T, D> 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

QueryBuilder<T> order<D>(QueryProperty<T, D> p, {int flags = 0}) {
  checkObx(C.qb_order(_cBuilder, p._model.id.id, flags));
  // 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
  return this;
}