flutter_libphonenumber icon indicating copy to clipboard operation
flutter_libphonenumber copied to clipboard

removeCountryCodeFromMask results in incorrect phone mask for national numbers

Open woelmer opened this issue 3 years ago • 2 comments

Calling this text formatter:

LibPhonenumberTextFormatter( country: usCountry, PhoneNumberFormat.national)

Will result in the following mask "0) 000-0000" It should be "(000) 000-0000"

There are a couple problems:

  1. input_formatter.dart line 28: removeCountryCodeFromMask gets set to true even though the phone number is a national number and the inputContainsCountryCode is false.

  2. Once removeCountryCodeFromMask is true country_data.dart line 188 will remove three characters from the beginning of the national mask therefore chopping off the area code portion of the national phone number mask.

woelmer avatar Sep 21 '21 14:09 woelmer