cupertino_country_state_picker 1.1.2
cupertino_country_state_picker: ^1.1.2 copied to clipboard
A Flutter package providing a Cupertino-style country and state picker with smooth UI, flag support, and easy integration.
import 'package:cupertino_country_state_picker/views/cupertino_country_state_picker.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.all(16),
child: CupertinoCountryStatePicker(
onCountryChanged: (value) {},
onStateChanged: (value) {},
initialCountry: "Bangladesh",
initialState: "Rangpur",
pickedValueTextStyle: TextStyle(fontSize: 14),
borderRadius: 16,
labelTextStyle: TextStyle(fontSize: 13),
pickerAnimationDuration: Duration(seconds: 5),
pickerSearchIcon: Icon(Icons.search),
pickerAnimation: Curves.easeIn,
),
),
],
),
),
);
}
}