copyWith method

  1. @override
CInputDecorationTheme copyWith({
  1. TextStyle? inputStyle,
  2. TextCapitalization? textCapitalization,
  3. TextDirection? textDirection,
  4. TextAlign? textAlign,
  5. TextAlignVertical? textAlignVertical,
  6. int? maxLines,
  7. int? minLines,
  8. bool? expands,
  9. int? maxLength,
  10. EdgeInsets? scrollPadding,
  11. Clip? clipBehavior,
  12. int? hintMaxLines,
  13. TextDirection? hintTextDirection,
  14. TextStyle? labelStyle,
  15. TextStyle? floatingLabelStyle,
  16. TextStyle? helperStyle,
  17. int? helperMaxLines,
  18. TextStyle? hintStyle,
  19. Duration? hintFadeDuration,
  20. TextStyle? errorStyle,
  21. int? errorMaxLines,
  22. FloatingLabelBehavior? floatingLabelBehavior,
  23. FloatingLabelAlignment? floatingLabelAlignment,
  24. bool? isDense,
  25. EdgeInsetsGeometry? contentPadding,
  26. bool? isCollapsed,
  27. Color? iconColor,
  28. TextStyle? prefixStyle,
  29. Color? prefixIconColor,
  30. TextStyle? suffixStyle,
  31. Color? suffixIconColor,
  32. TextStyle? counterStyle,
  33. bool? filled,
  34. Color? fillColor,
  35. BorderSide? activeIndicatorBorder,
  36. BorderSide? outlineBorder,
  37. Color? focusColor,
  38. Color? hoverColor,
  39. InputBorder? errorBorder,
  40. InputBorder? focusedBorder,
  41. InputBorder? focusedErrorBorder,
  42. InputBorder? disabledBorder,
  43. InputBorder? enabledBorder,
  44. InputBorder? border,
  45. bool? alignLabelWithHint,
  46. BoxConstraints? constraints,
})
override

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

Implementation

@override
CInputDecorationTheme copyWith({
  // Items added to make it possible to match other theme styles.
  TextStyle? inputStyle,
  TextCapitalization? textCapitalization,
  TextDirection? textDirection,
  TextAlign? textAlign,
  TextAlignVertical? textAlignVertical,
  int? maxLines,
  int? minLines,
  bool? expands,
  int? maxLength,
  EdgeInsets? scrollPadding,
  Clip? clipBehavior,
  int? hintMaxLines,
  TextDirection? hintTextDirection,

  // From the original object
  TextStyle? labelStyle,
  TextStyle? floatingLabelStyle,
  TextStyle? helperStyle,
  int? helperMaxLines,
  TextStyle? hintStyle,
  Duration? hintFadeDuration,
  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 CInputDecorationTheme(
    inputStyle: inputStyle ?? this.inputStyle,
    textCapitalization: textCapitalization ?? this.textCapitalization,
    textAlign: textAlign ?? this.textAlign,
    textAlignVertical: textAlignVertical ?? this.textAlignVertical,
    textDirection: textDirection ?? this.textDirection,
    maxLines: maxLines == null
        ? this.maxLines
        : maxLines == 0
            ? null
            : maxLines,
    minLines: minLines == null
        ? this.minLines
        : minLines == 0
            ? null
            : minLines,
    expands: expands ?? this.expands,
    maxLength: maxLength == null
        ? this.maxLength
        : maxLength == 0
            ? null
            : maxLength,
    scrollPadding: scrollPadding ?? this.scrollPadding,
    clipBehavior: clipBehavior ?? this.clipBehavior,
    hintMaxLines: hintMaxLines ?? this.hintMaxLines,
    hintTextDirection: hintTextDirection ?? this.hintTextDirection,

    // The existing InputDecorationTheme
    labelStyle: labelStyle ?? this.labelStyle,
    floatingLabelStyle: floatingLabelStyle ?? this.floatingLabelStyle,
    helperStyle: helperStyle ?? this.helperStyle,
    helperMaxLines: helperMaxLines ?? this.helperMaxLines,
    hintStyle: hintStyle ?? this.hintStyle,
    hintFadeDuration: hintFadeDuration ?? this.hintFadeDuration,
    errorStyle: errorStyle ?? this.errorStyle,
    errorMaxLines: errorMaxLines ?? this.errorMaxLines,
    floatingLabelBehavior:
        floatingLabelBehavior ?? this.floatingLabelBehavior,
    floatingLabelAlignment:
        floatingLabelAlignment ?? this.floatingLabelAlignment,
    isDense: isDense ?? this.isDense,
    contentPadding: contentPadding ?? this.contentPadding,
    isCollapsed: isCollapsed ?? this.isCollapsed,
    iconColor: iconColor ?? this.iconColor,
    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.errorBorder,
    enabledBorder: enabledBorder ?? this.enabledBorder,
    border: border ?? this.border,
    alignLabelWithHint: alignLabelWithHint ?? this.alignLabelWithHint,
    constraints: constraints ?? this.constraints,
  );
}