country_code_list 1.0.0 copy "country_code_list: ^1.0.0" to clipboard
country_code_list: ^1.0.0 copied to clipboard

A new Flutter plugin.

example/lib/main.dart

import 'dart:async';

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initData();
  }

  initData() async {
    var listOfCountryCode = await getCountryCodeList();
    listOfCountryCode.forEach((countryCode) {
      var countryCodes = countryCode.countryCode; //ex. US
      var countryName = countryCode.countryName; // ex. United States
      var diallingCode = countryCode.diallingCode; // ex. +1
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Container(),
    );
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter plugin.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on country_code_list