translate method
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;
});
}