Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing VerificationCodeInput length #1

Closed
mopilo opened this issue Apr 3, 2019 · 3 comments
Closed

Changing VerificationCodeInput length #1

mopilo opened this issue Apr 3, 2019 · 3 comments

Comments

@mopilo
Copy link

mopilo commented Apr 3, 2019

I changed the length of VerificationCodeInput form 4 to 6 and I'm having errors like this.
RangeError (index): Invalid value: Not in range 0..3, inclusive: 4

@nploi
Copy link
Contributor

nploi commented Apr 3, 2019

Hi @mopilo,
If you change the length of VerificationCodeInput, you press "R" to Performing hot restart.

@mopilo
Copy link
Author

mopilo commented Apr 3, 2019

okay thanks.

@nploi nploi closed this as completed Apr 3, 2019
@TheJltres
Copy link

TheJltres commented May 6, 2019

That's not all, List FocusNode in initState, doesn't complete, you do widget.lenght, but sometimes if lengh is changed, so you have to put the lenght of user input parameter

Fails for me

  void initState() {
    if (_listFocusNode.isEmpty) {
      for (var i = 0; i < widget.length; i++) {
        _listFocusNode.add(new FocusNode());
        _listControllerText.add(new TextEditingController());
        _code[i] = " ";
      }
    }
    super.initState();
  }

Works changing lenght of class like u said before

  void initState() {
    if (_listFocusNode.isEmpty) {
      for (var i = 0; i < VerificationCodeInput().length; i++) {
        _listFocusNode.add(new FocusNode());
        _listControllerText.add(new TextEditingController());
        _code[i] = " ";
      }
    }
    super.initState();
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants