GitHunt
HK

hkk97/country_selector

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

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"

Languages

Dart58.5%C++19.6%CMake17.5%HTML1.9%C1.3%Swift1.1%Kotlin0.1%Objective-C0.0%

Contributors

MIT License
Created November 10, 2022
Updated August 19, 2024
hkk97/country_selector | GitHunt