Field.mask constructor
Field.mask(
- String key, {
- String? label,
- dynamic value,
- FormValidator? validator,
- bool autofocus = false,
- String? dummyData,
- Widget? header,
- TextStyle? titleStyle,
- bool? readOnly,
- Widget? prefixIcon,
- bool clearable = false,
- Widget? clearIcon,
- required String? mask,
- String match = r'[\w\d]',
- bool? maskReturnValue = false,
- FieldStyleTextField? style,
- dynamic onChanged(
- dynamic value
Field.mask is a constructor that helps in managing mask fields
Implementation
Field.mask(
this.key, {
this.label,
dynamic value,
this.validator,
this.autofocus = false,
this.dummyData,
this.header,
this.footer,
this.titleStyle,
this.hidden = false,
this.readOnly,
Widget? prefixIcon,
bool clearable = false,
Widget? clearIcon,
required String? mask,
String match = r'[\w\d]',
bool? maskReturnValue = false,
FieldStyleTextField? style,
Function(dynamic value)? onChanged,
}) : _value = value,
this.style = style ?? FieldStyleTextField() {
setOnChanged(onChanged);
this.style = (this.style as FieldStyleTextField).copyWith(
maskedReturnValue: maskReturnValue,
inputFormatters: [
MaskTextInputFormatter(
mask: mask,
filter: {"#": RegExp(match)},
type: MaskAutoCompletionType.lazy,
),
],
);
widget = NyFormTextField.fromField(this);
}