form_bloc
form_bloc copied to clipboard
CRUD Support - How to Prefill form fields with data from database
Hello, I'm currently using formBloc to create a form (screen 1) and then save the form field values to the database (SQFlite). The saved form is then displayed as read only inside a card widget (screen 2).
On this card, I want to be able to add a functionality (flatbutton -> on pressed) to EDIT/UPDATE the data by displaying the form (screen 1) but have all the fields pre-filled with data from the database. The issue I keep running into is that, the data in the database is saved as a String and is not accepted by the formBloc form fields.
I read about the form BLoc isEditing parameter but was not able to understand how to implement it using the set up I have above. Please let me know how to proceed.
Thanks
https://github.com/GiancarloCode/form_bloc/pull/312#issuecomment-1164240179