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

outdated

Library to provide list of country data like, Country Name (`name`), Phone Sial Code (`dial`), Country Apha-2 Code (`alpha2`).

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['dial'] ?? ''),
                title: Text(country['name'] ?? ''),
                subtitle: Text(country['alpha2'] ?? ''),
              );
            },
          ),
        )));
  }
}
7
likes
0
points
399
downloads

Publisher

verified publishercrawlink.com

Weekly Downloads

Library to provide list of country data like, Country Name (`name`), Phone Sial Code (`dial`), Country Apha-2 Code (`alpha2`).

Homepage

License

unknown (license)

More

Packages that depend on country_list