From 820c7aa324e486a8a1aa306d6b7d307c51703611 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sat, 28 Dec 2024 14:00:26 +0800 Subject: [PATCH] opt: staff widget Closes #61 Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/detail/introduction/view.dart | 131 +++++++++--------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index bc79c8ea..22381b60 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -350,74 +350,75 @@ class _VideoInfoState extends State with TickerProviderStateMixin { ), ) : SelfSizedHorizontalList( - gapSize: 10, + gapSize: 25, itemCount: videoItem['staff'].length, - childBuilder: (index) => Container( - width: 80, - alignment: Alignment.center, - child: GestureDetector( - onTap: () { - int? ownerMid = !widget.loadingStatus - ? widget.videoDetail?.owner?.mid - : videoItem['owner']?.mid; - if (videoItem['staff'][index].mid == - ownerMid && - context.orientation == - Orientation.landscape && - _horizontalMemberPage) { - widget.onShowMemberPage(ownerMid); - } else { - Get.toNamed( - '/member?mid=${videoItem['staff'][index].mid}', - // arguments: { - // 'face': - // videoItem['staff'][index].face, - // 'heroTag': Utils.makeHeroTag( - // videoItem['staff'][index].mid), - // }, - ); - } - }, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - NetworkImgLayer( - type: 'avatar', - src: videoItem['staff'][index].face, - width: 40, - height: 40, - fadeInDuration: Duration.zero, - fadeOutDuration: Duration.zero, - ), - const SizedBox(height: 2), - Text( - videoItem['staff'][index].name, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: videoItem['staff'][index] - .vip - .status > - 0 && - videoItem['staff'][index] - .vip - .type == - 2 - ? context.vipColor - : null, + childBuilder: (index) => GestureDetector( + onTap: () { + int? ownerMid = !widget.loadingStatus + ? widget.videoDetail?.owner?.mid + : videoItem['owner']?.mid; + if (videoItem['staff'][index].mid == ownerMid && + context.orientation == + Orientation.landscape && + _horizontalMemberPage) { + widget.onShowMemberPage(ownerMid); + } else { + Get.toNamed( + '/member?mid=${videoItem['staff'][index].mid}', + // arguments: { + // 'face': + // videoItem['staff'][index].face, + // 'heroTag': Utils.makeHeroTag( + // videoItem['staff'][index].mid), + // }, + ); + } + }, + child: Row( + children: [ + NetworkImgLayer( + type: 'avatar', + src: videoItem['staff'][index].face, + width: 40, + height: 40, + fadeInDuration: Duration.zero, + fadeOutDuration: Duration.zero, + ), + const SizedBox(width: 5), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + videoItem['staff'][index].name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: videoItem['staff'][index] + .vip + .status > + 0 && + videoItem['staff'][index] + .vip + .type == + 2 + ? context.vipColor + : null, + ), ), - ), - Text( - videoItem['staff'][index].title, - style: TextStyle( - fontSize: 12, - color: Theme.of(context) - .colorScheme - .outline, + Text( + videoItem['staff'][index].title, + style: TextStyle( + fontSize: 12, + color: Theme.of(context) + .colorScheme + .outline, + ), ), - ), - ], - ), + ], + ), + ], ), ), ),