buildDefaultInputDecoration method

InputDecoration? buildDefaultInputDecoration()

Implementation

InputDecoration? buildDefaultInputDecoration() {
  if (widget.decoration == null) {
    Widget? suffixIcon;
    if (inlineStyle == InlineStyle.clearStyle) {
      if (widget.clearBuilder != null) {
        suffixIcon = widget.clearBuilder!(context);
      } else {
        suffixIcon = (widget.enableClear && getIsEnable() && getHasContent())
            ? GestureDetector(
                onTap: () {
                  clearContent();
                },
                child: widget.clearIcon,
              )
            : const Text("");
      }
    }
    if (inlineStyle == InlineStyle.normalStyle) {
      suffixIcon = widget.suffixIcon;
    }
    return InputDecoration(
      suffixIcon: suffixIcon,
      fillColor: widget.fillColor,
      filled: widget.filled,
      border: widget.border,
      focusedBorder: _buildBorder(widget.focusedBorder),
      enabledBorder: _buildBorder(widget.enabledBorder),
      disabledBorder: _buildBorder(widget.disabledBorder),
      focusedErrorBorder: _buildBorder(widget.focusedErrorBorder),
      errorBorder: _buildBorder(widget.errorBorder),
      isCollapsed: widget.isCollapsed,
      contentPadding: widget.contentPadding,
      icon: widget.icon,
      iconColor: widget.iconColor,
      label: widget.label,
      labelText: widget.labelText,
      labelStyle: widget.labelStyle,
      floatingLabelStyle: widget.floatingLabelStyle,
      helperText: widget.helperText,
      helperStyle: widget.helperStyle,
      helperMaxLines: widget.helperMaxLines,
      hintText: widget.hintText,
      hintStyle: widget.hintStyle,
      hintTextDirection: widget.hintTextDirection,
      hintMaxLines: widget.hintMaxLines,
      errorText: widget.errorText,
      errorStyle: widget.errorStyle,
      errorMaxLines: widget.errorMaxLines,
      floatingLabelBehavior: widget.floatingLabelBehavior,
      floatingLabelAlignment: widget.floatingLabelAlignment,
      prefixIcon: widget.prefixIcon,
      prefixIconConstraints: widget.prefixIconConstraints,
      prefix: widget.prefix,
      prefixText: widget.prefixText,
      prefixStyle: widget.prefixStyle,
      prefixIconColor: widget.prefixIconColor,
      suffix: widget.suffix,
      suffixText: widget.suffixText,
      suffixStyle: widget.suffixStyle,
      suffixIconColor: widget.suffixIconColor,
      suffixIconConstraints: widget.suffixIconConstraints,
      counter: widget.counter,
      counterText: widget.counterText,
      counterStyle: widget.counterStyle,
      focusColor: widget.focusColor,
      hoverColor: widget.hoverColor,
      semanticCounterText: widget.semanticCounterText,
      alignLabelWithHint: widget.alignLabelWithHint,
      constraints: widget.constraints,
    );
  }
  return widget.decoration;
}