Search packages, repositories and app categories

extended_phone_number_input cover
Package detailsv1.0.2

extended_phone_number_input

Phone input Flutter widget that supports country code, validation and contact picker

AndroidiOS
30-day downloads
247
Likes
36
Pub points
130

Install package

flutter pub add extended_phone_number_input

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter widget for handling phone number input with built-in support for country code selection, real-time validation, and integration with the device's contact picker. It simplifies international phone number entry by automatically applying formatting and validating input based on the selected country. The package is designed to enhance user experience in forms requiring phone numbers across different regions.

Use cases

  • International phone number collection
  • Form validation with country-specific rules
  • Contact picker integration
  • Dynamic country code selection
  • User-friendly phone input UI
  • Mobile app registration flows

Key features

  • Country code auto-detection
  • Real-time input validation
  • Contact picker integration
  • Customizable styling
  • Supports multiple locales
  • Automatic formatting

Suitable for

  • Global applications
  • User registration forms
  • Customer service apps
  • Apps requiring international phone input
  • Developers needing robust phone input handling

Considerations

  • Requires internet for full country data
  • May need additional permissions for contact access
  • Limited customization of country list
  • Depends on external dependency for formatting logic
  • Not optimized for very large datasets
  • Initial setup may require configuration

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

Features

  • Phone number with international validation
  • Include only specific countries
  • Exclude specific countries
  • Set a phone number using a controller (Selected country will be updated automatically)
  • Pick a phone number from contacts list

Getting started

Install the package extended_phone_number_input:

flutter pub add extended_phone_number_input

If you target Android 11+ (API 30+) and want to use the build-in contact picker you need to add the android.permission.READ_CONTACTS permission on the AndroidManifest.xml as this permission will be requested automatically.

Usage

A full and rich example can be found in /example folder.

Simple usage
 PhoneNumberInput(initialCountry: 'SA', locale: 'ar')
Show countries as dialog (default is bottom sheet)
 const PhoneNumberInput(
    initialCountry: 'US',
    locale: 'en',
    countryListMode: CountryListMode.dialog,
    contactsPickerPosition: ContactsPickerPosition.suffix,
    )
Custom borders
 PhoneNumberInput(
    initialCountry: 'TN',
    locale: 'fr',
    countryListMode: CountryListMode.dialog,
    contactsPickerPosition: ContactsPickerPosition.suffix,
    enabledBorder: OutlineInputBorder(
    borderRadius: BorderRadius.circular(10),
    borderSide: const BorderSide(color: Colors.purple)),
    focusedBorder: OutlineInputBorder(
        borderRadius: BorderRadius.circular(10),
        borderSide: const BorderSide(color: Colors.purple))
    )
Select Phone number programmatically

To be able to select a phone number programmatically, we first need to define a PhoneInputController :

PhoneInputController _controller = PhoneInputController(context);
 PhoneNumberInput(
     controller: _controller
    ...

Select the desired phone number:

_controller.phoneNumber = '+1-....'
Note:

If you want to set the phone number from contact, The widget already support this feature without the need to use the controller.

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.