updateDecoration method
void
updateDecoration(
- InputDecoration decoration,
- List<
TextInputFormatter> inputFormatters, - TextCapitalization textCapitalization,
- TextStyle style,
- TextInputType keyboardType,
- TextInputAction textInputAction,
Implementation
void updateDecoration(
InputDecoration decoration,
List<TextInputFormatter> inputFormatters,
TextCapitalization textCapitalization,
TextStyle style,
TextInputType keyboardType,
TextInputAction textInputAction) {
this.decoration = decoration;
this.inputFormatters = inputFormatters;
this.textCapitalization = textCapitalization;
this.style = style;
this.keyboardType = keyboardType;
this.textInputAction = textInputAction;
setState(() {
textField = TextField(
inputFormatters: this.inputFormatters,
textCapitalization: this.textCapitalization!,
decoration: this.decoration,
style: this.style,
keyboardType: this.keyboardType,
focusNode: focusNode ?? FocusNode(),
controller: controller ?? TextEditingController(),
textInputAction: this.textInputAction,
onChanged: (newText) {
currentText = newText;
updateOverlay(newText);
if (textChanged != null) {
textChanged!(newText);
}
},
onTap: () {
updateOverlay(currentText);
},
onSubmitted: (submittedText) =>
triggerSubmitted(submittedText: submittedText),
);
});
}