🌍 Country State City Dropdown

A Flutter package that provides dynamic, cascading dropdowns for selecting Country, State, and City using local JSON data. Built with full customizability and search functionality.

✨ Features

βœ… Cascading dropdowns (Country β†’ State β†’ City)
βœ… Built-in search with OverlayEntry
βœ… No external dependencies
βœ… Form-friendly and highly customizable
βœ… Dark mode/theme support
βœ… Easy integration

πŸš€ Getting Started

Add the dependency in your pubspec.yaml file:

dependencies:
  country_state_city_dropdown: ^0.1.2

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: 10,
          ),
        ),
      ),
    );
  }
}

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

πŸ“ Example

Check the /example folder for a complete working demo.

πŸ“„ License

This project is licensed under the MIT License.


Made with ❀️ by @ir-khan