Welcome to the Flutter feedback portal. We’re happy you’re here! If you have feedback on how to improve the Flutter, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Dear Syncfusion Support Team,
I hope this email finds you well. I am writing to seek assistance regarding an issue I encountered while using the pdfGrid feature in my Flutter application.
I have integrated the pdfGrid functionality into my Flutter app using Syncfusion's Flutter package, and overall, it has been working smoothly. However, I have recently encountered an error that I am struggling to resolve.
The issue arises when the pdfGrid is populated with a large number of rows. Upon executing the code, I consistently encounter the following error message: "Null check operator used on a null value." This error seems to occur specifically when the pdfGrid contains a significant number of rows.
To provide some context, here is a simplified version of the code snippet I am using:
final PdfGrid grid = PdfGrid();
grid.columns.add(count: 4);
grid.columns[0].width = 50;
grid.columns[3].width = 50;
int headerIndex = 0;
for (int i = 0; i < 20; i++) {
final PdfGridRow headerRow =
grid.headers.add(1)[headerIndex];
headerIndex++;
headerRow.cells[0].columnSpan = 4;
headerRow.cells[0].value = 'Title $i';
for (int j = 0; j < 40; j++) {
headerRow.style.font = PdfStandardFont(
PdfFontFamily.helvetica, 14,
style: PdfFontStyle.bold);
PdfGridRow row =
grid.rows.add();
row.cells[0].value = '$j';
row.cells[1].value = 'Row $j';
row.cells[2].value = 'Row Value $j';
row.cells[3].value = '';
}
}
grid.style.cellPadding = PdfPaddings(left: 5, top: 5);
grid.draw(
page: pdfDoc.pages.add(),
format: PdfLayoutFormat(
breakType: PdfLayoutBreakType.fitPage,
layoutType:
PdfLayoutType.paginate,
));
I have thoroughly reviewed my code and cannot seem to identify the root cause of this error. It appears to be related to the size of the data being processed by the pdfGrid.
I would greatly appreciate any guidance or assistance you can provide in resolving this issue. If possible, could you please advise on any potential solutions or workarounds that I can implement to mitigate this error?
Thank you very much for your attention to this matter. I look forward to hearing from you soon.
Best regards,
Benyamin