【发布时间】:2017-11-06 23:17:35
【问题描述】:
在 Flutter 应用程序文本框中,用户正在输入文本和数字。有什么方法可以抑制键盘建议栏?
【问题讨论】:
-
我最后使用了“keyboardType: TextInputType.emailAddress”。
在 Flutter 应用程序文本框中,用户正在输入文本和数字。有什么方法可以抑制键盘建议栏?
【问题讨论】:
使用 EditableText 类并将属性 autocorrect 设置为 false。
看看它是否有效,还没有尝试过。
【讨论】:
只需添加参数autocorrect:false,然后它会隐藏建议。
new TextField(
autocorrect: false,
controller: _tbName,
decoration: new InputDecoration(
icon: const Icon(Icons.person),
hintText: 'Enter your Name',
labelText: 'Name',
helperText: 'Required',
errorText: nameErrorText,
),
onChanged: (value) {
//save here
},
);
【讨论】:
您可以使用它来禁用建议和自动更正:
TextField(
enableSuggestions: false,
autocorrect: false
),
【讨论】: