Reputation: 1
I need to create a CRUD in Flutter that connects to an online database but if it loses the connection it can work with a local database but when recovering the connection it can send that data to the online database How can I do it ?
Upvotes: 0
Views: 607
Reputation: 11
There is a dependency to check the Offline online status of the device in flutter flutter_offline You can use this dependency and based on the status you just call CRUD operations server/local
Here is the sample application where it will check the online offline status of the device
Upvotes: 1
Reputation: 249
you must have an offline database like Sqlite and an online database with similar structure. you can check the internet connection and when user is offline, do crud with offline database and when user comes online, read database and send changes to your server database.
Upvotes: 0