translate method

  1. @override
Polygon translate({
  1. double x = 0,
  2. double y = 0,
})
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);
}