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

Add support for VOIP numbers #59

Merged
merged 4 commits into from
Feb 22, 2024
Merged

Add support for VOIP numbers #59

merged 4 commits into from
Feb 22, 2024

Conversation

letsar
Copy link
Contributor

@letsar letsar commented Feb 20, 2024

This PR adds support for VOIP phone numbers.
Should fix #48

@cedvdb
Copy link
Owner

cedvdb commented Feb 20, 2024

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:

  • bump the version to 8.1.4 in pubspec
  • add an entry in the changelog

@letsar
Copy link
Contributor Author

letsar commented Feb 21, 2024

Ok, I'll revert my changes for the metadata and keep here only the support for the voip feature.
Since we add a new feature wouldn't it be better to bump to the next minor version: 8.2.0?

@@ -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;
Copy link
Owner

@cedvdb cedvdb Feb 21, 2024

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

Copy link
Contributor Author

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.

@cedvdb cedvdb merged commit e1bd3f2 into cedvdb:dev Feb 22, 2024
@cedvdb cedvdb mentioned this pull request May 28, 2024
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

Successfully merging this pull request may close these issues.

[Feature request] support VOIP
2 participants