copyWith method
TButton
copyWith({
- TButtonTheme? theme,
- TWidgetTheme? baseTheme,
- TButtonShape? shape,
- TButtonType? type,
- TButtonSize? size,
- IconData? icon,
- String? imageUrl,
- Color? color,
- String? text,
- bool? loading,
- String? loadingText,
- String? tooltip,
- bool? active,
- IconData? activeIcon,
- Color? activeColor,
- 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,
IconData? icon,
String? imageUrl,
Color? color,
String? text,
bool? loading,
String? loadingText,
String? tooltip,
bool? active,
IconData? activeIcon,
Color? activeColor,
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,
onTap: onTap ?? this.onTap,
onPressed: onPressed ?? this.onPressed,
onChanged: onChanged ?? this.onChanged,
duration: duration ?? this.duration,
throttleDuration: throttleDuration ?? this.throttleDuration,
child: child ?? this.child,
);
}