DEV Community

DanilJames
DanilJames

Posted on • Updated on

Best practice for syncing todo list with server

Hello everyone,,
I am building a sample todo list using flutter. Currently when a check box is checked, I am making a backend call to the server to update the state and then upon successful response, I am updating the local state. The issue here is, when the server response is slow, from the UI perspective, when a checkbox is checked, nothing happens for few seconds and then gets checked. Ideally, I would like to update the UI first and then make a call to backend. But then with this approach, I have to deal with unchecking the box again if the call to server is unsuccessful or retry again after sometime. I am actually looking for patterns for variant of a second approach. i.e. When a checkbox is checked, the UI state updates and is stored locally. Then in an asynchronous manner, update the server. Are there some patterns in flutter community to achieve this? https://showbox.bio/ https://tutuapp.uno/ https://vidmate.vet/

PS: I am using Redux & Redux thunk to talk with my backend..

Top comments (8)

Collapse
Collapse
 
mickjoh98253398 profile image
Mick John

Best practice for syncing todo list with server thanks for sharing us. This particular post is really very interesting. It has a really great peace of data. I enjoyed very well with this particular blog. It has very useful information and i like the style of this article. Thanks for the share and stuff. Get best Jobs For Freelancers in Dubai provide good services visit here site for more info.

Collapse
 
zuccberg090 profile image
Collapse
 
mickjoh98253398 profile image
Mick John

It is extremely beneficial for me. Retain sharing such tips in the future also. This is actually what I am trying to find, and I'm glad to come here. The data you used in it is very useful and thanks for sharing the such information with us. Get best Mobile App Developer Dubai provide good services visit here for more info from mistersaad.com/

Collapse
 
opuslog profile image
opuslog • Edited

Thank you for your information
you can also check this
HNC
Filmyzilla

Collapse
 
zuccberg090 profile image
Zucc Berg
Collapse
 
vigzmv profile image
Vignesh M

Hi Danil, the pattern you are looking for is called Optimistic UI. You should be able to google examples for "Optimistic UI in Redux"

Some comments may only be visible to logged-in visitors. Sign in to view all comments.