user9683896
user9683896

Reputation:

What is the best way to store data from Firebase to SQLite or offline in flutter?

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

Answers (1)

Sukhi
Sukhi

Reputation: 14205

Both FireStore and Realtime Database have offline persistence.

Firestore :

Firestore.instance.settings(persistenceEnabled: true)

answer

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

Related Questions