Skip to content

High performance self-hosted photo and video management solution.

chore(mobile): Update share_file to latest version and migrate to using cross platform shareXFile (#1476)

martyfuhryf23979024a72
diff --git a/mobile/lib/shared/services/share.service.dart b/mobile/lib/shared/services/share.service.dart
index c0e61c9d9d..ebf1d9f0fd 100644
--- a/mobile/lib/shared/services/share.service.dart
+++ b/mobile/lib/shared/services/share.service.dart
@@ -22,7 +22,7 @@ class ShareService {
}
Future<void> shareAssets(List<Asset> assets) async {
- final downloadedFilePaths = assets.map((asset) async {
+ final downloadedXFiles = assets.map<Future<XFile>>((asset) async {
if (asset.isRemote) {
final tempDir = await getTemporaryDirectory();
final fileName = basename(asset.remote!.originalPath);
@@ -33,16 +33,16 @@ class ShareService {
isWeb: false,
);
tempFile.writeAsBytesSync(res.bodyBytes);
- return tempFile.path;
+ return XFile(tempFile.path);
} else {
File? f = await asset.local!.file;
- return f!.path;
+ return XFile(f!.path);
}
});
// ignore: deprecated_member_use
- Share.shareFiles(
- await Future.wait(downloadedFilePaths),
+ Share.shareXFiles(
+ await Future.wait(downloadedXFiles),
sharePositionOrigin: Rect.zero,
);
}
diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock
index 4aa83e7981..6ec5b7b3dc 100644
--- a/mobile/pubspec.lock
+++ b/mobile/pubspec.lock
@@ -210,7 +210,7 @@ packages:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
- version: "0.3.3+1"
+ version: "0.3.3+2"
crypto:
dependency: transitive
description:
@@ -868,42 +868,14 @@ packages:
name: share_plus
url: "https://pub.dartlang.org"
source: hosted
- version: "4.0.10"
- share_plus_linux:
- dependency: transitive
- description:
- name: share_plus_linux
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.0.0"
- share_plus_macos:
- dependency: transitive
- description:
- name: share_plus_macos
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.0.1"
+ version: "6.3.0"
share_plus_platform_interface:
dependency: transitive
description:
name: share_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
- version: "3.0.3"
- share_plus_web:
- dependency: transitive
- description:
- name: share_plus_web
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.0.1"
- share_plus_windows:
- dependency: transitive
- description:
- name: share_plus_windows
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.0.1"
+ version: "3.2.0"
shared_preferences:
dependency: transitive
description:
@@ -1174,14 +1146,14 @@ packages:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.5"
+ version: "2.1.1"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.11"
+ version: "2.0.14"
url_launcher_windows:
dependency: transitive
description:
@@ -1279,7 +1251,7 @@ packages:
name: wakelock_windows
url: "https://pub.dartlang.org"
source: hosted
- version: "0.2.0"
+ version: "0.2.1"
watcher:
dependency: transitive
description:
@@ -1307,7 +1279,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
- version: "2.7.0"
+ version: "3.1.3"
wkt_parser:
dependency: transitive
description:
diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml
index 0b6fdc8251..4dec20d1d4 100644
--- a/mobile/pubspec.yaml
+++ b/mobile/pubspec.yaml
@@ -32,7 +32,7 @@ dependencies:
http: 0.13.4
cancellation_token_http: ^1.1.0
easy_localization: ^3.0.1
- share_plus: ^4.0.10
+ share_plus: ^6.3.0
flutter_displaymode: ^0.4.0
scrollable_positioned_list: ^0.3.4
path: ^1.8.1