Polygon constructor

Polygon(
  1. List<Point<num>> vertices
)

Creates a Polygon from an ordered sequence of vertices.

Implementation

Polygon(this.vertices) {
  if (vertices.length < 3) {
    throw ArgumentError('A polygon must have at least 3 vertices.');
  }
}