From 32461d90a6c93c8b804371b5bbca8df222ebdc6d Mon Sep 17 00:00:00 2001 From: orz12 Date: Sat, 25 May 2024 09:15:23 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E7=95=AA=E5=89=A7=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=E4=BB=A5=E5=8F=8A=E6=B2=A1=E6=9C=89=E9=95=BF?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E6=97=B6=E6=98=BE=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/bangumi/widgets/bangumi_panel.dart | 40 ++++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/lib/pages/bangumi/widgets/bangumi_panel.dart b/lib/pages/bangumi/widgets/bangumi_panel.dart index 6b09654c..de8e1354 100644 --- a/lib/pages/bangumi/widgets/bangumi_panel.dart +++ b/lib/pages/bangumi/widgets/bangumi_panel.dart @@ -184,10 +184,13 @@ class _BangumiPanelState extends State { ), const SizedBox(width: 6) ], - Text( - '第' + - (widget.pages[i].title ?? "${i + 1}") + - '话', + Expanded( + child: Text( + widget.pages[i].title ?? '第${i + 1}话', + maxLines: (widget.pages[i].longTitle != null && + widget.pages[i].longTitle != '') + ? 1 + : 2, style: TextStyle( fontSize: 13, color: i == currentIndex @@ -195,7 +198,7 @@ class _BangumiPanelState extends State { : Theme.of(context) .colorScheme .onSurface), - ), + )), const SizedBox(width: 2), if (widget.pages[i].badge != null) ...[ const Spacer(), @@ -219,17 +222,22 @@ class _BangumiPanelState extends State { ] ], ), - const SizedBox(height: 3), - Text( - widget.pages[i].longTitle!, - maxLines: 1, - style: TextStyle( - fontSize: 13, - color: i == currentIndex - ? Theme.of(context).colorScheme.primary - : Theme.of(context).colorScheme.onSurface), - overflow: TextOverflow.ellipsis, - ) + if (widget.pages[i].longTitle != null && + widget.pages[i].longTitle != '') ...[ + const SizedBox(height: 3), + Text( + widget.pages[i].longTitle!, + maxLines: 1, + style: TextStyle( + fontSize: 13, + color: i == currentIndex + ? Theme.of(context).colorScheme.primary + : Theme.of(context) + .colorScheme + .onSurface), + overflow: TextOverflow.ellipsis, + ) + ] ], ), ),