fix: preserve Brazilian area code 83 (Paraíba state) - Issue #179 #180
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Description
Fixes #179 - The
PhoneInputFormatterwas incorrectly converting Brazilian area code 83 (Paraíba state) to 73 (Bahia state) due to a conflict in the Russian phone number correction logic.Root Cause
The Russian phone correction logic was designed to handle both
89and83patterns, but the83pattern conflicts with a valid Brazilian area code:Solution
Refined the Russian correction to focus on the
89pattern, which is the most common case, while avoiding the conflict with Brazilian numbers:Why This Solution Works
(83) 98765-432189patterns still convert to+7 (9xx) xxx-xx-xxTest Results
83987654321→(83) 98765-432189123456789→+7 (912) 345-67-89Files Changed
lib/formatters/phone_input_formatter.dart- Refined Russian correction logictest/flutter_multi_formatter_test.dart- Added Brazilian area code 83 testsImpact
This fix resolves the formatting issue for Brazilian users in Paraíba state while maintaining compatibility with Russian phone number corrections.