dialcodeselector 2.0.1 copy "dialcodeselector: ^2.0.1" to clipboard
dialcodeselector: ^2.0.1 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

Screens #

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
26%
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