Skip to content

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

License

Notifications You must be signed in to change notification settings

hkk97/country_selector

Repository files navigation

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 
    };

Dmonstraction of CountrySelectorWidget

"CountrySelectorWidget - SelectedLocale.zhCH"

Dmonstraction of showCountrySelectorBottomSheet

"showCountrySelectorBottomSheet - SelectedLocale.en"

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published