world_csc_picker 0.0.4 copy "world_csc_picker: ^0.0.4" to clipboard
world_csc_picker: ^0.0.4 copied to clipboard

A Flutter widget for cascading country, state/province, and city selection with up‑to‑date data.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:world_csc_picker/country_state_city_picker.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final data = CountryStateCityData();
  await data.load();
  runApp(MyApp(data: data));
}

class MyApp extends StatelessWidget {
  final CountryStateCityData data;
  const MyApp({Key? key, required this.data}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('World_CSC_Picker Example')),
        body: Center(
          child: CountryStateCityPicker(
            data: data,
            onSelection: (country, state, city) {
              ScaffoldMessenger.of(context).showSnackBar(
                SnackBar(
                  content: Text('Chose ${city.name}, $state in $country'),
                ),
              );
            },
          ),
        ),
      ),
    );
  }
}
5
likes
140
points
48
downloads

Publisher

verified publisherarpitjai.com

Weekly Downloads

A Flutter widget for cascading country, state/province, and city selection with up‑to‑date data.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on world_csc_picker