endBeforeDocument method
Creates and returns a new Query that ends before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
snapshot the snapshot of the document to end before.
Returns the created Query.
Implementation
Query<T> endBeforeDocument(DocumentSnapshot<Object?> snapshot) {
checkNotNull<DocumentSnapshot<Object?>>(
snapshot,
'Provided snapshot must not be null.',
);
final Bound bound = _builder.boundFromDocument(
query,
'endBefore',
snapshot.document,
inclusive: false,
);
return _withQuery(query.endAt(bound));
}