utils library

Extensions

DocumentServerSnapshots on DocumentReference<T>
QueryServerSnapshots on Query<T>

Functions

mergeFromFirestore<T>(T? existing, T? incoming, NimbostratusFromFirestore<T>? fromFirestore) → T?
A merge function for specifying how a server response from Firestore should be merged into the cache given the existing and incoming data.
serializeData<T>({required T data, required ToFirestore<T>? toFirestore}) Map<String, dynamic>
setMerge<T>(T? existingData, T? newData, [SetOptions? options]) → T?
Attempt to replicate how the Cloud Firestore server sets document data in order to support client-side cache changes. TODO: The server merge logic is more advanced than this, figure out how replicate it fully on the client for cache-first updates.
updateMerge<T>(T? existingData, T? newData) → T?
Attempt to replicate how the Cloud Firestore server updates document data in order to support client-side cache changes. TODO: The server merge logic is more advanced than this, figure out how replicate it fully on the client for cache-first updates.

Typedefs

NimbostratusFromFirestore<T> = T? Function(T? existing, T? incoming)