phone_number_controller

pub pub points popularity likes

This plugin provides a TextEditingController that formats international phone numbers as you type them.

Demo

demo

Usage

Two steps:

  1. In a stateful widget, define a PhoneNumberController:
final _controller = PhoneNumberController(countryCode: 'us');
  1. When building the text field, specify the controller:
TextFormField(
    controller: _controller,
    keyboardType: TextInputType.phone,
    ...
);