copyWith method
TButton
copyWith({
- TButtonTheme? theme,
- TWidgetTheme? baseTheme,
- TButtonShape? shape,
- TButtonType? type,
- TButtonSize? size,
- dynamic icon,
- String? imageUrl,
- Color? color,
- String? text,
- bool? loading,
- String? loadingText,
- String? tooltip,
- bool? active,
- dynamic activeIcon,
- Color? activeColor,
- (double, double)? turns,
- bool? showTick,
- Alignment? tickAlignment,
- Widget? tickWidget,
- dynamic badge,
- Alignment? badgeAlignment,
- Color? badgeColor,
- Color? badgeTextColor,
- Widget? child,
- VoidCallback? onTap,
- dynamic onPressed()?,
- ValueChanged<
bool> ? onChanged, - Duration? duration,
- Duration? throttleDuration,
Creates a copy of the button with updated properties.
Implementation
TButton copyWith({
TButtonTheme? theme,
TWidgetTheme? baseTheme,
TButtonShape? shape,
TButtonType? type,
TButtonSize? size,
dynamic icon,
String? imageUrl,
Color? color,
String? text,
bool? loading,
String? loadingText,
String? tooltip,
bool? active,
dynamic activeIcon,
Color? activeColor,
(double initial, double active)? turns,
bool? showTick,
Alignment? tickAlignment,
Widget? tickWidget,
dynamic badge,
Alignment? badgeAlignment,
Color? badgeColor,
Color? badgeTextColor,
Widget? child,
VoidCallback? onTap,
Function(TButtonPressOptions)? onPressed,
ValueChanged<bool>? onChanged,
Duration? duration,
Duration? throttleDuration,
}) {
return TButton(
theme: theme ?? this.theme,
baseTheme: baseTheme ?? this.baseTheme,
shape: shape ?? this.shape,
type: type ?? this.type,
size: size ?? this.size,
icon: icon ?? this.icon,
imageUrl: imageUrl ?? this.imageUrl,
color: color ?? this.color,
text: text ?? this.text,
loading: loading ?? this.loading,
loadingText: loadingText ?? this.loadingText,
tooltip: tooltip ?? this.tooltip,
active: active ?? this.active,
activeIcon: activeIcon ?? this.activeIcon,
activeColor: activeColor ?? this.activeColor,
turns: turns ?? this.turns,
showTick: showTick ?? this.showTick,
tickAlignment: tickAlignment ?? this.tickAlignment,
tickWidget: tickWidget ?? this.tickWidget,
badge: badge ?? this.badge,
badgeAlignment: badgeAlignment ?? this.badgeAlignment,
badgeColor: badgeColor ?? this.badgeColor,
badgeTextColor: badgeTextColor ?? this.badgeTextColor,
onTap: onTap ?? this.onTap,
onPressed: onPressed ?? this.onPressed,
onChanged: onChanged ?? this.onChanged,
duration: duration ?? this.duration,
throttleDuration: throttleDuration ?? this.throttleDuration,
child: child ?? this.child,
);
}