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

outdated

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) {
              Map<String, String> country = Countries.list[position];
              return ListTile(
                leading: Text(country['dialCode'] ?? ''),
                title: Text(country['name'] ?? ''),
                subtitle: Text(country['isoCode'] ?? ''),
              );
            },
          ),
        )));
  }
}
6
likes
0
pub points
84%
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

License

unknown (LICENSE)

More

Packages that depend on country_list