From 95d926b29fe2ef499db85218fc3f98a55cb75868 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 29 Dec 2024 12:09:04 +0800 Subject: [PATCH] :sparkles: Bug fixes --- lib/widgets/attachment/attachment_item.dart | 4 +++- lib/widgets/post/post_item.dart | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/widgets/attachment/attachment_item.dart b/lib/widgets/attachment/attachment_item.dart index 0376024..becb400 100644 --- a/lib/widgets/attachment/attachment_item.dart +++ b/lib/widgets/attachment/attachment_item.dart @@ -324,7 +324,9 @@ class _AttachmentItemContentVideoState extends State<_AttachmentItemContentVideo MaterialDesktopCustomButton( iconSize: 24, onPressed: _toggleOriginal, - icon: _showOriginal ? const Icon(Symbols.high_quality, size: 24) : const Icon(Symbols.sd, size: 24), + icon: Builder(builder: (context) { + return _showOriginal ? const Icon(Symbols.high_quality, size: 24) : const Icon(Symbols.sd, size: 24); + }), ), ], ), diff --git a/lib/widgets/post/post_item.dart b/lib/widgets/post/post_item.dart index 9968e24..815cb0b 100644 --- a/lib/widgets/post/post_item.dart +++ b/lib/widgets/post/post_item.dart @@ -334,7 +334,6 @@ class PostShareImageWidget extends StatelessWidget { _PostQuoteContent( child: data.repostTo!, isRelativeDate: false, - isFlatted: true, ).padding(horizontal: 16, bottom: 8), if (data.type != 'article' && (data.preload?.attachments?.isNotEmpty ?? false)) AttachmentList( @@ -886,11 +885,9 @@ class _PostContentBody extends StatelessWidget { class _PostQuoteContent extends StatelessWidget { final SnPost child; final bool isRelativeDate; - final bool isFlatted; const _PostQuoteContent({ this.isRelativeDate = true, - this.isFlatted = false, required this.child, }); @@ -932,7 +929,9 @@ class _PostQuoteContent extends StatelessWidget { ), child: AttachmentList( data: child.preload!.attachments!, - gridded: isFlatted, + maxHeight: 360, + fit: BoxFit.contain, + gridded: true, listPadding: const EdgeInsets.symmetric(horizontal: 12), ), ).padding(