FirefuelQuery class

A complete description of which documents to read, as a value.

Every query-shaped read in firefuel (where, orderBy, limit, paginate and their stream variants) lowers through applyTo, so a filter, sort, cursor or limit is applied the same way whichever method you call. Build one when the convenience methods cannot express what you need, and pass it to query or streamQuery:

final lastFive = await notes.query(
  FirefuelQuery(
    clauses: [Clause(Note.fieldPinned, isEqualTo: true)],
    orderBy: [OrderBy(field: Note.fieldCreatedAt)],
    limitToLast: 5,
  ),
);

A query is immutable; derive variations with copyWith.

Constructors

FirefuelQuery({List<Clause> clauses = const [], List<OrderBy> orderBy = const [], int? limit, int? limitToLast, StartCursor? start, EndCursor? end})
Creates a query. Every part is optional; an empty query reads the whole collection.

Properties

clauses → List<Clause>
Filters every returned document must match (combined with AND).
final
effectiveOrderBy → List<OrderBy>
The sort order Firestore will accept for clauses.
no setter
end → EndCursor?
Where results end, by the values of the orderBy fields.
final
hashCode → int
The hash code for this object.
no setterinherited
limit → int?
Returns at most this many documents from the start of the order.
final
limitToLast → int?
Returns at most this many documents from the end of the order, still in orderBy order.
final
orderBy → List<OrderBy>
Sort order, first entry first.
final
props → List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
start → StartCursor?
Where results begin, by the values of the orderBy fields.
final
stringify → bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

applyTo<R>(Query<R> base, {DocumentSnapshot<Object?>? startAfterDocument}) → Query<R>
Applies this query to base: filters, then order, then cursors, then limits, which is the order Firestore requires them in.
copyWith({List<Clause>? clauses, List<OrderBy>? orderBy, int? limit, int? limitToLast, StartCursor? start, EndCursor? end}) → FirefuelQuery
A copy with the given parts replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited