all_country_picker 0.0.1
all_country_picker: ^0.0.1 copied to clipboard
A country picker plugin with textfield, and it will format as you type.
example/lib/main.dart
import 'package:all_country_picker/all_country_picker.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final TextEditingController phoneNumberController = TextEditingController();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(15),
child: CountryField(
phoneNumberController: phoneNumberController,
// countryList: const ['us', 'ae'],
onDropdownChanged: (value) {
// print(value!.isoCode);
},
),
),
),
),
);
}
}