dialcodeselector 1.0.9 copy "dialcodeselector: ^1.0.9" to clipboard
dialcodeselector: ^1.0.9 copied to clipboard

Flutter package for selecting a country or country dial code.

dialcodeselector Package #

Package designed to select either country or country dial code

pubspec.yaml #

dialcodeselector: <last version>

import #

import 'package:dialcodeselector/dialcodeselector.dart';

Simple example #

//Define your default country
Country? defaultCountry = DialCodeSelector.getCountryByDialCode(dialCode: "233");

//implement callback
  void onCountrySelected(Country? country) {
    defaultCountry = country;
    setState(() {});
  }

// Define theme for the country code picker
  DialCodeSelectorTheme get selectorTheme =>
      DialCodeSelectorTheme(titleColor: Colors.blueGrey);

void showCountryPicker()async{
 await DialCodeSelector.selectCountry(BuildContext,
                            selectorTheme: selectorTheme,
                            initialShortName: defaultCountry?.countryShortName,
                            onCountrySelected: onCountrySelected);
}

Features #

  • Selecting a country dial code
  • Selecting a country
  • Returns selected Country name, logo, shortname and dial code
  • Get country by shortname
  • Get country by dialcode
2
likes
140
pub points
32%
popularity

Publisher

unverified uploader

Flutter package for selecting a country or country dial code.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on dialcodeselector