waitForPendingWrites method
Returns a future that completes when all the writes that are pending at the time of the call were acknowledged (or rejected) by the backend. Writes that are made later are not waited for.
If the user changes while waiting, the future fails with FirestoreErrorCode.cancelled.
The future does not complete while the network is disabled and writes are pending.
Call it before terminate when the writes matter and the cache is in memory: writes that the backend has not acknowledged are lost with a memory cache.
await firestore.waitForPendingWrites();
await firestore.terminate();
Implementation
Future<void> waitForPendingWrites() {
return client.waitForPendingWrites();
}