copyWith method

PiButton copyWith({
  1. TextStyle? textStyle,
  2. Color? backgroundColor,
  3. Color? foregroundColor,
  4. BorderRadius? borderRadius,
  5. double? horizontalPadding,
  6. double? verticalPadding,
  7. Color? loadingIconColor,
  8. double? loadingIconStrokeWidth,
  9. Color? iconPreffixColor,
  10. Color? iconSuffixColor,
  11. Color? splashColor,
  12. double? height,
  13. double? width,
  14. double? borderWidth,
  15. 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,
  );
}