copyWith method

  1. @override
TTextFieldTheme copyWith({
  1. TInputSize? size,
  2. TInputDecorationType? decorationType,
  3. WidgetStateProperty<Color>? color,
  4. WidgetStateProperty<Color>? backgroundColor,
  5. WidgetStateProperty<Color>? borderColor,
  6. WidgetStateProperty<TextStyle>? labelStyle,
  7. WidgetStateProperty<TextStyle>? helperTextStyle,
  8. WidgetStateProperty<TextStyle>? errorTextStyle,
  9. WidgetStateProperty<TextStyle>? tagStyle,
  10. WidgetStateProperty<BoxDecoration>? decoration,
  11. WidgetStateProperty<double>? borderRadius,
  12. WidgetStateProperty<double>? borderWidth,
  13. WidgetStateProperty<LabelBuilder>? labelBuilder,
  14. WidgetStateProperty<HelperTextBuilder>? helperTextBuilder,
  15. WidgetStateProperty<ErrorsBuilder>? errorsBuilder,
  16. WidgetStateProperty<TextStyle>? textStyle,
  17. WidgetStateProperty<TextStyle>? hintStyle,
  18. Widget? preWidget,
  19. Widget? postWidget,
  20. double? height,
  21. EdgeInsets? padding,
  22. double? fontSize,
  23. List<TextInputFormatter>? inputFormatters,
  24. TextInputType? keyboardType,
  25. TextCapitalization? textCapitalization,
  26. bool? autocorrect,
  27. bool? enableSuggestions,
  28. int? maxLength,
  29. MaxLengthEnforcement? maxLengthEnforcement,
  30. TextInputAction? textInputAction,
  31. bool? obscureText,
})
override

Implementation

@override
TTextFieldTheme copyWith({
  TInputSize? size,
  TInputDecorationType? decorationType,
  WidgetStateProperty<Color>? color,
  WidgetStateProperty<Color>? backgroundColor,
  WidgetStateProperty<Color>? borderColor,
  WidgetStateProperty<TextStyle>? labelStyle,
  WidgetStateProperty<TextStyle>? helperTextStyle,
  WidgetStateProperty<TextStyle>? errorTextStyle,
  WidgetStateProperty<TextStyle>? tagStyle,
  WidgetStateProperty<BoxDecoration>? decoration,
  WidgetStateProperty<double>? borderRadius,
  WidgetStateProperty<double>? borderWidth,
  WidgetStateProperty<LabelBuilder>? labelBuilder,
  WidgetStateProperty<HelperTextBuilder>? helperTextBuilder,
  WidgetStateProperty<ErrorsBuilder>? errorsBuilder,
  WidgetStateProperty<TextStyle>? textStyle,
  WidgetStateProperty<TextStyle>? hintStyle,
  Widget? preWidget,
  Widget? postWidget,
  double? height,
  EdgeInsets? padding,
  double? fontSize,
  List<TextInputFormatter>? inputFormatters,
  TextInputType? keyboardType,
  TextCapitalization? textCapitalization,
  bool? autocorrect,
  bool? enableSuggestions,
  int? maxLength,
  MaxLengthEnforcement? maxLengthEnforcement,
  TextInputAction? textInputAction,
  bool? obscureText,
}) {
  final baseTheme = super.copyWith(
    size: size,
    decorationType: decorationType,
    color: color,
    backgroundColor: backgroundColor,
    borderColor: borderColor,
    labelStyle: labelStyle,
    helperTextStyle: helperTextStyle,
    errorTextStyle: errorTextStyle,
    tagStyle: tagStyle,
    decoration: decoration,
    borderRadius: borderRadius,
    borderWidth: borderWidth,
    labelBuilder: labelBuilder,
    helperTextBuilder: helperTextBuilder,
    errorsBuilder: errorsBuilder,
    preWidget: preWidget,
    postWidget: postWidget,
    height: height,
    padding: padding,
    fontSize: fontSize,
  );

  return TTextFieldTheme(
    // Base theme properties from parent
    size: baseTheme.size,
    decorationType: baseTheme.decorationType,
    color: baseTheme.color,
    backgroundColor: baseTheme.backgroundColor,
    borderColor: baseTheme.borderColor,
    labelStyle: baseTheme.labelStyle,
    helperTextStyle: baseTheme.helperTextStyle,
    errorTextStyle: baseTheme.errorTextStyle,
    tagStyle: baseTheme.tagStyle,
    decoration: baseTheme.decoration,
    borderRadius: baseTheme.borderRadius,
    borderWidth: baseTheme.borderWidth,
    labelBuilder: baseTheme.labelBuilder,
    helperTextBuilder: baseTheme.helperTextBuilder,
    errorsBuilder: baseTheme.errorsBuilder,
    preWidget: baseTheme.preWidget,
    postWidget: baseTheme.postWidget,
    height: baseTheme.height,
    padding: baseTheme.padding,
    fontSize: baseTheme.fontSize,

    // Text-specific properties
    textStyle: textStyle ?? this.textStyle,
    hintStyle: hintStyle ?? this.hintStyle,
    inputFormatters: inputFormatters ?? this.inputFormatters,
    keyboardType: keyboardType ?? this.keyboardType,
    textCapitalization: textCapitalization ?? this.textCapitalization,
    autocorrect: autocorrect ?? this.autocorrect,
    enableSuggestions: enableSuggestions ?? this.enableSuggestions,
    maxLength: maxLength ?? this.maxLength,
    maxLengthEnforcement: maxLengthEnforcement ?? this.maxLengthEnforcement,
    textInputAction: textInputAction ?? this.textInputAction,
    obscureText: obscureText ?? this.obscureText,
  );
}