Country Code Picker in Flutter

You are currently viewing Country Code Picker in Flutter
Country Code TextFormField

A Customised Flutter TextFormField to Input International Phone Number along with Country Code Picker in Flutter

A customised Flutter TextFormField to input international phone number along with country code.
This country code picker in flutter widget can be used to make a customized text field to take phone number input for any country along with an option to choose country code from a dropdown.

See also  Flutter TextField Widget for Currency Input

Screenshots

Country Code TextFormField
Country Code TextFormField

Installing

To use this package:

Run this command:

flutter pub add intl_phone_field

Or, add the following to your pubspec.yaml file:

dependencies:
  intl_phone_field: ^2.1.0

How to Use

Simply create a IntlPhoneField widget, and pass the required params:z

IntlPhoneField(
    decoration: InputDecoration(
        labelText: 'Phone Number',
        border: OutlineInputBorder(
            borderSide: BorderSide(),
        ),
    ),
    initialCountryCode: 'IN',
    onChanged: (phone) {
        print(phone.completeNumber);
    },
)

Use initialCountryCode to set an initial Country Code.

See also  A Focusable and Blurable TextField Widget in Flutter

Read Also Pincode Input TextFields

Credit

This project is developed by vanshg395
Download this project from the below link.
https://github.com/vanshg395/intl_phone_field/archive/refs/heads/master.zip
You can visit original source page from the below link:
https://github.com/vanshg395/intl_phone_field

Spread the love

Leave a Reply