π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Add download functionality to file popup menu and update download methods
AmanRajSinghMourya6956337bc67a
diff --git a/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart b/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dartindex c077635f6a..83f036b1d9 100644--- a/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart+++ b/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart@@ -8,6 +8,7 @@ import "package:locker/services/files/sync/models/file.dart";import "package:locker/ui/components/item_list_view.dart";import "package:locker/ui/components/popup_menu_item_widget.dart";import "package:locker/utils/file_actions.dart";+import "package:locker/utils/file_util.dart";class FilePopupMenuWidget extends StatelessWidget {final EnteFile file;@@ -89,6 +90,21 @@ class FilePopupMenuWidget extends StatelessWidget {isLast: false,),),+ PopupMenuItem<String>(+ value: 'download',+ padding: EdgeInsets.zero,+ height: 0,+ child: PopupMenuItemWidget(+ icon: HugeIcon(+ icon: HugeIcons.strokeRoundedDownload01,+ color: colorScheme.textBase,+ size: 20,+ ),+ label: "Download",+ isFirst: false,+ isLast: false,+ ),+ ),PopupMenuItem<String>(value: 'share_link',padding: EdgeInsets.zero,@@ -137,6 +153,9 @@ class FilePopupMenuWidget extends StatelessWidget {case 'edit':_editFile(context);break;+ case 'download':+ _downloadFile(context);+ break;case 'share_link':_shareFileLink(context);break;@@ -150,6 +169,10 @@ class FilePopupMenuWidget extends StatelessWidget {await FileActions.shareFileLink(context, file);}+ Future<void> _downloadFile(BuildContext context) async {+ await FileUtil.downloadFile(context, file);+ }+Future<void> _deleteFile(BuildContext context) async {await FileActions.deleteFile(context,diff --git a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dartindex e735e45dae..62e03ab90a 100644--- a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart+++ b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart@@ -408,7 +408,7 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {List<EnteFile> files,) async {try {- final success = await FileUtil.downloadFilesToDownloads(context, files);+ final success = await FileUtil.downloadFiles(context, files);if (success) {widget.selectedFiles.clearAll();}@@ -629,7 +629,7 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {Future<void> _downloadFile(BuildContext context, EnteFile file) async {try {- final success = await FileUtil.downloadFilesToDownloads(context, [file]);+ final success = await FileUtil.downloadFile(context, file);if (success) {widget.selectedFiles.clearAll();}