From 391d862b17bfbbb1eee25b91fdf6767806e13a10 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sun, 18 May 2025 11:35:33 +0800 Subject: [PATCH] opt member info Signed-off-by: bggRGjQaUbCoE --- .../video_card/video_card_h_member_video.dart | 18 +++-- lib/pages/member/widget/user_info_card.dart | 69 ++++++++++--------- lib/pages/member_opus/view.dart | 12 ++-- lib/pages/video/introduction/ugc/view.dart | 5 +- 4 files changed, 53 insertions(+), 51 deletions(-) diff --git a/lib/common/widgets/video_card/video_card_h_member_video.dart b/lib/common/widgets/video_card/video_card_h_member_video.dart index 3ea65f45..beb9d910 100644 --- a/lib/common/widgets/video_card/video_card_h_member_video.dart +++ b/lib/common/widgets/video_card/video_card_h_member_video.dart @@ -28,6 +28,7 @@ class VideoCardHMemberVideo extends StatelessWidget { @override Widget build(BuildContext context) { + final theme = Theme.of(context); return Stack( clipBehavior: Clip.none, children: [ @@ -99,7 +100,7 @@ class VideoCardHMemberVideo extends StatelessWidget { style: TextStyle( color: Colors.white, fontSize: 15, - letterSpacing: 1.5, + letterSpacing: 5, ), ), ), @@ -166,7 +167,7 @@ class VideoCardHMemberVideo extends StatelessWidget { ), ), const SizedBox(width: 10), - videoContent(context), + videoContent(context, theme), ], ); }, @@ -186,8 +187,9 @@ class VideoCardHMemberVideo extends StatelessWidget { ); } - Widget videoContent(context) { - final theme = Theme.of(context); + Widget videoContent(BuildContext context, ThemeData theme) { + final isCurr = fromViewAid == videoItem.param || + (videoItem.bvid != null && videoItem.bvid == bvid); return Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -197,15 +199,11 @@ class VideoCardHMemberVideo extends StatelessWidget { videoItem.title, textAlign: TextAlign.start, style: TextStyle( - fontWeight: videoItem.bvid != null && videoItem.bvid == bvid - ? FontWeight.bold - : null, + fontWeight: isCurr ? FontWeight.bold : null, fontSize: theme.textTheme.bodyMedium!.fontSize, height: 1.42, letterSpacing: 0.3, - color: videoItem.bvid != null && videoItem.bvid == bvid - ? theme.colorScheme.primary - : null, + color: isCurr ? theme.colorScheme.primary : null, ), maxLines: 2, overflow: TextOverflow.ellipsis, diff --git a/lib/pages/member/widget/user_info_card.dart b/lib/pages/member/widget/user_info_card.dart index dfc59cee..d7037f37 100644 --- a/lib/pages/member/widget/user_info_card.dart +++ b/lib/pages/member/widget/user_info_card.dart @@ -5,7 +5,7 @@ import 'package:PiliPlus/models/space/card.dart'; import 'package:PiliPlus/models/space/images.dart'; import 'package:PiliPlus/utils/extension.dart'; import 'package:PiliPlus/utils/page_utils.dart'; -import 'package:PiliPlus/utils/storage.dart'; +import 'package:PiliPlus/utils/storage.dart' show Accounts; import 'package:PiliPlus/utils/utils.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -59,8 +59,8 @@ class UserInfoCard extends StatelessWidget { Text( title, style: TextStyle( - height: 1, - fontSize: 11, + height: 1.2, + fontSize: 12, color: theme.colorScheme.outline, ), ), @@ -108,7 +108,7 @@ class UserInfoCard extends StatelessWidget { List _buildLeft(BuildContext context, ThemeData theme) => [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), + padding: const EdgeInsets.only(left: 20, right: 20, top: 5), child: Wrap( spacing: 8, runSpacing: 8, @@ -302,7 +302,6 @@ class UserInfoCard extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, children: List.generate( 5, (index) => index % 2 == 0 @@ -323,10 +322,12 @@ class UserInfoCard extends StatelessWidget { } }, ) - : const SizedBox( - height: 15, - width: 1, - child: VerticalDivider(), + : const Expanded( + child: SizedBox( + height: 15, + width: 1, + child: VerticalDivider(), + ), ), ), ), @@ -334,11 +335,10 @@ class UserInfoCard extends StatelessWidget { Row( mainAxisSize: MainAxisSize.min, children: [ - const SizedBox(width: 20), if (!isOwner) ...[ IconButton.outlined( onPressed: () { - if (GStorage.userInfo.get('userInfoCache') != null) { + if (Accounts.main.isLogin) { int mid = int.parse(card.mid!); Get.toNamed( '/whisperDetail', @@ -355,7 +355,7 @@ class UserInfoCard extends StatelessWidget { style: IconButton.styleFrom( side: BorderSide( width: 1.0, - color: theme.colorScheme.outline.withValues(alpha: 0.5), + color: theme.colorScheme.outline.withValues(alpha: 0.3), ), padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -371,7 +371,7 @@ class UserInfoCard extends StatelessWidget { backgroundColor: relation != 0 ? theme.colorScheme.onInverseSurface : null, - visualDensity: VisualDensity.compact, + visualDensity: const VisualDensity(vertical: -1.8), ), child: Text.rich( style: TextStyle( @@ -379,7 +379,7 @@ class UserInfoCard extends StatelessWidget { ), TextSpan( children: [ - if (relation != 0 && relation != 128) + if (relation != 0 && relation != 128) ...[ WidgetSpan( alignment: PlaceholderAlignment.top, child: Icon( @@ -388,25 +388,27 @@ class UserInfoCard extends StatelessWidget { color: theme.colorScheme.outline, ), ), + const TextSpan(text: ' '), + ], TextSpan( - text: isOwner - ? '编辑资料' - : switch (relation) { - 0 => '关注', - 1 => '悄悄关注', - 2 => '已关注', - // 3 => '回关', - 4 || 6 => '已互关', - 128 => '移除黑名单', - -10 => '特别关注', // 该状态码并不是官方状态码 - _ => relation.toString(), - }), + text: isOwner + ? '编辑资料' + : switch (relation) { + 0 => '关注', + 1 => '悄悄关注', + 2 => '已关注', + // 3 => '回关', + 4 || 6 => '已互关', + 128 => '移除黑名单', + -10 => '特别关注', // 该状态码并不是官方状态码 + _ => relation.toString(), + }, + ), ], ), ), ), ), - const SizedBox(width: 20), ], ), ], @@ -440,7 +442,7 @@ class UserInfoCard extends StatelessWidget { _buildHeader(context, theme), SizedBox( width: double.infinity, - height: MediaQuery.textScalerOf(context).scale(30) + 55, + height: MediaQuery.textScalerOf(context).scale(30) + 60, ) ], ), @@ -450,9 +452,9 @@ class UserInfoCard extends StatelessWidget { child: _buildAvatar(context), ), Positioned( - left: 140, + left: 160, top: 140, - right: 20, + right: 15, bottom: 0, child: _buildRight(context, theme), ), @@ -544,6 +546,7 @@ class UserInfoCard extends StatelessWidget { ), const SizedBox(width: 10), Expanded( + flex: 5, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -554,7 +557,11 @@ class UserInfoCard extends StatelessWidget { ], ), ), - Expanded(child: _buildRight(context, theme)), + Expanded( + flex: 3, + child: _buildRight(context, theme), + ), + const SizedBox(width: 20), ], ), ), diff --git a/lib/pages/member_opus/view.dart b/lib/pages/member_opus/view.dart index c9945e3d..8df61e0c 100644 --- a/lib/pages/member_opus/view.dart +++ b/lib/pages/member_opus/view.dart @@ -102,14 +102,10 @@ class _MemberOpusState extends State }, ); }, - label: Row( - children: [ - const Icon(size: 20, Icons.sort), - Obx( - () => Text(_controller.type.value.text ?? - _controller.type.value.tabName!), - ), - ], + icon: const Icon(size: 20, Icons.sort), + label: Obx( + () => Text(_controller.type.value.text ?? + _controller.type.value.tabName!), ), ), ), diff --git a/lib/pages/video/introduction/ugc/view.dart b/lib/pages/video/introduction/ugc/view.dart index 67ca173e..85bd7cdc 100644 --- a/lib/pages/video/introduction/ugc/view.dart +++ b/lib/pages/video/introduction/ugc/view.dart @@ -816,7 +816,8 @@ class _VideoInfoState extends State { return TextButton( onPressed: () => videoIntroController.actionRelationMod(context), style: TextButton.styleFrom( - visualDensity: const VisualDensity(vertical: -3), + padding: const EdgeInsets.symmetric(horizontal: 18), + visualDensity: const VisualDensity(vertical: -2.8), foregroundColor: attr != 0 ? t.colorScheme.outline : t.colorScheme.onSecondaryContainer, @@ -833,7 +834,7 @@ class _VideoInfoState extends State { -10 => '特别关注', _ => '关注' }, - style: TextStyle(fontSize: t.textTheme.labelMedium!.fontSize), + style: const TextStyle(fontSize: 13), ), ); },