resize method

Rect resize(
  1. Size size
)

Returns a new rect with the same origin but different size.

Implementation

Rect resize(Size size) => Rect(x, y, size.width, size.height);