expandToInclude method
Expands this rectangle to include the bounds of another rectangle.
Returns a new rectangle that encompasses both this rectangle
and the childBounds
rectangle.
Implementation
LayoutRect expandToInclude(LayoutRect childBounds) {
return LayoutRect.fromLTRB(
min(left, childBounds.left),
min(top, childBounds.top),
max(right, childBounds.right),
max(bottom, childBounds.bottom),
);
}