From 7eb52854465e21dc8ae1abb97ac594f2eb01f59e Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Fri, 7 Mar 2025 06:20:04 +0530 Subject: [PATCH] Disable save in downloads for mobile --- lib/utils/save_utils.dart | 1 + lib/widgets/codegen_previewer.dart | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/utils/save_utils.dart b/lib/utils/save_utils.dart index fef15c31..7bd31903 100644 --- a/lib/utils/save_utils.dart +++ b/lib/utils/save_utils.dart @@ -40,6 +40,7 @@ Future saveToDownloads( var sp = getShortPath(path); message = 'Saved to $sp'; } catch (e) { + debugPrint("$e"); message = "An error occurred while saving file."; } } else { diff --git a/lib/widgets/codegen_previewer.dart b/lib/widgets/codegen_previewer.dart index 89e1c899..ef8176f9 100644 --- a/lib/widgets/codegen_previewer.dart +++ b/lib/widgets/codegen_previewer.dart @@ -154,10 +154,14 @@ class ViewCodePane extends StatelessWidget { showLabel: showLabel, ), ), - SaveInDownloadsButton( - content: stringToBytes(code), - ext: codegenLanguage.ext, - showLabel: showLabel, + // TODO: Save to Downloads folder does not work in Mobile + Visibility( + visible: !kIsMobile, + child: SaveInDownloadsButton( + content: stringToBytes(code), + ext: codegenLanguage.ext, + showLabel: showLabel, + ), ), ], ),