0 purchases
dialcodeselector
dialcodeselector Package #
Package designed to select either country or country dial code
Screens #
pubspec.yaml #
dialcodeselector: <last version>
copied to clipboard
import #
import 'package:dialcodeselector/dialcodeselector.dart';
copied to clipboard
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);
}
copied to clipboard
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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.