phonecodes 0.0.3 phonecodes: ^0.0.3 copied to clipboard
This package provides a list of Countries with their name, ISO code, Dial code, Flag and Currency
example/phonecodes_example.dart
import 'package:phonecodes/phonecodes.dart';
void main() {
Country india = Countries.findByCode('IN');
print(india.name); // India
List<Country> countries = Countries.findByDialCode('+1');
for (Country country in countries) {
print('${country.name} ${country.flag}');
// Canada π¨π¦
// United States πΊπΈ
}
Country unitedKingdom = Countries.findByName('United Kingdom');
print(unitedKingdom.code); // GB
try {
Countries.findByCode('XX');
} on CountryNotFoundException catch (e) {
print(e); // CountryNotFoundException: Country with code XX not found
}
}