Ver Fonte

Request originFile while sharing

vishnukvmd há 3 anos atrás
pai
commit
56183c72d3
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      lib/utils/share_util.dart

+ 4 - 1
lib/utils/share_util.dart

@@ -22,7 +22,10 @@ Future<void> share(BuildContext context, List<File> files) async {
   await dialog.show();
   final List<Future<String>> pathFutures = [];
   for (File file in files) {
-    pathFutures.add(getFile(file).then((file) => file.path));
+    // Note: We are requesting the origin file for performance reasons on iOS.
+    // This will eat up storage, which will be reset only when the app restarts.
+    // We could have cleared the cache had there been a callback to the share API.
+    pathFutures.add(getFile(file, isOrigin: true).then((file) => file.path));
     if (file.fileType == FileType.livePhoto) {
       pathFutures.add(getFile(file, liveVideo: true).then((file) => file.path));
     }