TextField(
controller: TextEditingController.fromValue(TextEditingValue(
//设置内容
text: inputText,
//保持光标在最后
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: inputText.length)))),
)
TextField(
controller: TextEditingController.fromValue(TextEditingValue(
//设置内容
text: inputText,
//保持光标在最后
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: inputText.length)))),
)
本文标题:Flutter 输入控件TextField设置内容并保持光标(c
本文链接:https://www.haomeiwen.com/subject/rxwccctx.html
网友评论