flutter_country_state 0.2.10 copy "flutter_country_state: ^0.2.10" to clipboard
flutter_country_state: ^0.2.10 copied to clipboard

A customizable Flutter package that displays all countries with it respective state.

flutter_country_state #

A customizable Flutter package for all platforms that displays all countries with there respective states.

Example #

Please run the app in the Example folder

Installation #

dependencies:
  flutter:
    sdk: flutter
  flutter_country_state:

You can also change the style of the text of list of the country and states #

-searchHint

-substringBackground

-subStringStyle

-style

-searchStyle

selectedCountryBackgroundColor

notSelectedCountryBackgroundColor

selectedStateBackgroundColor

notSelectedStateBackgroundColor

onSelectCountry

onSelectedState

countryHeaderStyle

stateHeaderStyle


Use It #

This will display the list of countries in the world #

showModalBottomSheet(
  isScrollControlled: true,
  context: context,
  isDismissible: false,
  builder: (context) =>  SizedBox(
    height: MediaQuery.of(context).size.height * 0.7,
    child: ShowMyDialog(
      searchHint: 'Search for a country',
      substringBackground: Colors.black,
      style: const TextStyle(color: Colors.black,fontWeight: FontWeight.w500),
      searchStyle: const TextStyle(color: Colors.black),
      subStringStyle: const TextStyle(color: Colors.white),
      selectedCountryBackgroundColor: Colors.pink,
      notSelectedCountryBackgroundColor: Colors.white,
      onSelectCountry: (){setState(() {
        selectedCountry = Variables.country;
      });},
    ),
  ),

);

This will display the states of the country selected #

showModalBottomSheet(
 isScrollControlled: true,
 context: context,
 isDismissible: false,
 builder: (context) => SizedBox(
   height: MediaQuery.of(context).size.height * 0.7,
   child: StateDialog(
     style: const TextStyle(color: Colors.black,fontWeight: FontWeight.w500),
     subStringStyle: const TextStyle(color: Colors.white),
     substringBackground: Colors.black,
     selectedStateBackgroundColor: Colors.orange,
     notSelectedStateBackgroundColor: Colors.white,
     onSelectedState: (){
       setState(() {
         selectedState = Variables.state;
       });
     },
   ),
 ),

);

Next goal #

  • [ x ] Add countries flag
  • [ x ] Add countries code
  • [ x ] Add cities of each state
16
likes
110
pub points
77%
popularity

Publisher

verified publishermiriamly.co

A customizable Flutter package that displays all countries with it respective state.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_country_state