From 8d4bbc1a1cf2a1046e848ae9150207c9da090635 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Wed, 30 Apr 2025 09:51:35 +0800 Subject: [PATCH] opt: article blocked item Signed-off-by: bggRGjQaUbCoE --- lib/pages/article/widgets/opus_content.dart | 49 ++++++++++--------- lib/pages/dynamics/widgets/forward_panel.dart | 2 +- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/lib/pages/article/widgets/opus_content.dart b/lib/pages/article/widgets/opus_content.dart index 27e724ff..090d6161 100644 --- a/lib/pages/article/widgets/opus_content.dart +++ b/lib/pages/article/widgets/opus_content.dart @@ -356,30 +356,33 @@ Widget moduleBlockedItem( if (moduleBlocked.blockedType == 1) { maxWidth = maxWidth <= 255 ? maxWidth : min(400, maxWidth * 0.8); - return Container( - width: maxWidth, - height: maxWidth, - decoration: bgImg(), - padding: const EdgeInsets.all(12), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (moduleBlocked.icon != null) icon(max(40, maxWidth / 7)), - if (moduleBlocked.hintMessage != null) ...[ - const SizedBox(height: 5), - Text( - moduleBlocked.hintMessage!, - textAlign: TextAlign.center, - style: TextStyle(color: theme.colorScheme.outline), - ), + return UnconstrainedBox( + alignment: Alignment.centerLeft, + child: Container( + width: maxWidth, + height: maxWidth, + decoration: bgImg(), + padding: const EdgeInsets.all(12), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (moduleBlocked.icon != null) icon(max(40, maxWidth / 7)), + if (moduleBlocked.hintMessage != null) ...[ + const SizedBox(height: 5), + Text( + moduleBlocked.hintMessage!, + textAlign: TextAlign.center, + style: TextStyle(color: theme.colorScheme.outline), + ), + ], + if (moduleBlocked.button != null) ...[ + const SizedBox(height: 8), + btn( + visualDensity: const VisualDensity(vertical: -2.5), + ), + ], ], - if (moduleBlocked.button != null) ...[ - const SizedBox(height: 8), - btn( - visualDensity: const VisualDensity(vertical: -2.5), - ), - ], - ], + ), ), ); } diff --git a/lib/pages/dynamics/widgets/forward_panel.dart b/lib/pages/dynamics/widgets/forward_panel.dart index 8d7be41a..e2e91d27 100644 --- a/lib/pages/dynamics/widgets/forward_panel.dart +++ b/lib/pages/dynamics/widgets/forward_panel.dart @@ -264,7 +264,7 @@ Widget forWard( : item.modules.moduleDynamic?.major?.blocked != null ? _blockedItem( theme, item.modules.moduleDynamic!.major!.blocked!) - : const SizedBox(height: 0); + : const SizedBox.shrink(); case 'DYNAMIC_TYPE_PGC': return videoSeasonWidget(theme, source, item, context, 'pgc', floor: floor);