flutter-todo-list-tutorial icon indicating copy to clipboard operation
flutter-todo-list-tutorial copied to clipboard

Persisting todo items

Open SimonLab opened this issue 5 years ago • 2 comments

The PR https://github.com/dwyl/flutter-todo-list-tutorial/pull/17 focused on explaining how to create a simple UI with the Flutter widgets. However it doesn't explain yet how to persist the items created while the application is running. We want to describe what are the different way to store/save data and load the information when the application is reopened.

  • [x] Simple key-value store system using the shared_preferences package. As our data is a bit more complex that just a key-value we will need first to convert the item objects to json and serialised (convert to string) them to be able to save them. #21
  • [ ] Database system with SQLite, see also the previous issue on MOOR #15
  • [ ] API system where we can save the items using a (Phoenix) REST API. We can also see how to use Phoenix Channels with Flutter, this can be useful when creating collaborative todolist for example.

see also https://flutter.dev/docs/cookbook/persistence

SimonLab avatar Sep 17 '20 14:09 SimonLab

@SimonLab how long would it take to upgrade https://github.com/dwyl/phoenix-todo-list-tutorial to have a basic API that would allow Flutter to GET/POST to use it as a Backend? 💭

nelsonic avatar Sep 17 '20 15:09 nelsonic

@nelsonic I don't think it should take too long to add and it can be nice to see the API used with Flutter

SimonLab avatar Sep 17 '20 15:09 SimonLab

Please See: https://github.com/dwyl/phoenix-todo-list-tutorial/issues/53

nelsonic avatar Nov 29 '22 10:11 nelsonic

@SimonLab can we consider this done? 💭 This tutorial is using riverpod: https://github.com/dwyl/flutter-todo-list-tutorial/blob/575a8bacdd62a91ef8eba7ec3c0e97faf37d43af/pubspec.yaml#L41

nelsonic avatar Feb 06 '23 10:02 nelsonic