Home > OS >  How can I send data from ListView into TextField in Flutter?
How can I send data from ListView into TextField in Flutter?

Time:09-07

Since my problem is not with a code, I will explain it to the images.

enter image description here

There are 3 fields that I think are textFields (Müşteri, Marka, Ürün). Clicking on these fields;

enter image description here

This opens a list. When I tap an option from this list;

enter image description here

It writes my chosen option inside this textField.

  • Which Widgets and how do I need to use it so that I can do this?
  • How can I print data from a list into textField or textFormField?
  • How can I redirect to a list when textField is clicked?

CodePudding user response:

So First You Need To Build Your From With The TextFormField feild and assign a TextEditingController to That Field, Create Your ListView With Suggestions And Make it Pop With Result when an Item is Pressed, Now Use The TextFormField onTap function To Navigate To The ListView And then Assign The Returned Value To The Field Using The Controller

CodePudding user response:

You can use TextEditingController to make that functions that you need.

  • Related