country_state_city_dropdown 0.0.1 copy "country_state_city_dropdown: ^0.0.1" to clipboard
country_state_city_dropdown: ^0.0.1 copied to clipboard

A Flutter package for country, state, and city dropdown selection.

🌍 Country State City Dropdown #

A Flutter package to provide cascading dropdowns for Country, State, and City selections using your own JSON data. This widget is theme-adaptive and works well with light and dark themes.

✨ Features #

  • 🌐 Country, State, City dropdowns
  • πŸ”„ Dynamic population based on selection
  • 🎨 Theme adaptive
  • πŸ“¦ Easily integratable in forms

πŸš€ Getting Started #

Add the dependency in your pubspec.yaml file:

dependencies:
  country_state_city_dropdown: ^0.0.1

Then run:

flutter pub get

πŸ“¦ Usage #

Here’s a basic example of how to use the package:

import 'package:flutter/material.dart';
import 'package:country_state_city_dropdown/country_state_city_dropdown.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Country State City Picker')),
        body: Padding(
          padding: const EdgeInsets.all(16.0),
          child: CountryStateCityPicker(
            onCountryChanged: (country) => print("Country: ${country.name}"),
            onStateChanged: (state) => print("State: ${state.name}"),
            onCityChanged: (city) => print("City: ${city.name}"),
            spacing: 30,
          ),
        ),
      ),
    );
  }
}

This will show 3 dropdowns that dynamically update based on previous selections.

πŸ“ Example #

Check the /example folder for a complete working demo.

πŸ“„ License #

MIT License


Made with ❀️ in Flutter

1
likes
0
points
230
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for country, state, and city dropdown selection.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dropdown_search, flutter

More

Packages that depend on country_state_city_dropdown