i'm programmin in a MacOs, and runnig my code in IOS emulator, when i save the path with ''getApplicationDocumentsDirectory();'' i choose to save the file, because it open an box asking what should do with it, but the file hads nothing, is not even .pdf, trying to get some help but can't found it so thats bring me here, i try with and without ''pdfdocument.dispose'', heres my code:
Future<void> pdfCreater() async {
PdfDocument pdfdocumento = PdfDocument();
final page = pdfdocumento.pages.add();
page.graphics.drawString('Impressão Matricular', PdfStandardFont(PdfFontFamily.helvetica, 35));
List<int> Bytes = await pdfdocumento.save();
pdfdocumento.dispose();
PdfSaver(Bytes, 'matricula_data');
}
Future<void> PdfSaver(List<int> Bytes, String FileName) async {
final path = await getDownloadPath(); // function for see directory if android or ios
final file = File('$path/$FileName');
await file.writeAsBytes(Bytes, flush: true);
OpenFile.open('$path/$FileName');
}