updateMask method
void
updateMask(})
Replaces mask with a newMask
and moves cursor to the end if
shouldMoveCursorToEnd
is true
shouldUpdateValue
Set to true to request a following update in the text.
If this method is being called in beforeChange this MUST be false,
since it will call updateText as next step automatically.
Implementation
void updateMask(
String newMask, {
bool shouldMoveCursorToEnd = true,
bool shouldUpdateValue = false,
}) {
if (mask != newMask) {
_previousMask = mask;
mask = newMask;
if (shouldUpdateValue) {
updateText(text);
}
if (shouldMoveCursorToEnd) {
moveCursorToEnd();
}
}
}