From 264e2c021e24fc4258ccaf9d159894997f05f7bb Mon Sep 17 00:00:00 2001 From: Pablo Guerra Date: Fri, 13 Oct 2023 17:20:48 -0400 Subject: [PATCH] Fixed File Downloading --- lib/screens/split_screen.dart | 48 +++++++++++++++++++---------------- pubspec.yaml | 2 +- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/lib/screens/split_screen.dart b/lib/screens/split_screen.dart index 918eb21..11df8f8 100644 --- a/lib/screens/split_screen.dart +++ b/lib/screens/split_screen.dart @@ -111,17 +111,19 @@ class SplitScreenState extends State }); case 2: showDialog( - context: context, - builder: (BuildContext context) => DownloadDialog( - onDownloadPdf: () async { - Navigator.pop(context); - await FileHandler().savePDF(pdfGenerator); - }, - onDownloadJson: () async { - Navigator.pop(context); - await FileHandler().savePDF(pdfGenerator); - }, - )); + context: context, + builder: (BuildContext context) => DownloadDialog( + onDownloadPdf: () async { + await FileHandler().savePDF(pdfGenerator); + }, + onDownloadJson: () { + FileHandler().saveJSONData( + pdfGenerator: pdfGenerator, + projectVersionInfoHandler: projectInfoHandler, + ); + }, + ), + ); case 3: Printing.layoutPdf( onLayout: (PdfPageFormat format) => @@ -463,17 +465,19 @@ class SplitScreenState extends State tooltip: Strings.downloadPdfAndJson, onPressed: () { showDialog( - context: context, - builder: (BuildContext context) => DownloadDialog( - onDownloadPdf: () async { - Navigator.pop(context); - await FileHandler().savePDF(pdfGenerator); - }, - onDownloadJson: () async { - Navigator.pop(context); - await FileHandler().savePDF(pdfGenerator); - }, - )); + context: context, + builder: (BuildContext context) => DownloadDialog( + onDownloadPdf: () async { + await FileHandler().savePDF(pdfGenerator); + }, + onDownloadJson: () { + FileHandler().saveJSONData( + pdfGenerator: pdfGenerator, + projectVersionInfoHandler: projectInfoHandler, + ); + }, + ), + ); }, ), ], diff --git a/pubspec.yaml b/pubspec.yaml index fee8a65..4b3ebeb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A resume builder app made with flutter. publish_to: "none" -version: 0.4.3+10 +version: 0.4.4+11 environment: sdk: ">=3.0.6 <4.0.0"