CountryWithPhoneCode class

Constructors

CountryWithPhoneCode({required String phoneCode, required String countryCode, required String exampleNumberMobileNational, required String exampleNumberFixedLineNational, required String phoneMaskMobileNational, required String phoneMaskFixedLineNational, required String exampleNumberMobileInternational, required String exampleNumberFixedLineInternational, required String phoneMaskMobileInternational, required String phoneMaskFixedLineInternational, required String? countryName})
CountryWithPhoneCode.gb()
GB locale, useful for dummy values
const
CountryWithPhoneCode.us()
US locale, useful for dummy values
const

Properties

countryCode String
Country locale code.
final
countryName String?
Country name
final
exampleNumberFixedLineInternational String
Example fixed line number in international format.
final
exampleNumberFixedLineNational String
Example fixed line number in national format.
final
exampleNumberMobileInternational String
Example mobile number in international format.
final
exampleNumberMobileNational String
Example mobile number in national format.
final
hashCode int
The hash code for this object.
no setterinherited
phoneCode String
Country phone code.
final
phoneMaskFixedLineInternational String
Phone mask for fixed line number in international format.
final
phoneMaskFixedLineNational String
Phone mask for fixed line number in national format.
final
phoneMaskMobileInternational String
Phone mask for mobile number in international format.
final
phoneMaskMobileNational String
Phone mask for mobile number in national format.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getPhoneMask({required PhoneNumberFormat format, required PhoneNumberType type, bool removeCountryCodeFromMask = false}) String
Get the phone mask based on number type and format. When removeCountryCodeFromMask is true then the resulting mask will not contain the phone code. This is useful for real-time formatting with LibPhonenumberTextFormatter where the user might be entering a phone number without the country code in it but we still want to format it accordingly.
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.
inherited

Static Methods

getCountryDataByPhone(String phone, {int? subscringLength}) CountryWithPhoneCode?
Try to guess country from phone