updateDecoration method
void
updateDecoration({
- InputDecoration? decoration,
- List<
TextInputFormatter> ? inputFormatters, - TextCapitalization? textCapitalization,
- TextStyle? style,
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- bool refresh = true,
Implementation
void updateDecoration(
{InputDecoration? decoration,
List<TextInputFormatter>? inputFormatters,
TextCapitalization? textCapitalization,
TextStyle? style,
TextInputType? keyboardType,
TextInputAction? textInputAction,
bool refresh = true}) {
if (decoration != null) {
this.decoration = decoration;
}
if (inputFormatters != null) {
this.inputFormatters = inputFormatters;
}
if (textCapitalization != null) {
this.textCapitalization = textCapitalization;
}
if (style != null) {
this.style = style;
}
if (keyboardType != null) {
this.keyboardType = keyboardType;
}
if (textInputAction != null) {
this.textInputAction = textInputAction;
}
this.decoration = this.decoration.copyWith(
errorText: textEditingController!.error,
suffixIcon: IconButton(
icon: getSuffixIcon,
// iconSize: this.customButtonIconSize,
// padding: EdgeInsets.only(right: 0),
onPressed: !enabled
? null
: () {
if (!hasText && !showingSuggestions) {
showAllSuggestions();
} else {
if (showingSuggestions) hideAllSuggestions();
clear();
setState(() {});
}
},
),
suffixText: null,
);
updatedTextField();
if (refresh) setState(() {});
}