PolygonShape constructor

PolygonShape({
  1. int numberOfSides = 5,
})

Creates a new PolygonShape with the specified number of sides.

The numberOfSides parameter must be at least 3. Defaults to 5 if not specified.

Throws an AssertionError if numberOfSides is less than 3.

Implementation

PolygonShape({this.numberOfSides = 5}) : assert(numberOfSides >= 3);