TextEditingController控制输入框光标位置

保持在末尾

var titleController = TextEditingController();
titleController.text = '测试';
titleController.selection = TextSelection.fromPosition(TextPosition(offset: titleController.text.length));

全选

var titleController = TextEditingController();
titleController.text = '测试';
titleController.selection = TextSelection(baseOffset: 0, extentOffset: titleController.text.length);