MaskedInputFormatter class

Inheritance

Constructors

MaskedInputFormatter(String mask, {RegExp? allowedCharMatcher})
mask is a string that must contain # (hash) and 0 (zero) as maskable characters. # means any possible character, 0 means only digits. So if you want to match e.g. a string like this GGG-FB-897-R5 you need a mask like this ###-##-000-#0 a mask like ###-### will also match 123-034 but a mask like 000-000 will only match digits and won't allow a string like Gtt-RBB

Properties

allowedCharMatcher RegExp?
final
hashCode int
The hash code for this object.
no setterinherited
isFilled bool
no setter
mask String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unmaskedValue String
no setter

Methods

applyMask(String text) FormattedValue
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