From d8c23a3d8c5a82c05a01fc1deb953588d04eab11 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Tue, 14 Jan 2025 20:11:02 +0800 Subject: [PATCH] opt: member page Signed-off-by: bggRGjQaUbCoE --- .../content/video/member_video.dart | 23 ++-- .../member/new/widget/user_info_card.dart | 108 +++++++++--------- 2 files changed, 68 insertions(+), 63 deletions(-) diff --git a/lib/pages/member/new/content/member_contribute/content/video/member_video.dart b/lib/pages/member/new/content/member_contribute/content/video/member_video.dart index b0fd6ee8..280244e4 100644 --- a/lib/pages/member/new/content/member_contribute/content/video/member_video.dart +++ b/lib/pages/member/new/content/member_contribute/content/video/member_video.dart @@ -74,24 +74,30 @@ class _MemberVideoState extends State delegate: CustomSliverPersistentHeaderDelegate( extent: 40, bgColor: Theme.of(context).colorScheme.surface, - child: Container( + child: SizedBox( height: 40, - padding: const EdgeInsets.fromLTRB(12, 0, 6, 0), child: Row( children: [ + const SizedBox(width: 8), Obx( - () => Text( - _controller.count.value != -1 - ? '共${_controller.count.value}视频' - : '', - style: const TextStyle(fontSize: 13), + () => Padding( + padding: const EdgeInsets.only(left: 6), + child: Text( + _controller.count.value != -1 + ? '共${_controller.count.value}视频' + : '', + style: const TextStyle(fontSize: 13), + ), ), ), Obx( () => _controller.episodicButton.value.uri != null ? Container( height: 35, - padding: const EdgeInsets.only(left: 5), + padding: EdgeInsets.only( + left: _controller.count.value != -1 + ? 6 + : 0), child: TextButton.icon( onPressed: _controller.toViewPlayAll, icon: Icon( @@ -146,6 +152,7 @@ class _MemberVideoState extends State ), ), ), + const SizedBox(width: 8), ], ), ), diff --git a/lib/pages/member/new/widget/user_info_card.dart b/lib/pages/member/new/widget/user_info_card.dart index 897e7059..70905590 100644 --- a/lib/pages/member/new/widget/user_info_card.dart +++ b/lib/pages/member/new/widget/user_info_card.dart @@ -176,48 +176,47 @@ class UserInfoCard extends StatelessWidget { ), ), if (card.officialVerify?.desc?.isNotEmpty == true) - Padding( - padding: const EdgeInsets.only(left: 20, top: 8, right: 20), - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Theme.of(context).colorScheme.onInverseSurface), - child: Text.rich( - TextSpan( - children: [ - if (card.officialVerify?.icon?.isNotEmpty == true) ...[ - WidgetSpan( - child: Container( - padding: const EdgeInsets.all(0.1), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).colorScheme.surface, - ), - child: CachedNetworkImage( - width: 18, - height: 18, - imageUrl: card.officialVerify!.icon!.http2https, - ), + Container( + margin: const EdgeInsets.only(left: 20, top: 8, right: 20), + padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Theme.of(context).colorScheme.onInverseSurface, + ), + child: Text.rich( + TextSpan( + children: [ + if (card.officialVerify?.icon?.isNotEmpty == true) ...[ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: DecoratedBox( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).colorScheme.surface, + ), + child: CachedNetworkImage( + width: 18, + height: 18, + imageUrl: card.officialVerify!.icon!.http2https, ), ), - TextSpan( - text: ' ', - ) - ], + ), TextSpan( - text: card.officialVerify!.spliceTitle!, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.bold, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.7), - ), + text: ' ', ) ], - ), + TextSpan( + text: card.officialVerify!.spliceTitle!, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.7), + ), + ) + ], ), ), ), @@ -425,25 +424,24 @@ class UserInfoCard extends StatelessWidget { ], ); - _buildBadge(BuildContext context) => Container( - padding: const EdgeInsets.all(0.01), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).colorScheme.surface, + _buildBadge(BuildContext context) => IgnorePointer( + child: DecoratedBox( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).colorScheme.surface, + ), + child: card.officialVerify?.icon?.isNotEmpty == true + ? CachedNetworkImage( + imageUrl: card.officialVerify!.icon!.http2https, + width: 24, + height: 24, + ) + : Image.asset( + 'assets/images/big-vip.png', + width: 24, + height: 24, + ), ), - child: card.officialVerify?.icon?.isNotEmpty == true - ? NetworkImgLayer( - src: card.officialVerify?.icon, - radius: null, - width: 24, - height: 24, - quality: 100, - ) - : Image.asset( - 'assets/images/big-vip.png', - width: 24, - height: 24, - ), ); _buildAvatar(BuildContext context) => Hero(