querySnapshotsFromJson<T> method
Stream<QuerySnapshot<T> >
querySnapshotsFromJson<T>(
- Map<
String, Object?> json, { - bool includeMetadataChanges = false,
- ListenSource source = ListenSource.defaultSource,
- FirestoreDataConverter<
T> ? converter,
Listens to the query of a QuerySnapshot.toJson result, resuming from that snapshot.
The query and documents in json are loaded into the local cache (as with loadBundle) and the query is then
listened to with includeMetadataChanges and source. The listen is resumed from the read time of the snapshot, so the backend only sends
what changed since then. Pass the converter of the original query to get typed snapshots. Throws a
FirestoreException if json is not a query snapshot JSON object; errors loading the bundle are delivered on the
stream. The stream is single-subscription and starts with the current results; it does not replay.
// `json` was written by QuerySnapshot.toJson, for example on a server.
firestore.querySnapshotsFromJson<Map<String, Object?>>(json).listen((
QuerySnapshot<Map<String, Object?>> snapshot,
) {
print(snapshot.length);
});
Implementation
Stream<QuerySnapshot<T>> querySnapshotsFromJson<T>(
Map<String, Object?> json, {
bool includeMetadataChanges = false,
ListenSource source = ListenSource.defaultSource,
FirestoreDataConverter<T>? converter,
}) {
return snapshot_json.querySnapshotsFromJson<T>(
this,
json,
includeMetadataChanges: includeMetadataChanges,
source: source,
converter: converter,
);
}