merge method

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

Merges this object with other, returning a new object of type T.

Implementation

@override
BoxSpecAttribute merge(BoxSpecAttribute? other) {
  if (other == null) return this;

  return BoxSpecAttribute(
    alignment: other.alignment ?? alignment,
    padding: padding?.merge(other.padding) ?? other.padding,
    margin: margin?.merge(other.margin) ?? other.margin,
    constraints: constraints?.merge(other.constraints) ?? other.constraints,
    decoration: decoration?.merge(other.decoration) ?? other.decoration,
    foregroundDecoration:
        foregroundDecoration?.merge(other.foregroundDecoration) ??
            other.foregroundDecoration,
    transform: other.transform ?? transform,
    transformAlignment: other.transformAlignment ?? transformAlignment,
    clipBehavior: other.clipBehavior ?? clipBehavior,
    width: other.width ?? width,
    height: other.height ?? height,
    animated: animated?.merge(other.animated) ?? other.animated,
  );
}