isClosedPolygon static method
Returns true if the provided list of points is a closed polygon (i.e., the first and last points are the same), and false if it is not
poly polyline or polygon
Returns true if the provided list of points is a closed polygon (i.e., the first and last points are the same), and false if it is not
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;
}