startAfterDocument method

QueryBuilder startAfterDocument(
  1. Map<String, dynamic> document
)

Implementation

QueryBuilder startAfterDocument(Map<String, dynamic> document) {
  _data = _data.skipWhile((doc) {
    for (int i = 0; i < doc.length; i++) {
      try {
        var field = doc.keys.elementAtOrNull(i);
        final a = doc[field];
        final b = document[field];
        if (a != null && b != null) {
          if (a.compareTo(b) <= 0) return true;
          if (a.compareTo(b) > 0) return false;
        }
      } catch (_) {}
    }
    return false;
  }).toList();
  return QueryBuilder(List.from(_data), this);
}