startAfterDocument method

Query<T> startAfterDocument(
  1. DocumentSnapshot<Object?> snapshot
)

Creates and returns a new Query that starts after the provided document (exclusive). 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 after.

Returns the created Query.

Implementation

Query<T> startAfterDocument(DocumentSnapshot<Object?> snapshot) {
  checkNotNull<DocumentSnapshot<Object?>>(
    snapshot,
    'Provided snapshot must not be null.',
  );
  final Bound bound = _builder.boundFromDocument(
    query,
    'startAfter',
    snapshot.document,
    inclusive: false,
  );
  return _withQuery(query.startAt(bound));
}