country_state_selector 0.0.2 copy "country_state_selector: ^0.0.2" to clipboard
country_state_selector: ^0.0.2 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 state from a dropdown.
  • Built-in search functionality for easy filtering.
  • State dropdown remains disabled until a country is selected.
  • 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 and state Picker Demo [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].

3
likes
0
points
20
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for selecting country and state with a smooth dropdown and search functionality.

Repository (GitLab)
View/report issues

License

unknown (license)

Dependencies

flutter, google_fonts, http

More

Packages that depend on country_state_selector