copyWith method

TButtonTheme copyWith({
  1. TWidgetTheme? baseTheme,
  2. TButtonSize? size,
  3. TButtonShape? shape,
  4. ButtonStyle? buttonStyle,
  5. double? scaleOnPress,
})

Implementation

TButtonTheme copyWith({
  TWidgetTheme? baseTheme,
  TButtonSize? size,
  TButtonShape? shape,
  ButtonStyle? buttonStyle,
  double? scaleOnPress,
}) {
  final effectiveBaseTheme = baseTheme ?? this.baseTheme;
  final effectiveSize = size ?? this.size;
  final effectiveShape = shape ?? this.shape;

  return TButtonTheme(
    baseTheme: effectiveBaseTheme,
    size: effectiveSize,
    shape: effectiveShape,
    buttonStyle: buttonStyle ?? buildButtonStyle(effectiveBaseTheme, effectiveShape, effectiveSize),
    scaleOnPress: scaleOnPress ?? this.scaleOnPress,
  );
}