Open codingiswhyicry opened 10 months ago
use a async function in initstate and put your photo into a variable before create your pdf. final example = (await rootBundle.load('assets/orta.jpeg')).buffer.asUint8List();
Thank you for your ideas! I've already done those things within the context of the view. The view and PDF logic are separate pieces of code, and I only shared the PDF logic because it's the only place the actual bug is. The PDF gets objects with the Unit8List, so the variables are there.
Describe the bug When attempting to take a UIntList8 and convert it to an image, my PDF fails to convert. I've narrowed down the bug and ensured a. The image being used is not corrupted and contains data, b. the PDF generation only fails on one line. I'm not sure if this is a bug overall, or if I am missing something.
This is being run on Flutter web only, and the images are user-generated earlier in the application. These complicate the ways that you can turn an image into a PDF, so I won't be able to use await rootBundle or other File / dart.io based workarounds.
To Reproduce Code snippet to reproduce the behavior:
Expected behavior
I expected the pdf to contain images from the item. Instead, it either does not finish at all or does not include the grades with images required.
Flutter Doctor
Desktop (please complete the following information):
Additional context