copyWith method

InputDecoration copyWith(
  1. {Widget? icon,
  2. Color? iconColor,
  3. Widget? label,
  4. String? labelText,
  5. TextStyle? labelStyle,
  6. TextStyle? floatingLabelStyle,
  7. String? helperText,
  8. TextStyle? helperStyle,
  9. int? helperMaxLines,
  10. String? hintText,
  11. TextStyle? hintStyle,
  12. TextDirection? hintTextDirection,
  13. Duration? hintFadeDuration,
  14. int? hintMaxLines,
  15. Widget? error,
  16. String? errorText,
  17. TextStyle? errorStyle,
  18. int? errorMaxLines,
  19. FloatingLabelBehavior? floatingLabelBehavior,
  20. FloatingLabelAlignment? floatingLabelAlignment,
  21. bool? isCollapsed,
  22. bool? isDense,
  23. EdgeInsetsGeometry? contentPadding,
  24. Widget? prefixIcon,
  25. Widget? prefix,
  26. String? prefixText,
  27. BoxConstraints? prefixIconConstraints,
  28. TextStyle? prefixStyle,
  29. Color? prefixIconColor,
  30. Widget? suffixIcon,
  31. Widget? suffix,
  32. String? suffixText,
  33. TextStyle? suffixStyle,
  34. Color? suffixIconColor,
  35. BoxConstraints? suffixIconConstraints,
  36. Widget? counter,
  37. String? counterText,
  38. TextStyle? counterStyle,
  39. bool? filled,
  40. Color? fillColor,
  41. Color? focusColor,
  42. Color? hoverColor,
  43. InputBorder? errorBorder,
  44. InputBorder? focusedBorder,
  45. InputBorder? focusedErrorBorder,
  46. InputBorder? disabledBorder,
  47. InputBorder? enabledBorder,
  48. InputBorder? border,
  49. bool? enabled,
  50. String? semanticCounterText,
  51. bool? alignLabelWithHint,
  52. BoxConstraints? constraints}
)

Creates a copy of this input decoration with the given fields replaced by the new values.

Implementation

InputDecoration copyWith({
  Widget? icon,
  Color? iconColor,
  Widget? label,
  String? labelText,
  TextStyle? labelStyle,
  TextStyle? floatingLabelStyle,
  String? helperText,
  TextStyle? helperStyle,
  int? helperMaxLines,
  String? hintText,
  TextStyle? hintStyle,
  TextDirection? hintTextDirection,
  Duration? hintFadeDuration,
  int? hintMaxLines,
  Widget? error,
  String? errorText,
  TextStyle? errorStyle,
  int? errorMaxLines,
  FloatingLabelBehavior? floatingLabelBehavior,
  FloatingLabelAlignment? floatingLabelAlignment,
  bool? isCollapsed,
  bool? isDense,
  EdgeInsetsGeometry? contentPadding,
  Widget? prefixIcon,
  Widget? prefix,
  String? prefixText,
  BoxConstraints? prefixIconConstraints,
  TextStyle? prefixStyle,
  Color? prefixIconColor,
  Widget? suffixIcon,
  Widget? suffix,
  String? suffixText,
  TextStyle? suffixStyle,
  Color? suffixIconColor,
  BoxConstraints? suffixIconConstraints,
  Widget? counter,
  String? counterText,
  TextStyle? counterStyle,
  bool? filled,
  Color? fillColor,
  Color? focusColor,
  Color? hoverColor,
  InputBorder? errorBorder,
  InputBorder? focusedBorder,
  InputBorder? focusedErrorBorder,
  InputBorder? disabledBorder,
  InputBorder? enabledBorder,
  InputBorder? border,
  bool? enabled,
  String? semanticCounterText,
  bool? alignLabelWithHint,
  BoxConstraints? constraints,
}) {
  return InputDecoration(
    icon: icon ?? this.icon,
    iconColor: iconColor ?? this.iconColor,
    label: label ?? this.label,
    labelText: labelText ?? this.labelText,
    labelStyle: labelStyle ?? this.labelStyle,
    floatingLabelStyle: floatingLabelStyle ?? this.floatingLabelStyle,
    helperText: helperText ?? this.helperText,
    helperStyle: helperStyle ?? this.helperStyle,
    helperMaxLines : helperMaxLines ?? this.helperMaxLines,
    hintText: hintText ?? this.hintText,
    hintStyle: hintStyle ?? this.hintStyle,
    hintTextDirection: hintTextDirection ?? this.hintTextDirection,
    hintMaxLines: hintMaxLines ?? this.hintMaxLines,
    hintFadeDuration: hintFadeDuration ?? this.hintFadeDuration,
    error: error ?? this.error,
    errorText: errorText ?? this.errorText,
    errorStyle: errorStyle ?? this.errorStyle,
    errorMaxLines: errorMaxLines ?? this.errorMaxLines,
    floatingLabelBehavior: floatingLabelBehavior ?? this.floatingLabelBehavior,
    floatingLabelAlignment: floatingLabelAlignment ?? this.floatingLabelAlignment,
    isCollapsed: isCollapsed ?? this.isCollapsed,
    isDense: isDense ?? this.isDense,
    contentPadding: contentPadding ?? this.contentPadding,
    prefixIcon: prefixIcon ?? this.prefixIcon,
    prefix: prefix ?? this.prefix,
    prefixText: prefixText ?? this.prefixText,
    prefixStyle: prefixStyle ?? this.prefixStyle,
    prefixIconColor: prefixIconColor ?? this.prefixIconColor,
    prefixIconConstraints: prefixIconConstraints ?? this.prefixIconConstraints,
    suffixIcon: suffixIcon ?? this.suffixIcon,
    suffix: suffix ?? this.suffix,
    suffixText: suffixText ?? this.suffixText,
    suffixStyle: suffixStyle ?? this.suffixStyle,
    suffixIconColor: suffixIconColor ?? this.suffixIconColor,
    suffixIconConstraints: suffixIconConstraints ?? this.suffixIconConstraints,
    counter: counter ?? this.counter,
    counterText: counterText ?? this.counterText,
    counterStyle: counterStyle ?? this.counterStyle,
    filled: filled ?? this.filled,
    fillColor: fillColor ?? this.fillColor,
    focusColor: focusColor ?? this.focusColor,
    hoverColor: hoverColor ?? this.hoverColor,
    errorBorder: errorBorder ?? this.errorBorder,
    focusedBorder: focusedBorder ?? this.focusedBorder,
    focusedErrorBorder: focusedErrorBorder ?? this.focusedErrorBorder,
    disabledBorder: disabledBorder ?? this.disabledBorder,
    enabledBorder: enabledBorder ?? this.enabledBorder,
    border: border ?? this.border,
    enabled: enabled ?? this.enabled,
    semanticCounterText: semanticCounterText ?? this.semanticCounterText,
    alignLabelWithHint: alignLabelWithHint ?? this.alignLabelWithHint,
    constraints: constraints ?? this.constraints,
  );
}