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

A dart library provides a list of country data like Country Name, Dial Code, ISO Code.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Country List Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({
    Key? key,
  }) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text("Country List Demo"),
        ),
        body: Center(
            child: Container(
          constraints: BoxConstraints(maxWidth: 480),
          child: ListView.builder(
            itemCount: Countries.list.length,
            itemBuilder: (_, position) {
              Country country = Countries.list[position];
              return ListTile(
                leading: Text(country.dialCode),
                title: Text(country.name),
                subtitle: Text(country.isoCode),
              );
            },
          ),
        )));
  }
}
6
likes
120
pub points
85%
popularity

Publisher

verified publishercrawlink.com

A dart library provides a list of country data like Country Name, Dial Code, ISO Code.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on country_list