translate method
override
Translate all vertices by x horizontally and y vertically.
Implementation
@override
Polygon translate({double x = 0, double y = 0}) {
final newVertices = vertices.map((p) => p.translate(x, y)).toList();
return Polygon(newVertices);
}