flutter - 如何使用颤动的 onChange 事件修复光标移动?
问题描述
在文本字段中键入数据时,光标不断向前移动。在它不存在之前,但一旦我连接 onChange 事件,它就会发生。
我的问题:
我的代码:
Padding(
padding: const EdgeInsets.all(8.0),
child: TextField(
controller: descriptionController,
decoration: InputDecoration(
labelText: 'Any Details',
hintText: "e.g. Whatever details you want to save",
labelStyle: textStyle,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0)
),
),
keyboardType: TextInputType.text,
onChanged: (String string){
setState(() {
if (string != null){
coinOrder.description = string;
}
});
},
),
)
解决方案
推荐阅读
- symfony - 无法覆盖 framework.disallow_search_engine_index
- python - Python数据框在缺少键的范围内为缺少的行附加默认值的行
- linux - 激活 XKB 配置时出错。它可以在各种情况下发生
- android - 如何在 androidManifest 更改后重新安装应用程序而不删除以前版本的应用程序
- react-native - 如何在反应原生sqlite数据库中使用upsert
- javascript - 如何将相关项目制作到轮播
- url - 单一 URL 中的名词项目 API 访问
- google-play - 如何将用户导航到其相关商店?
- python - Tkinter 无法在 Windows 10 计算机中运行
- python - 敏感性分析贝叶斯网络