documentSnapshotsFromJson<T> method

Stream<DocumentSnapshot<T>> documentSnapshotsFromJson<T>(
  1. Map<String, Object?> json, {
  2. bool includeMetadataChanges = false,
  3. ListenSource source = ListenSource.defaultSource,
  4. FirestoreDataConverter<T>? converter,
})

Listens to the document of a DocumentSnapshot.toJson result, starting from that snapshot.

The document in json is loaded into the local cache (as with loadBundle) and the document is then listened to with includeMetadataChanges and source, so the first event can be raised from the cache. Pass the converter of the original reference to get typed snapshots. Throws a FirestoreException if json is not a document snapshot JSON object; errors loading the bundle are delivered on the stream. The stream is single-subscription and starts with the current state of the document; it does not replay.

Implementation

Stream<DocumentSnapshot<T>> documentSnapshotsFromJson<T>(
  Map<String, Object?> json, {
  bool includeMetadataChanges = false,
  ListenSource source = ListenSource.defaultSource,
  FirestoreDataConverter<T>? converter,
}) {
  return snapshot_json.documentSnapshotsFromJson<T>(
    this,
    json,
    includeMetadataChanges: includeMetadataChanges,
    source: source,
    converter: converter,
  );
}