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

initialCountryCode does not accept country dial codes (e.g., '+91') #412

Open
Smeet74 opened this issue Nov 27, 2024 · 2 comments
Open

initialCountryCode does not accept country dial codes (e.g., '+91') #412

Smeet74 opened this issue Nov 27, 2024 · 2 comments

Comments

@Smeet74
Copy link

Smeet74 commented Nov 27, 2024

The initialCountryCode property of the intl_phone_field package is documented to accept both 2-letter ISO country codes (e.g., 'IN') and country dial codes (e.g., '+91'). However, when a country dial code is provided, the field does not initialize correctly and instead defaults to an incorrect or unspecified value.

Code Snippet for Reference:

IntlPhoneField(
initialCountryCode: '+91',
decoration: InputDecoration(
labelText: 'Phone Number',
),
onChanged: (phone) {
print('Phone number changed: ${phone.completeNumber}');
},
);

@MikevanBreePXL
Copy link

Same happening here, it seems only ISO codes are accepted.

Perhaps this has something to do with intl_phone_field.dart line 319

@MdAshrafUllah
Copy link

@Smeet74 @MikevanBreePXL Use this package intl_mobile_field

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

3 participants