Add brazilian phone format
Closed this issue · 2 comments
josejeria commented
Hi,
Can you please fix Brazilian phone mask?
+55 (XX) XXXX-XXXX //for 10 digits.
+55 (XX) XXXXX-XXXX //for 11 digits.
Thanks!
caseyryan commented
Sure, I'll add it
caseyryan commented
Added in version 1.3.3.
You can also now add your custom masks to any country datas like this:
PhoneInputFormatter.replacePhoneMask(
countryCode: 'RU',
newMask: '+0 (000) 000 00 00',
);
PhoneInputFormatter.addAlternativePhoneMasks(
countryCode: 'BR',
alternativeMasks: [
'+00 (00) 0000-0000',
'+(00) 00000',
'+00 (00) 00-0000',
],
);
/// There is also a possibility to enter endless phones
/// by setting allowEndlessPhone to true
/// this means that you can enter a phone number of any length
/// its part that matches a mask will be formatted
/// and the rest will be entered unformatted
/// is will allow you to support any phones (even those that are not supported by the formatter yet)
PhoneInputFormatter(
onCountrySelected: _onCountrySelected,
allowEndlessPhone: true,
)