translate method

Offset translate (double translateX, double translateY)

Returns a new offset with translateX added to the x component and translateY added to the y component.

If the arguments come from another Offset, consider using the + or - operators instead:

Offset a = const Offset(10.0, 10.0);
Offset b = const Offset(10.0, 10.0);
Offset c = a + b; // same as: a.translate(b.dx, b.dy)
Offset d = a - b; // same as: a.translate(-b.dx, -b.dy)

Implementation

Offset translate(double translateX, double translateY) => new Offset(dx + translateX, dy + translateY);