form_bloc icon indicating copy to clipboard operation
form_bloc copied to clipboard

How to load form with data from database, change data and update data

Open contactlutforrahman opened this issue 5 years ago • 3 comments

Hey all, I'm trying to make a simple crud app using form_bloc and sqflite. I did the create, search and delete successfully. Now I'm stuck on updating data.

Can anyone please share codes about how to show data in form, after getting it from database? And then change some data in form and update data into database?

contactlutforrahman avatar Jul 17 '20 18:07 contactlutforrahman

@contactlutforrahman Hi, I will create an example tomorrow While you can check this to load data https://giancarlocode.github.io/form_bloc/#/loading_and_initializing_example then in the onSubmit method update the data in the database

GiancarloCode avatar Jul 17 '20 20:07 GiancarloCode

Hey @GiancarloCode , I'm still waiting. Actually, I'm working in a client project. I need your kind help. Can you please share me a source code or full curd using flutter, flutter_form_bloc and sqflite? Thanks in advance.

contactlutforrahman avatar Jul 19 '20 03:07 contactlutforrahman

@contactlutforrahman, What have you tried? On your update screen is it a single record? Have you got the data showing up on the screen? You should be querying the sqflite database in your onLoading. It's that what you are doing? Julian

JulianSwales avatar Jul 19 '20 22:07 JulianSwales