copyWith method

TButtonTheme copyWith({
  1. TWidgetTheme? baseTheme,
  2. TSize? size,
  3. TButtonShape? shape,
  4. ButtonStyle? buttonStyle,
  5. double? scaleOnPress,
  6. Gradient? gradient,
  7. double? elevation,
  8. Color? shadowColor,
})

Implementation

TButtonTheme copyWith({
  TWidgetTheme? baseTheme,
  TSize? size,
  TButtonShape? shape,
  ButtonStyle? buttonStyle,
  double? scaleOnPress,
  Gradient? gradient,
  double? elevation,
  Color? shadowColor,
}) {
  final effectiveBaseTheme = baseTheme ?? this.baseTheme;
  final effectiveSize = size ?? this.size;
  final effectiveShape = shape ?? this.shape;
  final effectiveElevation = elevation ?? this.elevation;
  final effectiveShadowColor = shadowColor ?? this.shadowColor;

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