QueryDocumentSnapshot<T extends Object?> class Null safety

A QueryDocumentSnapshot contains data read from a document in your FirebaseFirestore database as part of a query.

A QueryDocumentSnapshot offers the same API surface as a DocumentSnapshot. Since query results contain only existing documents, the exists property will always be true and data() will never return null.

Implemented types
Annotations

Constructors

QueryDocumentSnapshot()

Properties

exists bool
Returns true if the document exists.
read-only, inherited
hashCode int
The hash code for this object.
read-only, inherited
id String
This document's given ID for this snapshot.
read-only, inherited
metadata SnapshotMetadata
Metadata about this document concerning its source and if it has local modifications.
read-only, inherited
reference DocumentReference<T>
Returns the reference of this snapshot.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

data() → T
Contains all the data of this document snapshot.
override
get(Object field) → dynamic
Gets a nested field by String or FieldPath from this DocumentSnapshot.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Object field) → dynamic
Gets a nested field by String or FieldPath from this DocumentSnapshot.
inherited