PhoneValue class

Immutable result object representing a parsed and validated phone number.

Constructors

PhoneValue({required Country country, required String nationalNumber, required String internationalNumber, required String e164, required bool isValid})
const
PhoneValue.empty(Country country)
Empty/initial state with a given country.
factory
PhoneValue.fromParts({required Country country, required String nationalNumber, required bool isValid})
Creates a PhoneValue from a country and raw national number string.
factory

Properties

country Country
The resolved country for this phone number.
final
e164 String
E.164 format: +{dialCode}{nationalNumber} (same as international but strictly formatted).
final
hashCode int
The hash code for this object.
no setteroverride
hasNumber bool
Returns true if the national number is non-empty.
no setter
internationalNumber String
International format: +{dialCode}{nationalNumber}
final
isValid bool
Whether this phone number passes validation for the resolved country.
final
nationalNumber String
The national portion of the number (without dial code).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({Country? country, String? nationalNumber, String? internationalNumber, String? e164, bool? isValid}) PhoneValue
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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