country_state_selector 0.0.4
country_state_selector: ^0.0.4 copied to clipboard
A Flutter package for selecting country and state with a smooth dropdown and search functionality.
Country State Selector #
A simple and customizable Flutter package that allows users to select a country and state from a dropdown list. This package provides a smooth UI with search functionality and disables state selection until a country is chosen.
Features #
- Select a country and then state using a dropdown.
- State dropdown remains disabled until a country is selected.
- Built-in search functionality for easy filtering.
- Fully customizable UI.
- Lightweight and easy to integrate.
Getting started #
To use this package, add it as a dependency in your pubspec.yaml:
dependencies: country_state_selector: latest_version
Then run flutter pub get
Screenshots #
![]() |
![]() |
|---|---|
| Country & State Picker | Country Picker Search Dialog |
![]() |
![]() |
|---|---|
| Country Picker | State Picker |
Usage #
Import the package to use in your Flutter project import 'package:country_state_selector/country_state_selector.dart';
Example #
import 'package:flutter/material.dart';
import 'package:country_state_selector/country_state_selector.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: const Text('Country State Picker')),
body: Center(
child: CountryStatePicker(
onSelected: (country, state) {
print("Selected Country: $country, State: $state");
},
),
),
),
);
}
}
Additional information #
Contributions are welcome. If you find any issues or have feature requests, Connect with me at [email protected].



