flutter_form_builder icon indicating copy to clipboard operation
flutter_form_builder copied to clipboard

Restore form state?

Open anshgwash opened this issue 4 years ago • 2 comments
trafficstars

If I turn on "don't keep activities" on Android Dev Options, the data input by user in my form gets deleted when you switch out of the app and come back (as expected).

  • Is there any way to keep or save this data and then restore the user's input?
  • This way data isn't lost if the OS decides to get rid of the app in the background.

I tried putting the form key in RestorableValue and use RestorationMixin but that doesn't seem to be working.

Any help or tips would be greatly appreciated...

anshgwash avatar May 29 '21 13:05 anshgwash

Love this question. The ability to save and restore form answers would be immensely useful for my users.

I tried doing something similar with initialValue but you'd have to restart the entire app. I would like something that refreshes the state of the form or initializes with values from data stored on disk.

Anyone else have any thoughts or suggestions?

kingcollision avatar Aug 15 '22 17:08 kingcollision

Your state management can be restore the data and set by patch value, maybe? I don't know, a suggestion

deandreamatias avatar Aug 15 '22 18:08 deandreamatias