MaskTextInputFormatter class
- Implemented types
Constructors
-
MaskTextInputFormatter({String? mask, Map<
String, RegExp> ? filter, String? initialText, MaskAutoCompletionType type = MaskAutoCompletionType.lazy}) -
Create the
mask
formatter for TextField -
MaskTextInputFormatter.eager({String? mask, Map<
String, RegExp> ? filter, String? initialText}) -
Create the eager
mask
formatter for TextField
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → MaskAutoCompletionType
-
no setter
Methods
-
clear(
) → void - Clear masked text of the formatter Note: you need to call this method if you clear the text of the TextField because it doesn't call the formatter when it has empty text
-
formatEditUpdate(
TextEditingValue oldValue, TextEditingValue newValue) → TextEditingValue -
Called when text is being typed or cut/copy/pasted in the EditableText.
override
-
getMask(
) → String? - Get current mask
-
getMaskedText(
) → String - Get masked text, e.g. "+0 (123) 456-78-90"
-
getUnmaskedText(
) → String - Get unmasked text, e.g. "01234567890"
-
isFill(
) → bool - Check if target mask is filled
-
maskText(
String text) → String - Mask some text
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unmaskText(
String text) → String - Unmask some text
-
updateMask(
{String? mask, Map< String, RegExp> ? filter, MaskAutoCompletionType? type, TextEditingValue? newValue}) → TextEditingValue - Change the mask
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited