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

fix: use proper format for congo phone numbers #127

Merged
merged 2 commits into from
May 26, 2023

Conversation

jeffscaturro-aka
Copy link
Contributor

@jeffscaturro-aka jeffscaturro-aka commented May 19, 2023

Description

What an awesome package you've put together! I started using this in a project, and came across an incorrect formatting for phone numbers in the Republic of Congo.

Motivation and Context

In order to provide the correct format for a phone input for the Republic of Congo, I had to update the mask in lib/formatters/phone_input_formatter.dart. The proper mask should be +000 00 00 00000. Reference

Changes Made

Updated the mask to use the proper format.

How to Test

You can use the international code +242 to start formatting a Congo number.

Checklist

  • I have followed the project's coding style guidelines.
  • I have performed a self-review of my code.
  • I have written unit tests or provided a rationale for why tests are not necessary.
  • I have updated the project documentation if necessary.
  • I have added necessary comments and documentation within the code.
  • I have tested my changes locally and they work as expected.

Additional Notes

You currently have two failing tests around the formatting of numbers in the Philippines. I didn't want to touch those in this PR though due to separation of concerns, but wanted to mention it.

@jeffscaturro-aka
Copy link
Contributor Author

Let me know if you need anything else changed, like the version or something.

Thank you again, @caseyryan!

@jeffscaturro-aka
Copy link
Contributor Author

Also, for what it's worth, I understand we can use replacePhoneMask but it'd also be nice to get this corrected so we don't have to replace it and DRY up some code. :)

@caseyryan
Copy link
Owner

caseyryan commented May 26, 2023

Hi! Impressive work :) Just changing the mask would be enough but you've made a test for it and and the great description. Thank you! I'll merge it as soon as possible

Also, for what it's worth, I understand we can use replacePhoneMask but it'd also be nice to get this corrected so we don't have to replace it and DRY up some code. :)

There is PhoneInputFormatter.addAlternativePhoneMasks() with "mergeWithExisting" parameter. Doesn't it do?

@caseyryan caseyryan merged commit 51bf0f2 into caseyryan:master May 26, 2023
caseyryan added a commit that referenced this pull request May 26, 2023
@caseyryan
Copy link
Owner

Your fix is now in 2.11.1

@jeffscaturro-aka jeffscaturro-aka deleted the fix/congo-formatter-mask branch May 26, 2023 14:12
@jeffscaturro-aka
Copy link
Contributor Author

Thank you so much for the quick turn around @caseyryan, I appreciate it, and happy to have helped. What you've done with this plugin all together is extremely appreciated. Be well!

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.

2 participants