translate method

  1. @override
OffsetPoint translate(
  1. double translateX,
  2. double translateY
)
override

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

@override
OffsetPoint translate(double translateX, double translateY) {
  return OffsetPoint(
    dx: dx + translateX,
    dy: dy + translateY,
    timestamp: timestamp,
  );
}