You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.
In ios this code works perfectly fine. it returns true/false based on the input and further i am able to get region code using PhoneNumberUtil().parse(emailController.text);.
This same functionality does not works in Android.
Expected Behavior
Functionality should be same as the ios one. User should be able to validate if the number is valid without region code.
Steps To Reproduce
Test the below code snippet in an Android device
bool validNumber = await PhoneNumberUtil().validate(emailController.text);
final number = await PhoneNumberUtil().parse(emailController.text);
Aditional information
Example code snippet
bool validNumber = false;
try {
validNumber = await PhoneNumberUtil().validate(emailController.text);
} catch (e) {
debugPrint("Invalid Number");
}
if (validNumber) {
final number = await PhoneNumberUtil().parse(emailController.text);
emailController.text = "+${number.countryCode}${number.nationalNumber}";
}
```
The text was updated successfully, but these errors were encountered:
simranjeet09
changed the title
PhoneNumberUtil().validate(NUMBER_WITHOUT_REGION); does not get validated or parsed in android
Unable to validate number without region in Android. iOS works fine
Oct 6, 2023
Is there an existing issue for this?
Package/Plugin version
2.0.1
Platforms
Flutter doctor
Flutter doctor
Minimal code example
Code sample
Current Behavior
In ios this code works perfectly fine. it returns true/false based on the input and further i am able to get region code using
PhoneNumberUtil().parse(emailController.text);
.This same functionality does not works in Android.
Expected Behavior
Functionality should be same as the ios one. User should be able to validate if the number is valid without region code.
Steps To Reproduce
Test the below code snippet in an Android device
Aditional information
Example code snippet
The text was updated successfully, but these errors were encountered: