Home > Enterprise >  Flutter StreamBuilder shows Firebase data even when I'm offline
Flutter StreamBuilder shows Firebase data even when I'm offline

Time:05-15

This is not a problematic question, it was asked because just wanted to know what's actually going on behind it, I can't find an answer in any documentation.

When i open the app without internet it shows the data from firebase, i try to restart then it also shows, i try to clear the cache but it shows the data like it shows from the local database, Why is this happening, is there a built-in local storage or something in Firebase Flutter?

CodePudding user response:

Firestore SDKs cache any data that they've recently seen, as well as any pending writes from the local client that haven't been synchronized to the server yet. On mobile clients (iOS and Android) this cache is enabled by default, while on web you can enable it with an API call.

For more on this, see the Firebase documentation on accessing Firestore data while you're offline.

  • Related