translate method

void translate(
  1. int dx,
  2. int dy
)

Translates all points in the list by dx and dy.

  • dx: The amount to translate in the x-direction.
  • dy: The amount to translate in the y-direction.

Implementation

void translate(int dx, int dy) {
  forEach((point) {
    point.x += dx;
    point.y += dy;
  });
}