PhoneParser class abstract
Parses a phone number given caller or destination information.
The logic is:
- Remove the international prefix / exit code a. if caller is provided remove the international prefix / exit code b. if caller is not provided a best guess is done with a possible destination country
- Find destination country a. if no destination country was provided, we check if the caller national prefix is there in which case it's the destination is the same as the caller country. b. else a best guess is estimated by looking at the first digits to see if they match a country. Since multiple countries share the same country code, pattern matching might be used when there are multiple matches.
- Extract the country code with the country information
- Transform a local NSN to an international version
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
parse(
String phoneNumber, {IsoCode? callerCountry, IsoCode? destinationCountry}) → PhoneNumber