【发布时间】:2019-11-28 12:12:07
【问题描述】:
如下面的 GIF 所示,我使用的 TextFormField 正在向后输入值。我也将TextDirection 属性设置为ltr,但它没有改变任何东西。其他TextFormFields 似乎没有这个问题。输入的文本正在使用Navigator.pop 发送回另一个屏幕,并以相同的反向发送。
导致问题的 textFormField 代码:
TextFormField(
// validator: (String value) {
// return value.isEmpty ? "task must have a name" : null;
// },
textDirection: TextDirection.ltr,
maxLength: 100,
controller: newcontroller, // Just an ordinary TextController
onChanged: (value) {
setState(() {
newcontroller.text = value;
});
},
decoration: InputDecoration(
errorText: _validate // Just a boolean value set to false by default
? 'Value Can\'t Be Empty' : null,
labelText: "name of task"
),
style: TextStyle(height: 1.2, fontSize: 20, color: Colors.black87)
)
【问题讨论】:
标签: flutter textfield direction