insertStr method
Replaces the current selection by str
Implementation
void insertStr(String str) {
final sel = selection;
text = text.replaceRange(selection.start, selection.end, str);
final len = str.length;
selection = sel.copyWith(
baseOffset: sel.start + len,
extentOffset: sel.start + len,
);
}