mirror of
https://github.com/immich-app/immich.git
synced 2025-12-24 01:11:32 +03:00
fix(mobile): native share functionality on iPad (#11294)
* pass context to share method * use correct context * fix: multiselection and logs sharing * fix: lint
This commit is contained in:
@@ -19,11 +19,11 @@ class ShareService {
|
||||
|
||||
ShareService(this._apiService);
|
||||
|
||||
Future<bool> shareAsset(Asset asset) async {
|
||||
return await shareAssets([asset]);
|
||||
Future<bool> shareAsset(Asset asset, BuildContext context) async {
|
||||
return await shareAssets([asset], context);
|
||||
}
|
||||
|
||||
Future<bool> shareAssets(List<Asset> assets) async {
|
||||
Future<bool> shareAssets(List<Asset> assets, BuildContext context) async {
|
||||
try {
|
||||
final downloadedXFiles = <XFile>[];
|
||||
|
||||
@@ -64,9 +64,10 @@ class ShareService {
|
||||
);
|
||||
}
|
||||
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
Share.shareXFiles(
|
||||
downloadedXFiles,
|
||||
sharePositionOrigin: Rect.zero,
|
||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user