vanshg395 / intl_phone_field

A customised Flutter TextFormField to input international phone number along with country code.
https://pub.dev/packages/intl_phone_field
MIT License
177 stars 507 forks source link

Is it support mask like (000) 000 0000 #226

Closed ziagit closed 1 year ago

ziagit commented 2 years ago

I need to mask the phone while typing, for example for Canada this Mask should be applied (000) 000 0000. I use like

  IntlPhoneField(
                    initialValue: _phoneController.text,
                    style: TextStyle(fontSize: 12),
                    decoration: InputDecoration(
                      isDense: true,
                      labelText: 'Phone number',
                      border: OutlineInputBorder(
                        borderSide: BorderSide(),
                      ),
                    ),
                    initialCountryCode: 'CA',
                    onChanged: (phone) {
                      print(phone.completeNumber);
                    },
                  ),
ozcantolgahan commented 2 years ago

You can use flutter_masked_text2 package. Define a controller to IntlPhoneField widget like; MaskedTextController controller = MaskedTextController( mask: '000 000 00 00', )

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 5 days. If you believe this issue is still relevant, please comment to keep it open. Thank you for your contributions.