QueryResult<T> class
A container for paginated query results from Firestore.
This class holds both the query results and pagination information.
The generic type T represents the model class for the query results.
Typically used with FirebaseQuery's pagination methods to fetch data in chunks.
Example:
// Create a query with pagination
final query = usersCollection
.query()
.orderBy('createdAt')
.limit(10);
// Get first page
QueryResult<User> result = await query.getWithPagination();
List<User> users = result.data;
// Get next page using the last document
if (result.lastDocument != null) {
QueryResult<User> nextPage = await query
.startAfterDocument(result.lastDocument!)
.getWithPagination();
users.addAll(nextPage.data);
}
Constructors
-
QueryResult({required List<
T> data, DocumentSnapshot<Object?> ? lastDocument}) - Creates a new QueryResult instance.
Properties
-
data
→ List<
T> -
The actual data returned by the query.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
lastDocument
→ DocumentSnapshot<
Object?> ? -
The last document in the current page.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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