country_data_picker 0.0.5 copy "country_data_picker: ^0.0.5" to clipboard
country_data_picker: ^0.0.5 copied to clipboard

A Flutter package that provides for country selection with built-in SVG flags, dial codes, and ISO codes.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:country_data_picker/country_data_picker.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Country List Example',
      home: CountryListScreen(),
    );
  }
}

class CountryListScreen extends StatelessWidget {
  const CountryListScreen({super.key});
  final countries = Countries.all;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Country List Example'),
      ),
      body: ListView.builder(
        itemCount: countries.length,
        itemBuilder: (context, index) {
          final country = countries[index];
          return ListTile(
            leading: ClipOval(child: country.flag),
            title: Text(country.name),
            subtitle: Text('Dial Code: ${country.dialCode}'),
          );
        },
      ),
    );
  }
}
0
likes
150
points
63
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package that provides for country selection with built-in SVG flags, dial codes, and ISO codes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_svg

More

Packages that depend on country_data_picker