clearPersistence method

Future<void> clearPersistence()

Clears the persistent storage, including pending writes and cached documents.

Must be called while the FirebaseFirestore instance is not started (after the app is shutdown or when the app is first initialized). On startup, this method must be called before other methods (other than FirebaseFirestore.instance.settings). If the FirebaseFirestore instance is still running, the Future will fail.

Note: clearPersistence() is primarily intended to help write reliable tests that use Cloud Firestore. It uses an efficient mechanism for dropping existing data but does not attempt to securely overwrite or otherwise make cached data unrecoverable. For applications that are sensitive to the disclosure of cached data in between user sessions, we strongly recommend not enabling persistence at all.

Implementation

Future<void> clearPersistence() {
  return _delegate.clearPersistence();
}