expandToInclude method

Rect expandToInclude(
  1. Rect other
)

Returns a new rectangle which is the bounding box containing this rectangle and the given rectangle.

Implementation

Rect expandToInclude(Rect other) {
  return Rect.fromLTRB(
      math.min(left, other.left),
      math.min(top, other.top),
      math.max(right, other.right),
      math.max(bottom, other.bottom),
  );
}