PolygonShape constructor
PolygonShape({
- BorderSide side = BorderSide.none,
- double sides = 5,
- double pointRounding = 0,
- double rotation = 0,
- double squash = 0,
PolygonShape constructor.
Implementation
PolygonShape({
this.side = BorderSide.none,
this.sides = 5,
this.pointRounding = 0,
this.rotation = 0,
this.squash = 0,
}) : super(
path: (size) {
var usedSize = size;
// if no offset is provided use the center of the widget.
var usedOffset = Offset(
(size.width - usedSize.width) / 2,
(size.height - usedSize.height) / 2,
);
return StarBorder.polygon(
side: side,
sides: sides,
pointRounding: pointRounding,
rotation: rotation,
squash: squash,
).getOuterPath(
Rect.fromLTWH(
usedOffset.dx,
usedOffset.dy,
usedSize.width,
usedSize.height,
),
);
},
);