the_country_number 0.9.2+1 copy "the_country_number: ^0.9.2+1" to clipboard
the_country_number: ^0.9.2+1 copied to clipboard

outdated

A small library for flutter written in pure dart (doesn't use libphonenumber) which parses a phone number or iso2 code of a country to give you some vitals about the country (if you need to skip null- [...]

example/example.dart

import 'package:the_country_number/the_country_number.dart';

void main(){
  //String to parse (internationalNumber)
  final s = "+915656565656";
  //
  //String to parse (dialCode)
  final b = "+91";
  //
  //get details about s
  final sNumber = TheCountryNumber().parseNumber(internationalNumber: s);
  print(sNumber?.isValidLength); //prints true
  print(sNumber?.country.englishName);//prints india
  print(sNumber?.hasNumber);//prints true
  //
  //get details about s
  final bNumber = TheCountryNumber().parseNumber(dialCode: b);
  print(bNumber?.isValidLength); //prints false
  print(bNumber?.country.englishName);//prints india
  print(bNumber?.hasNumber);//prints false
}
5
likes
0
points
6
downloads

Publisher

verified publisheryadunandan.xyz

Weekly Downloads

A small library for flutter written in pure dart (doesn't use libphonenumber) which parses a phone number or iso2 code of a country to give you some vitals about the country (if you need to skip null-safety, use version 0.9.0)

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on the_country_number