offset method

Query<T> offset(
  1. int offset
)

Specifies the offset of the returned results.

This function returns a new (immutable) instance of the Query (rather than modify the existing instance) to impose the offset.

  • offset The offset to apply to the Query results
final query = firestore.collection('col').where('foo', WhereFilter.equal, 42);

query.limit(10).offset(20).get().then((querySnapshot) {
  querySnapshot.forEach((documentSnapshot) {
    print('Found document at ${documentSnapshot.ref.path}');
  });
});

Implementation

Query<T> offset(int offset) {
  final options = _queryOptions.copyWith(offset: offset);
  return Query<T>._(
    firestore: firestore,
    queryOptions: options,
  );
}