text controller flutter selection with the cursor code example
Example 1: flutter texteditingcontroller cursor position
controller.text = someString;
controller.selection = TextSelection.fromPosition(TextPosition(offset: controller.text.length));
Example 2: flutter textfield cursor position
controller.text = someString;
controller.selection = TextSelection.fromPosition(TextPosition(offset: controller.text.length));