bhrott / flutter-masked-text

A masked text for Flutter.

Home Page:https://pub.dartlang.org/packages/flutter_masked_text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

moveCursorToEnd doesn't work anymore

mobilemindtec opened this issue · comments

Hi,

I'm update android version from my project, to minSdk 20 and targetSdk 30. Apparently after this change the cursor no longer stops at the end of the text, but at the position of the mask. To fix it, I added the following code (Future.delayed) to the plugin. It worked, but I don't know if it's the best thing to do:

  @override
  void set text(String newText) {
    if (super.text != newText) {
      super.text = newText;
      Future.delayed(Duration(milliseconds: 50), this.moveCursorToEnd);
    }
  }

Thanks!