copyWith method

  1. @override
AntdBoxStyle copyWith({
  1. EdgeInsets? padding,
  2. EdgeInsets? margin,
  3. double? opacity,
  4. Color? color,
  5. Border? border,
  6. BorderRadius? radius,
  7. TextStyle? textStyle,
  8. double? height,
  9. double? minHeight,
  10. double? width,
  11. double? minWidth,
  12. double? size,
  13. bool expand = false,
  14. bool shrink = false,
  15. List<AntdBoxLayoutMode>? layoutModes,
  16. double? backdropFilter,
  17. List<BoxShadow>? shadows,
  18. Gradient? gradient,
  19. Alignment? alignment,
  20. AntdVisibility? visibility,
  21. AntdHapticFeedback? hapticFeedback,
  22. AntdKitStyle? focusStyle,
  23. AntdKitStyle? disabledStyle,
  24. AntdKitStyle? feedbackStyle,
  25. ColorFilter? colorFilter,
  26. AntdTapOptions? options,
})
override

Implementation

@override
AntdBoxStyle copyWith(
    {final EdgeInsets? padding,
    final EdgeInsets? margin,
    final double? opacity,
    final Color? color,
    final Border? border,
    final BorderRadius? radius,
    final TextStyle? textStyle,
    final double? height,
    final double? minHeight,
    final double? width,
    final double? minWidth,
    final double? size,
    final bool expand = false,
    final bool shrink = false,
    final List<AntdBoxLayoutMode>? layoutModes,
    final double? backdropFilter,
    final List<BoxShadow>? shadows,
    final Gradient? gradient,
    final Alignment? alignment,
    final AntdVisibility? visibility,
    final AntdHapticFeedback? hapticFeedback,
    final AntdKitStyle? focusStyle,
    final AntdKitStyle? disabledStyle,
    final AntdKitStyle? feedbackStyle,
    final ColorFilter? colorFilter,
    final AntdTapOptions? options}) {
  if (!inherit) {
    return this;
  }
  TextStyle? mergeTextStyle;
  if (this.textStyle == null) {
    mergeTextStyle = textStyle;
  } else {
    mergeTextStyle = this.textStyle!.merge(textStyle);
  }

  return AntdBoxStyle(
    padding: padding ?? this.padding,
    margin: margin ?? this.margin,
    opacity: opacity ?? this.opacity,
    color: color ?? this.color,
    border: border ?? this.border,
    radius: radius ?? this.radius,
    textStyle: mergeTextStyle,
    height: height ?? this.height,
    minHeight: minHeight ?? this.minHeight,
    width: width ?? this.width,
    minWidth: minWidth ?? this.minWidth,
    size: size ?? this.size,
    layoutModes: layoutModes ?? this.layoutModes,
    backdropFilter: backdropFilter ?? this.backdropFilter,
    shadows: shadows ?? this.shadows,
    gradient: gradient ?? this.gradient,
    alignment: alignment ?? this.alignment,
    visibility: visibility ?? this.visibility,
    hapticFeedback: hapticFeedback ?? this.hapticFeedback,
    colorFilter: colorFilter ?? this.colorFilter,
    focusStyle: this.focusStyle.merge(focusStyle),
    feedbackStyle: this.feedbackStyle.merge(feedbackStyle),
    disabledStyle: this.disabledStyle.merge(disabledStyle),
    options: this.options == null ? options : this.options?.copyFrom(options),
  );
}