add method
- @override
override
Attempts to create a new object that represents the amalgamation of this
border and the other
border.
If the type of the other border isn't known, or the given instance cannot be reasonably added to this instance, then this should return null.
This method is used by the operator + implementation.
The reversed
argument is true if this object was the right operand of
the +
operator, and false if it was the left operand.
Implementation
@override
Border add(ShapeBorder other, { bool reversed = false }) {
if (other is! Border)
return null;
final Border typedOther = other;
if (BorderSide.canMerge(top, typedOther.top) &&
BorderSide.canMerge(right, typedOther.right) &&
BorderSide.canMerge(bottom, typedOther.bottom) &&
BorderSide.canMerge(left, typedOther.left)) {
return Border.merge(this, typedOther);
}
return null;
}