Compare commits
2 Commits
java_test
...
dont-send-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b25ffbe700 | ||
|
|
45731e7150 |
@@ -13,13 +13,11 @@ import "package:photos/generated/l10n.dart";
|
|||||||
import "package:photos/models/collection/collection.dart";
|
import "package:photos/models/collection/collection.dart";
|
||||||
import 'package:photos/models/file/file.dart';
|
import 'package:photos/models/file/file.dart';
|
||||||
import 'package:photos/models/file/file_type.dart';
|
import 'package:photos/models/file/file_type.dart';
|
||||||
import "package:photos/ui/sharing/show_images_prevew.dart";
|
|
||||||
import 'package:photos/utils/dialog_util.dart';
|
import 'package:photos/utils/dialog_util.dart';
|
||||||
import 'package:photos/utils/exif_util.dart';
|
import 'package:photos/utils/exif_util.dart';
|
||||||
import 'package:photos/utils/file_util.dart';
|
import 'package:photos/utils/file_util.dart';
|
||||||
import 'package:photos/utils/standalone/date_time.dart';
|
import 'package:photos/utils/standalone/date_time.dart';
|
||||||
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
|
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
|
||||||
import "package:screenshot/screenshot.dart";
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import "package:uuid/uuid.dart";
|
import "package:uuid/uuid.dart";
|
||||||
|
|
||||||
@@ -253,7 +251,6 @@ Future<void> shareAlbumLinkWithPlaceholder(
|
|||||||
String url,
|
String url,
|
||||||
GlobalKey key,
|
GlobalKey key,
|
||||||
) async {
|
) async {
|
||||||
final ScreenshotController screenshotController = ScreenshotController();
|
|
||||||
final List<EnteFile> filesInCollection =
|
final List<EnteFile> filesInCollection =
|
||||||
(await FilesDB.instance.getFilesInCollection(
|
(await FilesDB.instance.getFilesInCollection(
|
||||||
collection.id,
|
collection.id,
|
||||||
@@ -274,15 +271,9 @@ Future<void> shareAlbumLinkWithPlaceholder(
|
|||||||
await shareText(url);
|
await shareText(url);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
final placeholderBytes = await _createAlbumPlaceholder(
|
|
||||||
filesInCollection,
|
|
||||||
screenshotController,
|
|
||||||
context,
|
|
||||||
);
|
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
|
|
||||||
await shareImageAndUrl(
|
await shareText(
|
||||||
placeholderBytes,
|
|
||||||
url,
|
url,
|
||||||
context: context,
|
context: context,
|
||||||
key: key,
|
key: key,
|
||||||
@@ -303,21 +294,3 @@ Rect _sharePosOrigin(BuildContext? context, GlobalKey? key) {
|
|||||||
}
|
}
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Uint8List> _createAlbumPlaceholder(
|
|
||||||
List<EnteFile> files,
|
|
||||||
ScreenshotController screenshotController,
|
|
||||||
BuildContext context,
|
|
||||||
) async {
|
|
||||||
final Widget imageWidget = LinkPlaceholder(
|
|
||||||
files: files,
|
|
||||||
);
|
|
||||||
final double pixelRatio = MediaQuery.devicePixelRatioOf(context);
|
|
||||||
final bytesOfImageToWidget = await screenshotController.captureFromWidget(
|
|
||||||
imageWidget,
|
|
||||||
pixelRatio: pixelRatio,
|
|
||||||
targetSize: MediaQuery.sizeOf(context),
|
|
||||||
delay: const Duration(milliseconds: 300),
|
|
||||||
);
|
|
||||||
return bytesOfImageToWidget;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user