Flutter 输入控件TextField设置内容并保持光标(cursor)在末尾
TextField( controller: TextEditingController.fromValue(TextEditingValue( // 设置内容 text: inputText, // 保持光标在最后 selection: TextSelection.fromPosition(TextPosition( affinity: TextAffinity.downstream, offset: inputText.length)))), )