startAt method
Creates and returns a new Query that starts at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
fieldValues the field values to start this query at, in order of the query's order by.
Returns the created Query.
You can give fewer values than there are orderBy clauses; throws an ArgumentError if you give more. For an
ordering by FieldPath.documentId the value is a document id string. A later call of a start cursor
(startAt, startAfter or their Document variants) replaces the earlier one.
// Cities whose name is between "B" and "D" (inclusive).
final QuerySnapshot<Map<String, Object?>> snapshot = await firestore
.collection('cities')
.orderBy('name')
.startAt(['B'])
.endAt(['D'])
.get();
Implementation
Query<T> startAt(Iterable<Object?> fieldValues) {
final Bound bound = _builder.boundFromFields(
query,
'startAt',
fieldValues.toList(),
inclusive: true,
);
return _withQuery(query.startAt(bound));
}