translate method

Rect translate (double translateX, double translateY)

Returns a new rectangle with translateX added to the x components and translateY added to the y components.

To translate a rectangle by an Offset rather than by separate x and y components, consider shift.


Rect translate(double translateX, double translateY) {
  return Rect.fromLTRB(left + translateX, top + translateY, right + translateX, bottom + translateY);