From a9c542ac4ebe9799c655bd2cf502eefc00bdca8e Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 6 Jan 2025 09:08:52 +0800 Subject: [PATCH] fix: video title Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/detail/introduction/view.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 49a7462a5..a10a3e109 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -137,7 +137,8 @@ class _VideoInfoState extends State with TickerProviderStateMixin { late final _horizontalMemberPage = GStorage.horizontalMemberPage; - Widget get _buildVideoTitle => videoDetailCtr.enableSponsorBlock + Widget _buildVideoTitle([bool isExpand = false]) => videoDetailCtr + .enableSponsorBlock ? Obx( () => Text.rich( TextSpan( @@ -196,15 +197,15 @@ class _VideoInfoState extends State with TickerProviderStateMixin { text: '${videoDetail.title ?? videoItem['title'] ?? ''}'), ], ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + maxLines: isExpand ? null : 2, + overflow: isExpand ? null : TextOverflow.ellipsis, style: const TextStyle(fontSize: 16), ), ) : Text( '${videoDetail.title ?? videoItem['title'] ?? ''}', - maxLines: 2, - overflow: TextOverflow.ellipsis, + maxLines: isExpand ? null : 2, + overflow: isExpand ? null : TextOverflow.ellipsis, style: const TextStyle(fontSize: 16), ); @@ -526,7 +527,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { Utils.copyText( '${videoDetail.title ?? videoItem['title'] ?? ''}'); }, - child: _buildVideoTitle, + child: _buildVideoTitle(), ), expanded: GestureDetector( onLongPress: () { @@ -534,7 +535,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { Utils.copyText( '${videoDetail.title ?? videoItem['title'] ?? ''}'); }, - child: _buildVideoTitle, + child: _buildVideoTitle(true), ), theme: const ExpandableThemeData( animationDuration: Duration(milliseconds: 300),