countries_list 0.1.3 copy "countries_list: ^0.1.3" to clipboard
countries_list: ^0.1.3 copied to clipboard

outdated

Just list of countries, and that's all (ISO-3166 Country and Dependent Territories Lists with UN Regional Codes). Contains phone codes, flags emoji, alpha1, alpha2 etc. You can use it for creating you [...]

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Countries list'),
        ),
        body: FutureBuilder<List<Country>>(
          future: getCountriesIso(),
          builder: (ctx, snapshot) {
            if (snapshot.connectionState == ConnectionState.waiting) {
              return Center(
                child: CircularProgressIndicator(),
              );
            } else {
              final countries = snapshot.data;
              return ListView.builder(
                itemBuilder: (ctx, index) {
                  Country country = countries[index];
                  return ListTile(
                    leading: Text(
                      country.flag,
                      style: TextStyle(fontSize: 32),
                    ),
                    title: Text(
                        '${country.latinName} (${country.countryIso.alpha2})'),
                    subtitle: country.phoneCode != null
                        ? Text('phone code: +${country.phoneCode}')
                        : Text('Phone code not found'),
                  );
                },
                itemCount: countries.length,
              );
            }
          },
        ),
      ),
    );
  }
}
0
likes
0
pub points
32%
popularity

Publisher

unverified uploader

Just list of countries, and that's all (ISO-3166 Country and Dependent Territories Lists with UN Regional Codes). Contains phone codes, flags emoji, alpha1, alpha2 etc. You can use it for creating your own country picker.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on countries_list