Closed
Description
My requirement is when user tap enter then auto insert two space. and my code as follows.
when I auto insert space, I expect cursor appear after space but now it appear before space
May be my code is wrong. please give me some suggestion Thank you.
I wish you can provide more examples.
@OverRide
void initState() {
this._controller.addListener(() {
this._controller.changes.first.then((value) {
if (value.item2.length >= 2 &&
value.item2[1].isInsert &&
value.item2[1].data == "\n") {
final index = this._controller.selection.baseOffset;
this._controller.document.insert(index, " ");
}
});
});
}
Metadata
Metadata
Assignees
Labels
No labels