-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add support for VOIP numbers #59
Conversation
Great ! Could you make two separate PR for the metadata upgrade and the voip feature ? Stuff like leading digits changes seem to come with the PR and are probably just metadata upgrades that don't necessarily require much scrutiny. It would be easier for review Also please:
|
Ok, I'll revert my changes for the metadata and keep here only the support for the voip feature. |
lib/src/utils/utils.dart
Outdated
@@ -15,6 +15,11 @@ class MinMaxUtils { | |||
if (data.isNotEmpty) { | |||
return MinMaxLength(data.first, data.last); | |||
} | |||
} else if (phoneNumberType == PhoneNumberType.voip) { | |||
final data = metadataLenghtsByIsoCode[isoCode]!.voip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like I missed that in a previous review and the code above is using !
. This metadataLenghtsByIsoCode[isoCode]
will always be found but can you move it to the top of the function and not use !
in all 3 cases. Just throw a meaningful error message if it's null, which again I don't think is possible right now unless the metadata generation has an underlying bug.
When this is fixed it LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've done it. Let me know if it's good for you.
This PR adds support for VOIP phone numbers.
Should fix #48