DocumentSnapshot<T extends dynamic>.fromJson constructor

DocumentSnapshot<T extends dynamic>.fromJson(
  1. FirebaseFirestore firestore,
  2. Map<String, Object?> json, {
  3. FirestoreDataConverter<T>? converter,
})

Builds a DocumentSnapshot from the JSON object written by toJson, for the firestore instance.

The snapshot is not from cache and has no pending writes. Pass the converter of the original snapshot to get typed data back. Throws a FirestoreException if json is not a valid document snapshot JSON object, for example one of a different project or database.

This is the JS SDK documentSnapshotFromJSON().

Implementation

factory DocumentSnapshot.fromJson(
  FirebaseFirestore firestore,
  Map<String, Object?> json, {
  FirestoreDataConverter<T>? converter,
}) {
  return snapshot_json.documentSnapshotFromJson<T>(
    firestore,
    json,
    converter,
  );
}