问题标签 [flutter-textformfield]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
flutter - TextEditingController 返回 null ,不考虑我在文本字段中键入的输入
questionController.text 总是返回一个空值。而不是我在 textformfield 中插入的任何内容。
当我调用这个类并打印输出时,它返回 null。
使用 AddUser(questionController.text);
我使用 print(question) 打印了输出,但它返回了空字符串。
flutter - 向 TextEditingController 键入包含大写和小写字符的字符串时发生异常
当我在 TextField 中输入类似“aA”的字符串时,当我输入大写字母时会发生异常,但是应用程序不会崩溃。
这是我的例外:
════════ 服务库捕获的异常═════════════════════════════␐═══════════在平台消息回调期间抛出:当 keysPressed 中没有键时,尝试发送按键按下事件。如果正在发送的键事件未正确设置其修饰符标志,则可能会出现此状态。这是事件: RawKeyDownEvent#67162(logicalKey: LogicalKeyboardKey#70039(keyId: "0x100070039", keyLabel: "Caps Lock", debugName: "Caps Lock"), physicalKey: PhysicalKeyboardKey#70039(usbHidUsage: "0x00070039", debugName: "Caps Lock")) 及其数据: RawKeyEventDataAndroid(keyLabel: flags: 8, codePoint: 0, keyCode: 115, scanCode: 58, metaState: 0, modifiers down: {}) 'package:flutter/src/services/raw_keyboard .dart':断言失败:第 666 行 pos 7:'事件是!RawKeyDownEvent || _keysPressed.isNotEmpty'
flutter - Flutter textField 小部件中的 onSubmitted 和 onEditingComplete 有什么区别?
Flutter 小部件中的onSubmitted
vs有什么区别?onEditingComplete
textField
我的意思是,onSubmitted
已经将用户输入的值传递给我们,我们可以在提交完成时使用它。为什么需要onEditingComplete
房产?
我也遇到了这个stackoverflow帖子
根据这篇帖子的置顶答案,onEditingComplete
用于确定用户提交数据后是否应该隐藏或保留键盘。如果是这种情况,为什么颤振会突飞猛进地拥有一个名为onEditingComplete
ACCEPTS A FUNCTION的属性?他们可以简单地拥有一个hideKeyboardAfterEditing
接受 true 或 false 的属性。
(我可能已经理解了此处提到的 Stack Overflow 帖子错误。但这就是我的想法)
有人可以帮我理解吗?
谢谢
flutter - 将一个数据单元的值与另一个数据单元中的用户输入相乘,并在第三个数据单元中显示该值
我有一个从 firebase 集合动态填充的数据表。有商品名称和价格,我希望用户输入数量,然后在另一个数据单元中自动计算总计(价格 * 数量)。我不确定如何将 texteditingcontroller 添加到每个数据单元的每个数量中。当我尝试添加 TextEditingController 时,它适用于所有数据单元。我需要为每个数据源进行计算。
flutter - 如何在颤动的变量列表中添加数据多文本表单字段
我想根据工作变量的数量将输入中的数据输入到变量列表中
列表 pekerja = [];
表单(键:keyform,子:ListView.builder(itemCount:pekerja.length,itemBuilder:(context,i){返回填充(填充:const EdgeInsets.all(5.0),子:表(columnWidths:{1:FractionColumnWidth( 0.4)}, defaultVerticalAlignment: TableCellVerticalAlignment.middle, children: [ TableRow( children: [ Text(pekerja[i]['nama_kasir'],style: TextStyle(color:Colors.black54, fontSize: 16,fontWeight: FontWeight.bold) ),TextFormField(maxLength:2,keyboardType:TextInputType.number,装饰:InputDecoration(labelText:“Bagi Hasil%”,填充:true,fillColor:Colors.white70),onTap:(){id = pekerja [i] [' id_kasir']; }, onSaved: (e) => bagihasil = e! , onChanged: (value) { persen.add(value.toString()); }, onFieldSubmitted: (value) { id == pekerja[i] ['id_kasir']? persen.add(value.toString()) : null; },
forms - How to disable TextFormField according to conditions?
I have 2 TextFormField, the first one is a DatePicker, the second one is a classical TextFormField where you can enter the number of hours you spent on a particular task, if you enter"2" in this field and submit the form it will save in the DB as 2 hours spent on this particular task in the selected day from the DatePicker above :
Because you can already have hours saved in the DB for a particular day and task, I want that when the user pick a date in the DatePicker:
If there are already hours saved for this date :
- the number of hours shows in the second TextFormField
- the second TextFormField is disabled
- the submit button is disabled
If there are no hours saved for this date :
- classical functionning
Here is the code of my form :
As for now I have no idea how to put a condition depending on external data for an enabled attribute of a TextFormField, and how to modify the hintText of the TextFormField depending and these data,
Any help will be welcomed :)
flutter - 如何在 Flutter 的 TextField 中添加搜索图标?
是否可以在下图中显示提示TextField
?
flutter - 如何在颤动中大写TextFormField的第一个字母
我正在尝试将 Textformfield 的第一个字母大写,为此我正在使用
但它不适用于Textformfield
,并且适用于textfield
请帮助如何做到这一点。