ShapeOutline.regularPolygon constructor

ShapeOutline.regularPolygon({
  1. String valueKey = 'sides',
})

A regular polygon whose side count is the integer value valueKey, declared with sidesField. Its corners follow the style's radius.

Implementation

factory ShapeOutline.regularPolygon({String valueKey = 'sides'}) =>
    ShapeOutline.path(
      (size, values) => DiagramVectorPath.polyline(
        PolygonOutline.regularCorners(
          (values[valueKey]! as num).toInt(),
          size,
        ),
        closed: true,
      ),
      cornerRadius: true,
      valueKey: valueKey,
    );