startAtDocument method
Creates and returns a new Query that starts at the provided document (inclusive). The starting 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 start at.
Returns the created Query.
The position includes the document id, so the query starts exactly at that document even when others have the same field values. Throws an ArgumentError if the document does not exist, if it lacks a field of the ordering, or if such a field is a server timestamp that is not committed yet.
Implementation
Query<T> startAtDocument(DocumentSnapshot<Object?> snapshot) {
checkNotNull<DocumentSnapshot<Object?>>(
snapshot,
'Provided snapshot must not be null.',
);
final Bound bound = _builder.boundFromDocument(
query,
'startAt',
snapshot.document,
inclusive: true,
);
return _withQuery(query.startAt(bound));
}