merge method

  1. @override
ChipStyle merge(
  1. covariant ChipStyle? other
)
override

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

Implementation

@override
ChipStyle merge(covariant ChipStyle? other) {
  // if null return current object
  if (other == null) return this;

  var style = copyWith(
    variant: other.variant,
    severity: other.severity,
    height: other.height,
    margin: other.margin,
    padding: other.padding,
    clipBehavior: other.clipBehavior,
    overlayDisabled: other.overlayDisabled,
    overlayColor: other.overlayColor,
    shadowColor: other.shadowColor,
    surfaceTint: other.surfaceTint,
    elevation: other.elevation,
    foregroundStyle: other.foregroundStyle,
    foregroundColor: other.foregroundColor,
    foregroundOpacity: other.foregroundOpacity,
    foregroundAlpha: other.foregroundAlpha,
    foregroundSpacing: other.foregroundSpacing,
    foregroundLoosen: other.foregroundLoosen,
    foregroundExpanded: other.foregroundExpanded,
    foregroundAlign: other.foregroundAlign,
    foregroundJustify: other.foregroundJustify,
    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,
    avatarStyle: other.avatarStyle,
    checkmarkColor: other.checkmarkColor,
    checkmarkSize: other.checkmarkSize,
    checkmarkWeight: other.checkmarkWeight,
    checkmarkStyle: other.checkmarkStyle,
    iconColor: other.iconColor,
    iconOpacity: other.iconOpacity,
    iconSize: other.iconSize,
  );

  if (other is DrivenChipStyle) {
    style = style.copyWith(
      mergeResolved: other.mergeResolved,
      selectedStyle: other.selectedStyle,
      focusedStyle: other.focusedStyle,
      hoveredStyle: other.hoveredStyle,
      pressedStyle: other.pressedStyle,
      disabledStyle: other.disabledStyle,
    );
  }
  return style;
}