LibPhonenumberTextFormatter class

Inheritance

Constructors

LibPhonenumberTextFormatter({required CountryWithPhoneCode country, PhoneNumberType phoneNumberType = PhoneNumberType.mobile, PhoneNumberFormat phoneNumberFormat = PhoneNumberFormat.international, FutureOr onFormatFinished(String val)?, bool inputContainsCountryCode = false, int additionalDigits = 0, bool shouldKeepCursorAtEndOfInput = true})

Properties

additionalDigits int
Allow additional digits on the end of the mask. This is useful for countries like Austria where the libphonenumber example number doesn't include all of the possibilities. This way we can still format the number but allow additional digits on the end.
final
country CountryWithPhoneCode
The country to format this number with.
final
countryData List<CountryWithPhoneCode>?
Optionally override the country data. Useful for testing.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
onFormatFinished → (FutureOr Function(String val)?)
Optional function to execute after we are finished formatting the number. Useful if you need to get the formatted value for something else to use.
final
phoneNumberFormat PhoneNumberFormat
Specify if the number should be formatted to its national or international pattern. Will default to PhoneNumberFormat.international
final
phoneNumberType PhoneNumberType
Specify if the number should be formatted as a mobile or land line number. Will default to PhoneNumberType.mobile
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldKeepCursorAtEndOfInput bool
When shouldKeepCursorAtEndOfInput is true, the cursor will be forced to the end of the input after a format happened. Will default to true,
final

Methods

formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) TextEditingValue
Called when text is being typed or cut/copy/pasted in the EditableText.
override
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