copyWith method

VButton copyWith({
  1. void onTap()?,
  2. void onDoubleTap()?,
  3. void onLongPress()?,
  4. String? label,
  5. Widget? iconPreffix,
  6. Widget? iconSuffix,
  7. VButtonShape? shape,
  8. VButtonColor? color,
  9. VButtonSize? size,
  10. VButtonState? state,
  11. VButtonLayout? layout,
  12. VButtonType? border,
  13. VButtonLoadingType? loadingType,
  14. TextStyle? textStyle,
  15. Color? backgroundColor,
  16. Color? forgroundColor,
  17. BorderRadius? borderRadius,
  18. EdgeInsetsGeometry? padding,
  19. Color? loadingIconColor,
  20. double? loadingIconStrokeWidth,
  21. Color? iconPreffixColor,
  22. Color? iconSuffixColor,
  23. Color? splashColor,
})

Implementation

VButton copyWith({
  void Function()? onTap,
  void Function()? onDoubleTap,
  void Function()? onLongPress,
  String? label,
  Widget? iconPreffix,
  Widget? iconSuffix,
  VButtonShape? shape,
  VButtonColor? color,
  VButtonSize? size,
  VButtonState? state,
  VButtonLayout? layout,
  VButtonType? border,
  VButtonLoadingType? loadingType,
  TextStyle? textStyle,
  // =====
  Color? backgroundColor,
  Color? forgroundColor,
  BorderRadius? borderRadius,
  EdgeInsetsGeometry? padding,
  Color? loadingIconColor,
  double? loadingIconStrokeWidth,
  Color? iconPreffixColor,
  Color? iconSuffixColor,
  Color? splashColor,
}) {
  return VButton._(
    onTap: onTap ?? this.onTap,
    onDoubleTap: onDoubleTap ?? this.onDoubleTap,
    onLongPress: onLongPress ?? this.onLongPress,
    label: label ?? this.label,
    iconPreffix: iconPreffix ?? this.iconPreffix,
    iconSuffix: iconSuffix ?? this.iconSuffix,
    shape: shape ?? this.shape,
    color: color ?? this.color,
    size: size ?? this.size,
    state: state ?? this.state,
    layout: layout ?? this.layout,
    type: border ?? type,
    loadingType: loadingType ?? this.loadingType,
    textStyle: textStyle ?? this.textStyle,
    // ======
    backgroundColor: backgroundColor ?? this.backgroundColor,
    forgroundColor: forgroundColor ?? this.forgroundColor,
    borderRadius: borderRadius ?? this.borderRadius,
    padding: padding ?? this.padding,
    loadingIconColor: loadingIconColor ?? this.loadingIconColor,
    loadingIconStrokeWidth: loadingIconStrokeWidth ?? this.loadingIconStrokeWidth,
    iconPreffixColor: iconPreffixColor ?? this.iconPreffixColor,
    iconSuffixColor: iconSuffixColor ?? this.iconSuffixColor,
    splashColor: splashColor ?? this.splashColor,
  );
}