dlibphonenumber 1.1.0 copy "dlibphonenumber: ^1.1.0" to clipboard
dlibphonenumber: ^1.1.0 copied to clipboard

This is a Dart port of Google's libphonenumber library, Google's library for parsing, formatting, and validating international phone numbers.

example/example.dart

import 'package:dlibphonenumber/dlibphonenumber.dart';

void main() {
  final phoneUtil = PhoneNumberUtil.instance;
  final phoneNumber = phoneUtil.parse('0241234567', 'GH');
  final validPhoneNumber = phoneUtil.isValidNumber(phoneNumber);
  final e164 = phoneUtil.format(phoneNumber, PhoneNumberFormat.e164);
  final international = phoneUtil.format(phoneNumber, PhoneNumberFormat.international);
  final national = phoneUtil.format(phoneNumber, PhoneNumberFormat.national);
  final rfc3966 = phoneUtil.format(phoneNumber, PhoneNumberFormat.rfc3966);

  print('e164: $e164');
  print('international: $international');
  print('national: $national');
  print('rfc3966: $rfc3966');
  print('validPhoneNumber: $validPhoneNumber');
  print('phoneNumber: $phoneNumber');
}
30
likes
0
pub points
95%
popularity

Publisher

unverified uploader

This is a Dart port of Google's libphonenumber library, Google's library for parsing, formatting, and validating international phone numbers.

Repository (GitHub)
View/report issues

Topics

#phonenumber #parsing #formatting #validation

License

unknown (license)

Dependencies

fixnum, meta, protobuf

More

Packages that depend on dlibphonenumber