MaskedTextController class

A TextEditingController extended to provide custom masks to flutter

Inheritance

Constructors

MaskedTextController({@required String mask, String text, Map<String, RegExp> translator})

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
hasListeners bool
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
mask String
The current applied mask
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
selection TextSelection
The currently selected text. [...]
read / write, inherited
text String
The current string the user is editing.
read / write, inherited-getter, override-setter
translator Map<String, RegExp>
Translator from mask characters to RegExp
read / write
value TextEditingValue
The current value stored in this notifier. [...]
read / write, inherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes. [...]
inherited
buildTextSpan({required BuildContext context, TextStyle style, required bool withComposing}) TextSpan
Builds TextSpan from current editing value. [...]
inherited
clear() → void
Set the value to empty. [...]
inherited
clearComposing() → void
Set the composing region to an empty range. [...]
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed). [...]
@mustCallSuper, inherited
isSelectionWithinTextBounds(TextSelection selection) bool
Check that the selection is inside of the bounds of text.
inherited
moveCursorToEnd() → void
Moves cursor to the end of the text
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notifyListeners() → void
Call all the registered listeners. [...]
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
updateMask(String newMask, {bool shouldMoveCursorToEnd = true}) → void
Replaces mask with a newMask and moves cursor to the end if shouldMoveCursorToEnd is true
updateText(String newText) → void
Updates the current text with a new one applying the mask

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

getDefaultTranslator() Map<String, RegExp>
Default RegExp for each character available for the mask [...]