add method
Returns a box with its width or height increased by width
or height
(or decreased if the given width
or height
are negative, clamped to zero).
Implementation
Box add({
double? width,
double? height,
}) =>
copyWith(
width: width == null ? this.width : max(0, ((this.height ?? 0.0) + width)),
height: height == null ? this.height : max(0, ((this.height ?? 0.0) + height)),
);