PolygonShape constructor

PolygonShape({
  1. BorderSide side = BorderSide.none,
  2. double sides = 5,
  3. double pointRounding = 0,
  4. double rotation = 0,
  5. 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,
            ),
          );
        },
      );