endAt method

QueryBuilder endAt(
  1. List values
)

Implementation

QueryBuilder endAt(List<dynamic> values) {
  _data = _data.where((doc) {
    for (int i = 0; i < values.length; i++) {
      try {
        final a = doc.values.elementAtOrNull(i);
        final b = values[i];
        if (a != null && b != null) {
          if (a.compareTo(b) > 0) return false;
          if (a.compareTo(b) < 0) return true;
        }
      } catch (_) {}
    }
    return true;
  }).toList();
  return QueryBuilder(List.from(_data), this);
}