Skip to content

Commit

Permalink
fix saving file on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
julien4215 committed Jun 5, 2024
1 parent d8d89a9 commit 6e90e22
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/ph/ui/pages/past_ph_selection_page/ph_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ class PhList extends HookConsumerWidget {
dataBuilder: (context, pdf) => PhCard(
ph: ph,
onDownload: () async {
await FileSaver.instance.saveFile(
final path = await FileSaver.instance.saveAs(
name: ph.name,
bytes: pdf.last,
ext: "pdf",
);
displayPhToastWithContext(
TypeMsg.msg,
PhTextConstants.succesDowloading,
);
mimeType: MimeType.pdf,
); // Not yet possible to save directly the file to Download folder
if (path != null) {
displayPhToastWithContext(
TypeMsg.msg,
PhTextConstants.succesDowloading,
);
}
},
),
);
Expand Down

0 comments on commit 6e90e22

Please sign in to comment.