DocumentSnapshot<T extends Object?> class
Represents a snapshot of a document.
Parameters:
- data: The document data.
- reference: The reference to the document.
- metadata: Snapshot metadata.
- rowID: Optional row ID.
Returns: An instance of DocumentSnapshot.
Example:
var snapshot = DocumentSnapshot(data, ref, metadata, rowID);
- Implementers
Constructors
-
DocumentSnapshot(Map<
String, dynamic> data, DocumentReference<T> _reference, SnapshotMetadata _metadata, String? rowID) - DocumentSnapshot.fromJson(dynamic jsonString, dynamic db)
-
Creates a DocumentSnapshot from JSON data.
factory
Properties
- exists → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
final
- metadata → SnapshotMetadata
-
no setter
-
reference
→ DocumentReference<
T> -
no setter
- rowID → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- version → dynamic
-
final
Methods
-
data(
) → T? - Gets the data of the document.
-
get(
Object field) → dynamic - Gets the value of a specific field.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → dynamic - Converts the snapshot to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
Object field) → dynamic - Accesses a field in the document data.