From c8e131c1abc3a7e1392ad140ca310653bdc4a889 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 14 Oct 2024 00:37:42 +0800 Subject: [PATCH] :bug: Fix share image size issue --- lib/widgets/posts/post_action.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/posts/post_action.dart b/lib/widgets/posts/post_action.dart index 6899cc5..ad3e545 100644 --- a/lib/widgets/posts/post_action.dart +++ b/lib/widgets/posts/post_action.dart @@ -92,7 +92,7 @@ class _PostActionState extends State { final List attachments = widget.item.body['attachments'] is List ? List.from(widget.item.body['attachments']?.whereType()) : List.empty(); - final hasAttachment = attachments.isNotEmpty; + final hasMultipleAttachment = attachments.length > 1; final screenshot = ScreenshotController(); final image = await screenshot.captureFromLongWidget( @@ -104,7 +104,7 @@ class _PostActionState extends State { pixelRatio: 2, constraints: BoxConstraints( minWidth: 480, - maxWidth: hasAttachment ? 480 : 640, + maxWidth: hasMultipleAttachment ? 480 : 640, minHeight: 640, maxHeight: double.infinity, ),