fix: video title

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-06 09:08:52 +08:00
parent 4aebc0aac5
commit a9c542ac4e

View File

@@ -137,7 +137,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
late final _horizontalMemberPage = GStorage.horizontalMemberPage; late final _horizontalMemberPage = GStorage.horizontalMemberPage;
Widget get _buildVideoTitle => videoDetailCtr.enableSponsorBlock Widget _buildVideoTitle([bool isExpand = false]) => videoDetailCtr
.enableSponsorBlock
? Obx( ? Obx(
() => Text.rich( () => Text.rich(
TextSpan( TextSpan(
@@ -196,15 +197,15 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
text: '${videoDetail.title ?? videoItem['title'] ?? ''}'), text: '${videoDetail.title ?? videoItem['title'] ?? ''}'),
], ],
), ),
maxLines: 2, maxLines: isExpand ? null : 2,
overflow: TextOverflow.ellipsis, overflow: isExpand ? null : TextOverflow.ellipsis,
style: const TextStyle(fontSize: 16), style: const TextStyle(fontSize: 16),
), ),
) )
: Text( : Text(
'${videoDetail.title ?? videoItem['title'] ?? ''}', '${videoDetail.title ?? videoItem['title'] ?? ''}',
maxLines: 2, maxLines: isExpand ? null : 2,
overflow: TextOverflow.ellipsis, overflow: isExpand ? null : TextOverflow.ellipsis,
style: const TextStyle(fontSize: 16), style: const TextStyle(fontSize: 16),
); );
@@ -526,7 +527,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
Utils.copyText( Utils.copyText(
'${videoDetail.title ?? videoItem['title'] ?? ''}'); '${videoDetail.title ?? videoItem['title'] ?? ''}');
}, },
child: _buildVideoTitle, child: _buildVideoTitle(),
), ),
expanded: GestureDetector( expanded: GestureDetector(
onLongPress: () { onLongPress: () {
@@ -534,7 +535,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
Utils.copyText( Utils.copyText(
'${videoDetail.title ?? videoItem['title'] ?? ''}'); '${videoDetail.title ?? videoItem['title'] ?? ''}');
}, },
child: _buildVideoTitle, child: _buildVideoTitle(true),
), ),
theme: const ExpandableThemeData( theme: const ExpandableThemeData(
animationDuration: Duration(milliseconds: 300), animationDuration: Duration(milliseconds: 300),