SortOrder<T extends Object?>.custom constructor

SortOrder<T extends Object?>.custom(
  1. String field,
  2. int compare(
    1. T value1,
    2. T value2
    ), [
  3. bool ascending = true,
  4. bool nullLast = false,
])

Sort order on given field; by default ascending is true, nullLast is false.

When ascending nulls are position first, When not ascending nulls are positioned last

nullLast means nulls are sorted last in ascending order so if not ascending, it means null are sorted first

Implementation

factory SortOrder.custom(
    String field, int Function(T value1, T value2) compare,
    [bool ascending = true, bool nullLast = false]) {
  return SembastCustomSortOrder<T>(field, compare, ascending, nullLast);
}