applyDefaults method

InputDecoration applyDefaults (InputDecorationTheme theme)

Used by widgets like TextField and InputDecorator to create a new InputDecoration with default values taken from the theme.

Only null valued properties from this InputDecoration are replaced by the corresponding values from theme.

Implementation

InputDecoration applyDefaults(InputDecorationTheme theme) {
  return copyWith(
    labelStyle: labelStyle ?? theme.labelStyle,
    helperStyle: helperStyle ?? theme.helperStyle,
    hintStyle: hintStyle ?? theme.hintStyle,
    errorStyle: errorStyle ?? theme.errorStyle,
    errorMaxLines: errorMaxLines ?? theme.errorMaxLines,
    hasFloatingPlaceholder: hasFloatingPlaceholder ?? theme.hasFloatingPlaceholder,
    isDense: isDense ?? theme.isDense,
    contentPadding: contentPadding ?? theme.contentPadding,
    prefixStyle: prefixStyle ?? theme.prefixStyle,
    suffixStyle: suffixStyle ?? theme.suffixStyle,
    counterStyle: counterStyle ?? theme.counterStyle,
    filled: filled ?? theme.filled,
    fillColor: fillColor ?? theme.fillColor,
    errorBorder: errorBorder ?? theme.errorBorder,
    focusedBorder: focusedBorder ?? theme.focusedBorder,
    focusedErrorBorder: focusedErrorBorder ?? theme.focusedErrorBorder,
    disabledBorder: disabledBorder ?? theme.disabledBorder,
    enabledBorder: enabledBorder ?? theme.enabledBorder,
    border: border ?? theme.border,
    alignLabelWithHint: alignLabelWithHint ?? theme.alignLabelWithHint,
  );
}