Country & Currency picker
A flutter package to select a currency and country from a list with 250 countries.
Getting Started
Add the package to your pubspec.yaml:
currency_country_picker: ^1.2.3
In your dart file, import the library:
import 'package:currency_country_picker/currency_country_picker.dart';
Show country picker using showCountryPickerFullScreen:
showCountryPickerFullScreen(
context: context,
showFlag: true,
onSelect: (Country country) {
print('Select country: ${country.phoneCode}');
},
);
Parameters:
onSelect: Called when a country is select. The country picker passes the new value to the callback (required)showFlag: Shows flag for each country. Default valuetrue.countryFilter: Can be used to filter the Country list.favorites: Show the favorite countries at the top of the list.showCountryPickerFullScreen( context: context, onSelect: (Country country) { print('Select country: ${country.phoneCode}'); }, countryFilter: <String>['+93', '+358','+355'], );theme: Set aCountryPickerThemeDatato the country picker to customize it. (optional).showCountryPickerFullScreen( context: context, theme: CountryPickerThemeData( countryCodeTextStyle: const TextStyle( color: Color.fromARGB(255, 168, 36, 60), fontSize: 17, ), titleTextStyle: const TextStyle( fontSize: 18, color:Colors.white, ), flagSize: 25, backgroundColor: Colors.black, ), onSelect: (Country country) => print('Select country: ${country.phoneCode}'), );
Contributions
Contributions of any kind are more than welcome! Feel free to fork and improve currency_country_picker in any way you want, make a pull request, or open an issue.