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

Example does not validate correctly #453

Open
allComputableThings opened this issue Nov 20, 2024 · 3 comments
Open

Example does not validate correctly #453

allComputableThings opened this issue Nov 20, 2024 · 3 comments

Comments

@allComputableThings
Copy link

allComputableThings commented Nov 20, 2024

With the example:

https://pub.dev/packages/intl_phone_number_input/example

and the only change:

  String initialCountry = 'US';
  PhoneNumber number = PhoneNumber(isoCode: 'US');

... the widget doesn't appear to correctly validate any numbers:

Screenshot from 2024-11-19 19-36-00

Screenshot from 2024-11-19 19-36-18

intl_phone_number_input: ^0.7.4

@GamxXamg
Copy link

Are you using flutter web ?

Same here, all numbers are returned invalid.
Getting this from webconsole :

+33XXXXXXXXX
libphonenumber_plugin.dart:13 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'AsYouTypeFormatter')

Probably something wrong with that in my case

@allComputableThings
Copy link
Author

allComputableThings commented Nov 21, 2024

Linux.
I just tried on web, but it also produces the following follow (which Linux does not).

TypeError: Cannot read properties of undefined (reading 'AsYouTypeFormatter')
packages/libphonenumber_web/src/libphonenumber_plugin.dart 13:9                         formatAsYouType
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                      runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5                      _async
packages/libphonenumber_web/src/libphonenumber_plugin.dart 11:34                        formatAsYouType
packages/libphonenumber_plugin/src/phone_number_util.dart 53:28                         formatAsYouType

Odd if there's separate implementation for web.

@GamxXamg
Copy link

GamxXamg commented Nov 21, 2024

We're facing same issue. v 0.8.0 works like a charm, try it. but it is only available on GitHub not pub.dev

intl_phone_number_input:
git:
url: https://github.com/natintosh/intl_phone_number_input.git
ref: v0.8.0

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