copyWith method Null safety

InputDecorationTheme copyWith(
  1. {TextStyle? labelStyle,
  2. TextStyle? floatingLabelStyle,
  3. TextStyle? helperStyle,
  4. int? helperMaxLines,
  5. TextStyle? hintStyle,
  6. TextStyle? errorStyle,
  7. int? errorMaxLines,
  8. FloatingLabelBehavior? floatingLabelBehavior,
  9. FloatingLabelAlignment? floatingLabelAlignment,
  10. bool? isDense,
  11. EdgeInsetsGeometry? contentPadding,
  12. bool? isCollapsed,
  13. Color? iconColor,
  14. TextStyle? prefixStyle,
  15. Color? prefixIconColor,
  16. TextStyle? suffixStyle,
  17. Color? suffixIconColor,
  18. TextStyle? counterStyle,
  19. bool? filled,
  20. Color? fillColor,
  21. BorderSide? activeIndicatorBorder,
  22. BorderSide? outlineBorder,
  23. Color? focusColor,
  24. Color? hoverColor,
  25. InputBorder? errorBorder,
  26. InputBorder? focusedBorder,
  27. InputBorder? focusedErrorBorder,
  28. InputBorder? disabledBorder,
  29. InputBorder? enabledBorder,
  30. InputBorder? border,
  31. bool? alignLabelWithHint,
  32. BoxConstraints? constraints}
)

Creates a copy of this object but with the given fields replaced with the new values.

Implementation

InputDecorationTheme copyWith({
  TextStyle? labelStyle,
  TextStyle? floatingLabelStyle,
  TextStyle? helperStyle,
  int? helperMaxLines,
  TextStyle? hintStyle,
  TextStyle? errorStyle,
  int? errorMaxLines,
  FloatingLabelBehavior? floatingLabelBehavior,
  FloatingLabelAlignment? floatingLabelAlignment,
  bool? isDense,
  EdgeInsetsGeometry? contentPadding,
  bool? isCollapsed,
  Color? iconColor,
  TextStyle? prefixStyle,
  Color? prefixIconColor,
  TextStyle? suffixStyle,
  Color? suffixIconColor,
  TextStyle? counterStyle,
  bool? filled,
  Color? fillColor,
  BorderSide? activeIndicatorBorder,
  BorderSide? outlineBorder,
  Color? focusColor,
  Color? hoverColor,
  InputBorder? errorBorder,
  InputBorder? focusedBorder,
  InputBorder? focusedErrorBorder,
  InputBorder? disabledBorder,
  InputBorder? enabledBorder,
  InputBorder? border,
  bool? alignLabelWithHint,
  BoxConstraints? constraints,
}) {
  return InputDecorationTheme(
    labelStyle: labelStyle ?? this.labelStyle,
    floatingLabelStyle: floatingLabelStyle ?? this.floatingLabelStyle,
    helperStyle: helperStyle ?? this.helperStyle,
    helperMaxLines: helperMaxLines ?? this.helperMaxLines,
    hintStyle: hintStyle ?? this.hintStyle,
    errorStyle: errorStyle ?? this.errorStyle,
    errorMaxLines: errorMaxLines ?? this.errorMaxLines,
    floatingLabelBehavior: floatingLabelBehavior ?? this.floatingLabelBehavior,
    floatingLabelAlignment: floatingLabelAlignment ?? this.floatingLabelAlignment,
    isDense: isDense ?? this.isDense,
    contentPadding: contentPadding ?? this.contentPadding,
    iconColor: iconColor,
    isCollapsed: isCollapsed ?? this.isCollapsed,
    prefixStyle: prefixStyle ?? this.prefixStyle,
    prefixIconColor: prefixIconColor ?? this.prefixIconColor,
    suffixStyle: suffixStyle ?? this.suffixStyle,
    suffixIconColor: suffixIconColor ?? this.suffixIconColor,
    counterStyle: counterStyle ?? this.counterStyle,
    filled: filled ?? this.filled,
    fillColor: fillColor ?? this.fillColor,
    activeIndicatorBorder: activeIndicatorBorder ?? this.activeIndicatorBorder,
    outlineBorder: outlineBorder ?? this.outlineBorder,
    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,
    alignLabelWithHint: alignLabelWithHint ?? this.alignLabelWithHint,
    constraints: constraints ?? this.constraints,
  );
}