I am currently working with the syncfusion_flutter_pdf
package to create a PDF document in Flutter. I can draw a simple rectangle using page.graphics.drawRectangle
, but I want the rectangle to have rounded corners.
Here is my current code for drawing a regular rectangle:
Here is my current script
createBoxRounded(PdfPage page) {
final Size pageSize =
Size(page.getClientSize().width, page.getClientSize().height);
//draw box 300x300 and rounded 20 // background white
PdfRectangleAnnotation(const Rect.fromLTWH(0, 0, 150, 150), 'Rectangle',
color: PdfColor(255, 0, 0), setAppearance: true);
page.graphics.drawRectangle(
bounds: Rect.fromCenter(
center: Offset(pageSize.width / 2, pageSize.height / 2.5),
width: 300,
height: 300),
pen: PdfPen(
PdfColor(232, 233, 235),
width: 5,
dashStyle: PdfDashStyle.custom,
),
brush: PdfSolidBrush(
PdfColor(255, 255, 255),
),
);
return page;
}
How can I modify this code to make the rectangle’s corners rounded?
0