setText method
Implementation
void setText(String text, {bool movePositionToEnd = true}) {
final curPos = (selection.end).clamp(0, this.text.length);
final pos = movePositionToEnd ? (curPos + text.length) : curPos;
this.text = text;
setCursorPosition(position: pos);
}