CircleShape constructor

CircleShape({
  1. double startAngle = 0,
  2. double endAngle = 2 * pi,
})

CircleShape constructor.

Implementation

CircleShape({
  this.startAngle = 0,
  this.endAngle = 2 * pi,
}) : 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,
          );
          var path = Path()
            ..addArc(
              Rect.fromLTWH(
                usedOffset.dx,
                usedOffset.dy,
                usedSize.width,
                usedSize.height,
              ),
              startAngle,
              endAngle,
            );
          path.close();

          return path;
        },
      );