DocumentSnapshot class Null safety

A DocumentSnapshot contains data read from a document in your Cloud Firestore database. The data can be extracted with data() or get(<field>) to get a specific field.

See: firebase.google.com/docs/reference/js/firebase.firestore.DocumentSnapshot.

Properties

exists bool
Signals whether or not the data exists. true if the document exists.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
Provides the document's ID.
read-only
jsObject → DocumentSnapshotJsImpl
JS object.
final, inherited
metadata SnapshotMetadata
Non-null metadata about the DocumentSnapshot, including information about its source and local modifications.
read-only
ref DocumentReference
Non-null DocumentReference for the document included in the DocumentSnapshot.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

data() Map<String, dynamic>
Retrieves all fields in the document as a Map. [...]
get(dynamic fieldPath) → dynamic
Retrieves the field specified by fieldPath parameter at the specified field location or null if no such field exists in the document. [...]
isEqual(DocumentSnapshot other) bool
Returns true if this DocumentSnapshot is equal to the provided one.
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

Static Methods

getInstance(DocumentSnapshotJsImpl jsObject) DocumentSnapshot
Creates a new DocumentSnapshot from a jsObject.