isClosedPolygon static method
Returns true if poly is a closed polygon (i.e., the first and last
points are the same).
Implementation
static bool isClosedPolygon(List<Point<double>> poly) {
if (poly.isEmpty) return false;
final firstPoint = poly[0];
final lastPoint = poly[poly.length - 1];
return firstPoint == lastPoint;
}