downloadPdfBytes function
Trigger a file download in the browser.
Implementation
void downloadPdfBytes(Uint8List bytes, String filename) {
final blob = html.Blob([bytes], 'application/pdf');
final url = html.Url.createObjectUrlFromBlob(blob);
html.AnchorElement(href: url)
..setAttribute('download', filename)
..click();
html.Url.revokeObjectUrl(url);
}