PhoneParser class abstract

Parses a phone number given caller or destination information.

The logic is:

  1. Remove the international prefix / exit code a. if caller is provided remove the international prefix / exit code b. if caller is not provided be a best guess is done with a possible destination country
  2. Find destination country a. if no destination country was provided, the destination is assumed to be the same as the caller b. if no caller was provided 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.
  3. Extract the country code with the country information
  4. Transform a local NSN to an international version

Constructors

PhoneParser()

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