country_selector_widget 0.0.1 country_selector_widget: ^0.0.1 copied to clipboard
This Country Selector UI Library written by Dart and Fluter and supports three locales with country's name, achieves lazy loading, and country card animation on listview. This UI Library provides Coun [...]
Country Selector Widget #
This Country Selector Widget UI Library written by Dart and Fluter and supports three locales with country's name, achieves lazy loading, and country card animation on listview. This UI Library provides CountrySelectorWidget and showCountrySelectorBottomSheet to fulfill the needed usage.
Android | iOS | Linux | macOS | Web | Windows | |
---|---|---|---|---|---|---|
Support | Any | Any | Any | Any | Any | Any |
Usage #
To use this plugin, add country_selector_widget
as a [dependency in your pubspec.yaml file].
Examples #
Here are the examples that show you how to use the CountrySelectorWidget and showCountrySelectorBottomSheet.
Usage of CountrySelectorWidget
- the default locale is SelectedLocale.en, you would change to SelectedLocale.zhCH or SelectedLocale.zhHK
- once the country is selected and clicked the continue btn it will trigger the valueChangedCallback called onSelectedCountry and return the Country
CountrySelectorWidget(
onSelectedCountry: (Country country) async {
// selected country callback
},
),
Usage of showCountrySelectorBottomSheet
- the different between CountrySelectorWidget and showCountrySelectorBottomSheet are showCountrySelectorBottomSheet is wrap with the showModalBottomSheet
- showCountrySelectorBottomSheet will also do the Navigator.pop(context) for you once the continue button are clicked
showCountrySelectorBottomSheet(
context: context,
onSelectedCountry: (Country country) async {
// selected country callback
};