简体   繁体   English

如何将数据从 ListView 发送到 Flutter 中的 TextField?

[英]How can I send data from ListView into TextField in Flutter?

Since my problem is not with a code, I will explain it to the images.由于我的问题不在于代码,我将向图像解释。

在此处输入图像描述

There are 3 fields that I think are textFields (Müşteri, Marka, Ürün).我认为有 3 个字段是 textFields(Müşteri、Marka、Ürün)。 Clicking on these fields;点击这些字段;

在此处输入图像描述

This opens a list.这将打开一个列表。 When I tap an option from this list;当我点击此列表中的一个选项时;

在此处输入图像描述

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?如何将列表中的数据打印到 textField 或 textFormField?
  • How can I redirect to a list when textField is clicked?单击 textField 时如何重定向到列表?

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因此,首先您需要使用TextFormField字段构建您的 From 并将TextEditingController分配给该字段,使用建议创建您的ListView并在按下项目时使其弹出结果,现在使用TextFormField onTap function 导航到ListView然后使用 Controller 将返回值分配给字段

You can use TextEditingController to make that functions that you need.您可以使用TextEditingController来制作您需要的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从同一片段中的json向服务器和即时更新列表视图发送数据 - how can i send data to server and instant update listview from json in same fragment 如何从SharedPreferences向PHP脚本发送数据并在listview中显示JSON? - How can I send data to PHP script from SharedPreferences and display JSON in listview? 如何在 Flutter 中自动刷新 listView? - how can I auto refresh listView in Flutter? 如何从flutter中的firebase数据填充列表视图 - How to populate listview from firebase data in flutter 如何从DatePicker设置TextField上的数据 - How can set data on TextField from DatePicker 如何使用表单数据(图像、纬度、经度等)从 Flutter 发送到 web 服务信息? - How can I send from Flutter to a web service information using form-data (image, latitude, longitude, etc)? Flutter ListView项根据TextField中添加的数字进行更改 - Flutter ListView item changes based on added number from TextField 我怎样才能使列表视图中的edittext数据进入数据库? - How can i make data from an edittext in a listview go into the database? 如何在 ListView 中重新排列数据库中的数据? - How can I rearrange the data from database in a ListView? 如何使用 Android 中 FirstActivity 的数据填充 SecondActivity 上的 ListView? - How can I populate a ListView on a SecondActivity with data from FirstActivity in Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM