Replies: 2 comments 5 replies
-
Edited for clarity |
Beta Was this translation helpful? Give feedback.
0 replies
-
FD should automatically handle ID updates from a remote API: https://github.com/flutterdata/flutter_data/blob/master/test/repository/repository_test.dart#L265 You could use UUIDs for offline/un-synced models. Once synced they accept whatever the server returned, could either (a) keep the UUID or (b) be replaced by an auto-increment . Up to you how to handle a potential redirect in the UI |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there I was wondering if there's a strategy to do ID navigation. Scenario:
App is offline first
/posts/:id
If the post has a local only ID how do I save it safely to the server and have both IDs in sync?
My first thought is to make some sort of way where I replace the ID where on reconnect I delete ID, save and then replace it via
withKeyOf
. But I'm not sure if I'm over complicating things and theres an easier way. Trying to rack my brain around it.Reason why I'm doing this is that I want an offline first approach where people can only sync their data if they want. Ie: a click of a button.
Thank you in advance as always ❤️
Beta Was this translation helpful? Give feedback.
All reactions