updateDecoration method

void updateDecoration(
  1. InputDecoration decoration,
  2. List<TextInputFormatter> inputFormatters,
  3. TextCapitalization textCapitalization,
  4. TextStyle style,
  5. TextInputType keyboardType,
  6. 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),
    );
  });
}