PolygonPainter constructor

const PolygonPainter({
  1. required int sides,
  2. required double radius,
  3. required Color color,
  4. double? strokeWidth,
  5. Color? strokeColor,
  6. double rotation = 0.0,
})

Creates a polygon painter.

sides is the number of sides of the polygon (minimum 3). radius is the radius of the polygon in logical pixels. color is the fill color of the polygon. strokeWidth is the width of the polygon's border. If null, no border is drawn. strokeColor is the color of the polygon's border. rotation is the rotation angle in radians. Defaults to 0.

Implementation

const PolygonPainter({
  required this.sides,
  required this.radius,
  required this.color,
  this.strokeWidth,
  this.strokeColor,
  this.rotation = 0.0,
}) : assert(sides >= 3, 'Polygon must have at least 3 sides');