Reputation:
In my app when user is offline, I want data to store in local db and then sync data with firebase.
Upvotes: 2
Views: 4383
Reputation: 14205
Both FireStore and Realtime Database have offline persistence.
Firestore :
Firestore.instance.settings(persistenceEnabled: true)
In the case of Firebase Realtime database, you don't need anything specific to set-up. Offline connectivity is automatic. So, the following line does the trick :
databaseReference.child(dbKey).set(data);
Upvotes: 3