how to add test to textformfield controller and put cursor at the end code example
Example: flutter texteditingcontroller cursor position
controller.text = someString;
controller.selection = TextSelection.fromPosition(TextPosition(offset: controller.text.length));