applyDefaultsFrom method

InputDecoration applyDefaultsFrom(
  1. InputDecoration? other
)

Applies the non-null properties from other to this InputDecoration. enabled property is excluded from this operation.

Implementation

InputDecoration applyDefaultsFrom(InputDecoration? other) {
  return other == null ? this : copyWith(
    icon: icon ?? other.icon,
    label: label ?? other.label,
    labelText: labelText ?? other.labelText,
    helperText: helperText ?? other.helperText,
    hintText: hintText ?? other.hintText,
    errorText: errorText ?? other.errorText,
    errorStyle: errorStyle ?? other.errorStyle,
    errorMaxLines: errorMaxLines ?? other.errorMaxLines,
    isDense: isDense ?? other.isDense,
    contentPadding: contentPadding ?? other.contentPadding,
    prefixIcon: prefixIcon ?? other.prefixIcon,
    prefix: prefix ?? other.prefix,
    prefixText: prefixText ?? other.prefixText,
    prefixStyle: prefixStyle ?? other.prefixStyle,
    suffixIcon: suffixIcon ?? other.suffixIcon,
    suffix: suffix ?? other.suffix,
    suffixText: suffixText ?? other.suffixText,
    suffixStyle: suffixStyle ?? other.suffixStyle,
    counter: counter ?? other.counter,
    counterText: counterText ?? other.counterText,
    counterStyle: counterStyle ?? other.counterStyle,
    filled: filled ?? other.filled,
    fillColor: fillColor ?? other.fillColor,
    focusColor: focusColor ?? other.focusColor,
    hoverColor: hoverColor ?? other.hoverColor,
    errorBorder: errorBorder ?? other.errorBorder,
    focusedBorder: focusedBorder ?? other.focusedBorder,
    focusedErrorBorder: focusedErrorBorder ?? other.focusedErrorBorder,
    disabledBorder: disabledBorder ?? other.disabledBorder,
    enabledBorder: enabledBorder ?? other.enabledBorder,
    border: border ?? other.border,
    // enabled: enabled ?? other.enabled,
    semanticCounterText: semanticCounterText ?? other.semanticCounterText,
    alignLabelWithHint: alignLabelWithHint ?? other.alignLabelWithHint,
    constraints: constraints ?? other.constraints,
    floatingLabelAlignment: floatingLabelAlignment ?? other.floatingLabelAlignment,
    floatingLabelBehavior: floatingLabelBehavior ?? other.floatingLabelBehavior,
    floatingLabelStyle: floatingLabelStyle ?? other.floatingLabelStyle,
    iconColor: iconColor ?? other.iconColor,
    hintFadeDuration: hintFadeDuration ?? other.hintFadeDuration,
    hintMaxLines: hintMaxLines ?? other.hintMaxLines,
    hintStyle: hintStyle ?? other.hintStyle,
    hintTextDirection: hintTextDirection ?? other.hintTextDirection,
    isCollapsed: isCollapsed ?? other.isCollapsed,
  );
}