copyWith method
PiButton
copyWith({
- TextStyle? textStyle,
- Color? backgroundColor,
- Color? foregroundColor,
- BorderRadius? borderRadius,
- double? horizontalPadding,
- double? verticalPadding,
- Color? loadingIconColor,
- double? loadingIconStrokeWidth,
- Color? iconPreffixColor,
- Color? iconSuffixColor,
- Color? splashColor,
- double? height,
- double? width,
- double? borderWidth,
- double? loadingRadius,
Implementation
PiButton copyWith({
// void Function()? onTap,
// void Function()? onDoubleTap,
// void Function()? onLongPress,
// String? label,
// Widget? iconPreffix,
// Widget? iconSuffix,
// PiButtonShape? shape,
// PiButtonColor? color,
// PiButtonSize? size,
// PiButtonState? state,
// PiButtonLayout? layout,
// PiButtonType? border,
// PiButtonLoadingType? loadingType,
TextStyle? textStyle,
// =====
Color? backgroundColor,
Color? foregroundColor,
BorderRadius? borderRadius,
double? horizontalPadding,
double? verticalPadding,
Color? loadingIconColor,
double? loadingIconStrokeWidth,
Color? iconPreffixColor,
Color? iconSuffixColor,
Color? splashColor,
double? height,
double? width,
double? borderWidth,
double? loadingRadius,
}) {
return PiButton._(
onTap: onTap,
onDoubleTap: onDoubleTap,
onLongPress: onLongPress,
label: label,
iconPreffix: iconPreffix,
iconSuffix: iconSuffix,
shape: shape,
color: color,
size: size,
state: state,
layout: layout,
type: type,
loadingType: loadingType,
// ======
backgroundColor: backgroundColor ?? this.backgroundColor,
foregroundColor: foregroundColor ?? this.foregroundColor,
borderRadius: borderRadius ?? this.borderRadius,
horizontalPadding: horizontalPadding ?? this.horizontalPadding,
verticalPadding: verticalPadding ?? this.verticalPadding,
loadingIconColor: loadingIconColor ?? this.loadingIconColor,
loadingIconStrokeWidth: loadingIconStrokeWidth ?? this.loadingIconStrokeWidth,
iconPreffixColor: iconPreffixColor ?? this.iconPreffixColor,
iconSuffixColor: iconSuffixColor ?? this.iconSuffixColor,
splashColor: splashColor ?? this.splashColor,
height: height,
width: width,
borderWidth: borderWidth ?? this.borderWidth,
loadingRadius: loadingRadius ?? this.loadingRadius,
textStyle: textStyle ?? this.textStyle,
);
}