PhoneNumber class

PhoneNumber contains detailed information about a phone number


PhoneNumber({String? phoneNumber, String? dialCode, String? isoCode})


dialCode String?
The Country dialCode of the phone number
hash int
Returns an integer generated after the object was initialised. Used to compare different instances of PhoneNumber
no setter
hashCode int
The hash code for this object.
no setterinherited
isoCode String?
Country isoCode of the phone number
phoneNumber String?
Either formatted or unformatted String of the phone number
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
parseNumber() String
Returns a String of phoneNumber without dialCode
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.

Static Methods

getISO2CodeByPrefix(String prefix) String?
For predefined phone number returns Country's isoCode from the dial code, Returns null if not found.
getParsableNumber(PhoneNumber phoneNumber) Future<String>
Accepts a PhoneNumber object and returns a formatted phone number String
getPhoneNumberType(String phoneNumber, String isoCode) Future<PhoneNumberType>
Returns PhoneNumberType which is the type of phone number Accepts phoneNumber and isoCode and r
getRegionInfoFromPhoneNumber(String phoneNumber, [String isoCode = '']) Future<PhoneNumber>
Returns PhoneNumber which contains region information about the phoneNumber and isoCode passed.