expanded method

Rect expanded(
  1. Rect other
)

Creates the smallest rectangle that covers the edges of this and other.

Implementation

Rect expanded(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),
  );
}