问题是我想在文本字段的值末尾添加“,00”在 iOS 设备中效果很好,但在 android 中光标移动到文本字段中值的起点。所以,我无法添加“,00”。
正如下面的 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 …Run Code Online (Sandbox Code Playgroud)