merge method

FlexiChipStyle merge(
  1. FlexiChipStyle? other
)

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

Implementation

FlexiChipStyle merge(FlexiChipStyle? other) {
  // if null return current object
  if (other == null) return this;

  return copyWith(
    height: other.height,
    margin: other.margin,
    padding: other.padding,
    clipBehavior: other.clipBehavior,
    overlayColor: other.overlayColor,
    shadowColor: other.shadowColor,
    elevation: other.elevation,
    foregroundStyle: other.foregroundStyle,
    foregroundColor: other.foregroundColor,
    foregroundOpacity: other.foregroundOpacity,
    foregroundAlpha: other.foregroundAlpha,
    foregroundSpacing: other.foregroundSpacing,
    backgroundColor: other.backgroundColor,
    backgroundOpacity: other.backgroundOpacity,
    backgroundAlpha: other.backgroundAlpha,
    borderColor: other.borderColor,
    borderOpacity: other.borderOpacity,
    borderAlpha: other.borderAlpha,
    borderWidth: other.borderWidth,
    borderRadius: other.borderRadius,
    borderStyle: other.borderStyle,
    avatarSize: other.avatarSize,
    avatarForegroundStyle: other.avatarForegroundStyle,
    avatarForegroundColor: other.avatarForegroundColor,
    avatarBackgroundColor: other.avatarBackgroundColor,
    avatarBorderRadius: other.avatarBorderRadius,
    checkmarkColor: other.checkmarkColor,
    checkmarkSize: other.checkmarkSize,
    checkmarkWeight: other.checkmarkWeight,
    checkmarkStyle: other.checkmarkStyle,
    iconColor: other.iconColor,
    iconOpacity: other.iconOpacity,
    iconSize: other.iconSize,
    selectedStyle: other is _DrivenFlexiChipStyle
        ? evaluate(other, {FlexiChipEvent.selected})
        : null,
    disabledStyle: other is _DrivenFlexiChipStyle
        ? evaluate(other, {FlexiChipEvent.disabled})
        : null,
    hoveredStyle: other is _DrivenFlexiChipStyle
        ? evaluate(other, {FlexiChipEvent.hovered})
        : null,
    focusedStyle: other is _DrivenFlexiChipStyle
        ? evaluate(other, {FlexiChipEvent.focused})
        : null,
    pressedStyle: other is _DrivenFlexiChipStyle
        ? evaluate(other, {FlexiChipEvent.pressed})
        : null,
  );
}