copyWith method

FlexiChipStyle copyWith({
  1. double? height,
  2. EdgeInsetsGeometry? margin,
  3. EdgeInsetsGeometry? padding,
  4. Clip? clipBehavior,
  5. Color? overlayColor,
  6. Color? shadowColor,
  7. double? elevation,
  8. TextStyle? foregroundStyle,
  9. Color? foregroundColor,
  10. double? foregroundOpacity,
  11. int? foregroundAlpha,
  12. double? foregroundSpacing,
  13. Color? backgroundColor,
  14. double? backgroundOpacity,
  15. int? backgroundAlpha,
  16. Color? borderColor,
  17. double? borderOpacity,
  18. int? borderAlpha,
  19. double? borderWidth,
  20. BorderRadiusGeometry? borderRadius,
  21. BorderStyle? borderStyle,
  22. Size? avatarSize,
  23. TextStyle? avatarForegroundStyle,
  24. Color? avatarForegroundColor,
  25. Color? avatarBackgroundColor,
  26. BorderRadiusGeometry? avatarBorderRadius,
  27. Color? checkmarkColor,
  28. double? checkmarkSize,
  29. double? checkmarkWeight,
  30. FlexiChipCheckmarkStyle? checkmarkStyle,
  31. Color? iconColor,
  32. double? iconOpacity,
  33. double? iconSize,
  34. FlexiChipStyle? selectedStyle,
  35. FlexiChipStyle? disabledStyle,
  36. FlexiChipStyle? hoveredStyle,
  37. FlexiChipStyle? focusedStyle,
  38. FlexiChipStyle? pressedStyle,
})

Creates a copy of this FlexiChipStyle but with the given fields replaced with the new values.

Implementation

FlexiChipStyle copyWith({
  double? height,
  EdgeInsetsGeometry? margin,
  EdgeInsetsGeometry? padding,
  Clip? clipBehavior,
  Color? overlayColor,
  Color? shadowColor,
  double? elevation,
  TextStyle? foregroundStyle,
  Color? foregroundColor,
  double? foregroundOpacity,
  int? foregroundAlpha,
  double? foregroundSpacing,
  Color? backgroundColor,
  double? backgroundOpacity,
  int? backgroundAlpha,
  Color? borderColor,
  double? borderOpacity,
  int? borderAlpha,
  double? borderWidth,
  BorderRadiusGeometry? borderRadius,
  BorderStyle? borderStyle,
  Size? avatarSize,
  TextStyle? avatarForegroundStyle,
  Color? avatarForegroundColor,
  Color? avatarBackgroundColor,
  BorderRadiusGeometry? avatarBorderRadius,
  Color? checkmarkColor,
  double? checkmarkSize,
  double? checkmarkWeight,
  FlexiChipCheckmarkStyle? checkmarkStyle,
  Color? iconColor,
  double? iconOpacity,
  double? iconSize,
  FlexiChipStyle? selectedStyle,
  FlexiChipStyle? disabledStyle,
  FlexiChipStyle? hoveredStyle,
  FlexiChipStyle? focusedStyle,
  FlexiChipStyle? pressedStyle,
}) {
  final hasEvent = selectedStyle != null ||
      disabledStyle != null ||
      hoveredStyle != null ||
      focusedStyle != null ||
      pressedStyle != null;
  final style = FlexiChipStyle(
    height: height ?? this.height,
    margin: margin ?? this.margin,
    padding: padding ?? this.padding,
    clipBehavior: clipBehavior ?? this.clipBehavior,
    overlayColor: overlayColor ?? this.overlayColor,
    shadowColor: shadowColor ?? this.shadowColor,
    elevation: elevation ?? this.elevation,
    foregroundStyle: foregroundStyle ?? this.foregroundStyle,
    foregroundColor: foregroundColor ?? this.foregroundColor,
    foregroundOpacity: foregroundOpacity ?? this.foregroundOpacity,
    foregroundAlpha: foregroundAlpha ?? this.foregroundAlpha,
    foregroundSpacing: foregroundSpacing ?? this.foregroundSpacing,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    backgroundOpacity: backgroundOpacity ?? this.backgroundOpacity,
    backgroundAlpha: backgroundAlpha ?? this.backgroundAlpha,
    borderColor: borderColor ?? this.borderColor,
    borderOpacity: borderOpacity ?? this.borderOpacity,
    borderAlpha: borderAlpha ?? this.borderAlpha,
    borderWidth: borderWidth ?? this.borderWidth,
    borderRadius: borderRadius ?? this.borderRadius,
    borderStyle: borderStyle ?? this.borderStyle,
    avatarSize: avatarSize ?? this.avatarSize,
    avatarForegroundStyle:
        avatarForegroundStyle ?? this.avatarForegroundStyle,
    avatarForegroundColor:
        avatarForegroundColor ?? this.avatarForegroundColor,
    avatarBackgroundColor:
        avatarBackgroundColor ?? this.avatarBackgroundColor,
    avatarBorderRadius: avatarBorderRadius ?? this.avatarBorderRadius,
    checkmarkColor: checkmarkColor ?? this.checkmarkColor,
    checkmarkSize: checkmarkSize ?? this.checkmarkSize,
    checkmarkWeight: checkmarkWeight ?? this.checkmarkWeight,
    checkmarkStyle: checkmarkStyle ?? this.checkmarkStyle,
    iconColor: iconColor ?? this.iconColor,
    iconOpacity: iconOpacity ?? this.iconOpacity,
    iconSize: iconSize ?? this.iconSize,
  );
  return hasEvent
      ? FlexiChipStyle.when(
          enabled: style,
          selected: selectedStyle,
          disabled: disabledStyle,
          hovered: hoveredStyle,
          focused: focusedStyle,
          pressed: pressedStyle,
        )
      : style;
}