merge method

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

Creates a WxBorderSide that represents the addition of the two given WxBorderSides.

It is only valid to call this if canMerge returns true for the two sides.

If one of the sides is zero-width with BorderStyle.none, then the other side is return as-is. If both of the sides are zero-width with BorderStyle.none, then WxBorderSide.none is returned.

The arguments must not be null.

Implementation

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

  return copyWith(
    style: other.style,
    color: other.color,
    gradient: other.gradient,
    width: other.width,
    offset: other.offset,
    size: other.size,
    alignment: other.alignment,
  );
}