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

2 crashes #59

Closed
sgehrman opened this issue Jun 10, 2020 · 2 comments
Closed

2 crashes #59

sgehrman opened this issue Jun 10, 2020 · 2 comments

Comments

@sgehrman
Copy link
Contributor

sgehrman commented Jun 10, 2020

Turn on All Exceptions and there are a few.

I try to type a number and after the first character, I get an index out of range. the offset below is 1 and the length of the string is 1 (first digit).

formatAsYouType(input: textToParse).then(
(String value) {
String parsedText = value.replaceFirst(dialCode, '').trim();

      int offset = newValue.selection.baseOffset;

      try {
        if (separatorChars.hasMatch(parsedText[offset])) {

Second crash. In InputWidget. If you don't set an initialValue, then didUpdateWidget tries to access null oldWidget.initialValue.hash (initialValue is null).

@OverRide
void didUpdateWidget(InternationalPhoneNumberInput oldWidget) {
if (oldWidget.initialValue != widget.initialValue ||
oldWidget.initialValue.hash != widget.initialValue.hash) {
loadCountries(context);
initialiseWidget();

@natintosh
Copy link
Owner

Hi @sgehrman thanks for raising this, could you share how I can reproduce the first issue, like the country iso code and the phone number you were trying to input

@natintosh
Copy link
Owner

Hi @sgehrman PR #66 just fixed this issue, I didn't understand what it was at first. Thanks you, I'll be closing this now

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

No branches or pull requests

2 participants