I am creating a PDF document that has a large content. However, I am not able to show the PDF and I get the error
"This widget created more than 20 pages. This may be an issue in the widget or the document."
I know the text is too large but I don't know how to make it work
pdf.addPage(
pw.MultiPage(
pageFormat: PdfPageFormat.a4,
orientation: pw.PageOrientation.portrait,
crossAxisAlignment: pw.CrossAxisAlignment.start,
build: (pw.Context context) {
return <pw.Widget>[
pw.Wrap(
children: <pw.Widget>[
pw.Container(
width: PdfPageFormat.a4.width,
child: pw.Row(
mainAxisSize: pw.MainAxisSize.min,
crossAxisAlignment: pw.CrossAxisAlignment.start,
children: <pw.Widget>[
pw.Expanded(
child: pw.Column(
mainAxisSize: pw.MainAxisSize.min,
crossAxisAlignment: pw.CrossAxisAlignment.start,
children: <pw.Widget>[
pw.SizedBox(height: 8.0),
for (int i = 0; i < data['employers'].length; i++)
pw.Column(
mainAxisSize: pw.MainAxisSize.min,
crossAxisAlignment: pw.CrossAxisAlignment.start,
children: <pw.Widget>[
pw.Text(
"${data['employers'][i]['duties']}",
style: pw.TextStyle(
fontSize: 12.0,
),
softWrap: true,
),
],
),
],
),
),
],
),
),
],
),
];
},
),
);
I need some help on how to restructure my code so that I can display the PDF and have it wrap to the next page The text is just a a set of Lorem Ipsum .
Thanks for your help