copyWith method
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,
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,
);
}