caseyryan/flutter_multi_formatter

Add brazilian phone format

Closed this issue · 2 comments

Hi,

Can you please fix Brazilian phone mask?

+55 (XX) XXXX-XXXX //for 10 digits.
+55 (XX) XXXXX-XXXX //for 11 digits.

Thanks!

Sure, I'll add it

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,
)