A Dart package for working with international phone numbers based on Google's libphonenumber implementation. It parses, formats, and validates numbers without relying on native dependencies.
✨ Features
✅ Parse, format, and validate phone numbers [parse(), format(), isValidNumber()]
➝ Convert raw phone numbers into structured objects, apply different formats, and check validity.
✅ Identify phone number types [getNumberType()]
➝ Distinguishes between Fixed-line, Mobile, Toll-free, Premium Rate, VoIP, etc.
✅ Match and compare phone numbers [isNumberMatch()]
➝ Determines whether two numbers are the same or similar.
✅ Generate example phone numbers [getExampleNumber()]
➝ Provides valid phone number examples for various countries/regions.
✅ Perform quick validation [isPossibleNumber()]
➝ Checks if a number has a valid length without requiring region-specific details.
✅ Validate phone numbers for a specific region [isValidNumberForRegion()]
➝ Ensures a phone number is valid in the given country based on length and prefix rules.
✅ Format phone numbers as-you-type [getAsYouTypeFormatter()]
➝ Dynamically formats phone numbers as users enter each digit.
✅ Extract phone numbers from text [findNumbers()]
➝ Detects phone numbers within a block of text (e.g., 'Call me on 0241234567').
✅ Geocode phone numbers [getDescriptionForNumber()]
➝ Retrieves geographical information related to a phone number (e.g., 'Zurich' for a Swiss number).
✅ Retrieve carrier information [getNameForNumber()]
➝ Identifies the telecom provider associated with a number (e.g., 'AT&T', 'Vodafone').
✅ Find associated timezones [getTimeZonesForNumber()]
➝ Returns timezone(s) linked to a phone number (e.g., 'America/New_York').
🚀 Quick Start
📌 Installation
Add dlibphonenumber to your pubspec.yaml:
dependencies:dlibphonenumber:^1.1.35#replace with the current version number.