From 083739e562a5ec3d40c4597d79103611f264796a Mon Sep 17 00:00:00 2001 From: guozhigq Date: Tue, 6 Feb 2024 11:13:33 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E6=94=B6=E8=97=8F=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fav_detail/widget/fav_video_card.dart | 55 +++++++++++-------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/lib/pages/fav_detail/widget/fav_video_card.dart b/lib/pages/fav_detail/widget/fav_video_card.dart index d988a0e1..a4f22f6b 100644 --- a/lib/pages/fav_detail/widget/fav_video_card.dart +++ b/lib/pages/fav_detail/widget/fav_video_card.dart @@ -9,6 +9,7 @@ import 'package:pilipala/models/common/search_type.dart'; import 'package:pilipala/utils/id_utils.dart'; import 'package:pilipala/utils/utils.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; +import '../../../common/widgets/badge.dart'; // 收藏视频卡片 - 水平布局 class FavVideoCardH extends StatelessWidget { @@ -86,22 +87,21 @@ class FavVideoCardH extends StatelessWidget { height: maxHeight, ), ), - Positioned( - right: 4, - bottom: 4, - child: Container( - padding: const EdgeInsets.symmetric( - vertical: 1, horizontal: 6), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - color: Colors.black54.withOpacity(0.4)), - child: Text( - Utils.timeFormat(videoItem.duration!), - style: const TextStyle( - fontSize: 11, color: Colors.white), - ), + PBadge( + text: Utils.timeFormat(videoItem.duration!), + right: 6.0, + bottom: 6.0, + type: 'gray', + ), + if (videoItem.ogv != null) ...[ + PBadge( + text: videoItem.ogv['type_name'], + top: 6.0, + right: 6.0, + bottom: null, + left: null, ), - ) + ], ], ); }, @@ -143,19 +143,30 @@ class VideoContent extends StatelessWidget { maxLines: 2, overflow: TextOverflow.ellipsis, ), + if (videoItem.ogv != null) ...[ + Text( + videoItem.intro, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, + ), + ), + ], const Spacer(), Text( - Utils.dateFormat(videoItem.ctime!), + Utils.dateFormat(videoItem.favTime), style: TextStyle( fontSize: 11, color: Theme.of(context).colorScheme.outline), ), - Text( - videoItem.owner.name, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, + if (videoItem.owner.name != '') ...[ + Text( + videoItem.owner.name, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, + ), ), - ), + ], Row( children: [ StatView(