Skip to content

rexthecoder/international_phone_field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

international_phone_field🌎

Validating numbers and providing necessary detail base on selected country😃. The pacakge comes with enough detail about the country which is super useful and save you from api issues🐻

Simple project screenshot

Usage

import 'package:international_phone_field/international_phone_field.dart';
String phoneNumber;
String phoneIsoCode;

  void onPhoneNumberChange(
      String number,
      String internationalizedPhoneNumber,
      String isoCode,
      String dialCode,
      String countryCapital,
      String countryContinent,
      String countryCurrency,
      String countryName) {
    setState(() {
      phoneNumber = number;
      phoneIsoCode = isoCode;
    });
  }
@override
 Widget build(BuildContext context) => Scaffold(
     body: Center(
       child: Padding(
              padding: const EdgeInsets.only(left: 8.0, right: 8.0),
              child: InterField(
                onPhoneNumberChange: onPhoneNumberChange,
                initialPhoneNumber: phoneNumber,
                initialSelection: phoneIsoCode,
                enabledCountries: ['+233', '+234'],
                labelText: "Enter your phone Number",
                addCountryComponentInsideField: true,
                border: OutlineInputBorder(
                  gapPadding: 20.0,
                  borderRadius: BorderRadius.circular(10),
                ),
              ),
            ),
          ),
       );

About

Validating numbers and providing necessary detail base on selected country

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages