13

I have data stored locally in sqlite. I have a remote MySql server. In android I could setup SyncAdapter to handle the syncing between the localdb and the remotedb.

When a record is saved locally and there is an internet connection it should push the data to the server in the background. It should also periodically update the data stored in SqLite.

Now I'm trying to find the equivalent of SyncAdapter in flutter to do this but I can't seem to find one. How would I implement this functionality in flutter without having to use firebase?

Melvin
  • 925
  • 1
  • 10
  • 22
user3718908x100
  • 7,939
  • 15
  • 64
  • 123

2 Answers2

1

You can use realm-db for it. You can't sync local-db to remote easily. But everything is so easy with realm-db

secret
  • 742
  • 1
  • 7
  • 24
0

for this work, you need to add one boolean column in your database which checks if data send to the web or not. then use WorkManager to check periodically if data is updated to host or not. for this work, you can use Flutter Work manager.