Flutter streamBuilder showing firebase data even though I'm offline

it’s not a problematic question, asking this because just to know what actually happens behind it, I can’t find the answer in any documentation.

when I open the application without internet it shows data from firebase, and I tried to restart, then also it shows, and I tried clearing cache, but its shows the data like showing from the local database, why is this happening, is there any inbuilt local storing or something in firebase flutter?

>Solution :

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.

Leave a Reply