Flutter Online/Offline Mode

Viewed 4772

i am just looking for ideas about how to make the app work in online and offline modes( its a shopping online app)

  • Suppose the app is running in an online mode and suddenly the internet goes if i want to switch to offline mode the data will be saved in the cash or should be in a local db suck as sqlite
  • if the app from the originally runs in offline mode where to save the data of the offline mode in a local db or Json file i am just looking for suggestions - i was always working with online modes but the customers are asking to switch thanks a lot
1 Answers

you can use connectivity to check for internet connection

This plugin allows Flutter apps to discover network connectivity and configure themselves accordingly. It can distinguish between cellular vs WiFi connection. This plugin works for iOS and Android.

if offline show saved data from a local persistent store for data persistence you can look at moor,json_store ,sqlite

Related