36386

<h3>Question</h3>
In my app when user is offline, I want data to store in local db and then sync data with firebase.
<h3>Answer1:</h3>
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);
来源:https://stackoverflow.com/questions/61315478/what-is-the-best-way-to-store-data-from-firebase-to-sqlite-or-offline-in-flutter