opt member info

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-18 11:35:33 +08:00
parent 271856ca89
commit 391d862b17
4 changed files with 53 additions and 51 deletions

View File

@@ -28,6 +28,7 @@ class VideoCardHMemberVideo extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context);
return Stack( return Stack(
clipBehavior: Clip.none, clipBehavior: Clip.none,
children: [ children: [
@@ -99,7 +100,7 @@ class VideoCardHMemberVideo extends StatelessWidget {
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
letterSpacing: 1.5, letterSpacing: 5,
), ),
), ),
), ),
@@ -166,7 +167,7 @@ class VideoCardHMemberVideo extends StatelessWidget {
), ),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
videoContent(context), videoContent(context, theme),
], ],
); );
}, },
@@ -186,8 +187,9 @@ class VideoCardHMemberVideo extends StatelessWidget {
); );
} }
Widget videoContent(context) { Widget videoContent(BuildContext context, ThemeData theme) {
final theme = Theme.of(context); final isCurr = fromViewAid == videoItem.param ||
(videoItem.bvid != null && videoItem.bvid == bvid);
return Expanded( return Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -197,15 +199,11 @@ class VideoCardHMemberVideo extends StatelessWidget {
videoItem.title, videoItem.title,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontWeight: videoItem.bvid != null && videoItem.bvid == bvid fontWeight: isCurr ? FontWeight.bold : null,
? FontWeight.bold
: null,
fontSize: theme.textTheme.bodyMedium!.fontSize, fontSize: theme.textTheme.bodyMedium!.fontSize,
height: 1.42, height: 1.42,
letterSpacing: 0.3, letterSpacing: 0.3,
color: videoItem.bvid != null && videoItem.bvid == bvid color: isCurr ? theme.colorScheme.primary : null,
? theme.colorScheme.primary
: null,
), ),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,

View File

@@ -5,7 +5,7 @@ import 'package:PiliPlus/models/space/card.dart';
import 'package:PiliPlus/models/space/images.dart'; import 'package:PiliPlus/models/space/images.dart';
import 'package:PiliPlus/utils/extension.dart'; import 'package:PiliPlus/utils/extension.dart';
import 'package:PiliPlus/utils/page_utils.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:PiliPlus/utils/utils.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -59,8 +59,8 @@ class UserInfoCard extends StatelessWidget {
Text( Text(
title, title,
style: TextStyle( style: TextStyle(
height: 1, height: 1.2,
fontSize: 11, fontSize: 12,
color: theme.colorScheme.outline, color: theme.colorScheme.outline,
), ),
), ),
@@ -108,7 +108,7 @@ class UserInfoCard extends StatelessWidget {
List<Widget> _buildLeft(BuildContext context, ThemeData theme) => [ List<Widget> _buildLeft(BuildContext context, ThemeData theme) => [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.only(left: 20, right: 20, top: 5),
child: Wrap( child: Wrap(
spacing: 8, spacing: 8,
runSpacing: 8, runSpacing: 8,
@@ -302,7 +302,6 @@ class UserInfoCard extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: List.generate( children: List.generate(
5, 5,
(index) => index % 2 == 0 (index) => index % 2 == 0
@@ -323,10 +322,12 @@ class UserInfoCard extends StatelessWidget {
} }
}, },
) )
: const SizedBox( : const Expanded(
height: 15, child: SizedBox(
width: 1, height: 15,
child: VerticalDivider(), width: 1,
child: VerticalDivider(),
),
), ),
), ),
), ),
@@ -334,11 +335,10 @@ class UserInfoCard extends StatelessWidget {
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const SizedBox(width: 20),
if (!isOwner) ...[ if (!isOwner) ...[
IconButton.outlined( IconButton.outlined(
onPressed: () { onPressed: () {
if (GStorage.userInfo.get('userInfoCache') != null) { if (Accounts.main.isLogin) {
int mid = int.parse(card.mid!); int mid = int.parse(card.mid!);
Get.toNamed( Get.toNamed(
'/whisperDetail', '/whisperDetail',
@@ -355,7 +355,7 @@ class UserInfoCard extends StatelessWidget {
style: IconButton.styleFrom( style: IconButton.styleFrom(
side: BorderSide( side: BorderSide(
width: 1.0, width: 1.0,
color: theme.colorScheme.outline.withValues(alpha: 0.5), color: theme.colorScheme.outline.withValues(alpha: 0.3),
), ),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap, tapTargetSize: MaterialTapTargetSize.shrinkWrap,
@@ -371,7 +371,7 @@ class UserInfoCard extends StatelessWidget {
backgroundColor: relation != 0 backgroundColor: relation != 0
? theme.colorScheme.onInverseSurface ? theme.colorScheme.onInverseSurface
: null, : null,
visualDensity: VisualDensity.compact, visualDensity: const VisualDensity(vertical: -1.8),
), ),
child: Text.rich( child: Text.rich(
style: TextStyle( style: TextStyle(
@@ -379,7 +379,7 @@ class UserInfoCard extends StatelessWidget {
), ),
TextSpan( TextSpan(
children: [ children: [
if (relation != 0 && relation != 128) if (relation != 0 && relation != 128) ...[
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.top, alignment: PlaceholderAlignment.top,
child: Icon( child: Icon(
@@ -388,25 +388,27 @@ class UserInfoCard extends StatelessWidget {
color: theme.colorScheme.outline, color: theme.colorScheme.outline,
), ),
), ),
const TextSpan(text: ' '),
],
TextSpan( TextSpan(
text: isOwner text: isOwner
? '编辑资料' ? '编辑资料'
: switch (relation) { : switch (relation) {
0 => '关注', 0 => '关注',
1 => '悄悄关注', 1 => '悄悄关注',
2 => '已关注', 2 => '已关注',
// 3 => '回关', // 3 => '回关',
4 || 6 => '已互关', 4 || 6 => '已互关',
128 => '移除黑名单', 128 => '移除黑名单',
-10 => '特别关注', // 该状态码并不是官方状态码 -10 => '特别关注', // 该状态码并不是官方状态码
_ => relation.toString(), _ => relation.toString(),
}), },
),
], ],
), ),
), ),
), ),
), ),
const SizedBox(width: 20),
], ],
), ),
], ],
@@ -440,7 +442,7 @@ class UserInfoCard extends StatelessWidget {
_buildHeader(context, theme), _buildHeader(context, theme),
SizedBox( SizedBox(
width: double.infinity, 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), child: _buildAvatar(context),
), ),
Positioned( Positioned(
left: 140, left: 160,
top: 140, top: 140,
right: 20, right: 15,
bottom: 0, bottom: 0,
child: _buildRight(context, theme), child: _buildRight(context, theme),
), ),
@@ -544,6 +546,7 @@ class UserInfoCard extends StatelessWidget {
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(
flex: 5,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, 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),
], ],
), ),
), ),

View File

@@ -102,14 +102,10 @@ class _MemberOpusState extends State<MemberOpus>
}, },
); );
}, },
label: Row( icon: const Icon(size: 20, Icons.sort),
children: [ label: Obx(
const Icon(size: 20, Icons.sort), () => Text(_controller.type.value.text ??
Obx( _controller.type.value.tabName!),
() => Text(_controller.type.value.text ??
_controller.type.value.tabName!),
),
],
), ),
), ),
), ),

View File

@@ -816,7 +816,8 @@ class _VideoInfoState extends State<VideoInfo> {
return TextButton( return TextButton(
onPressed: () => videoIntroController.actionRelationMod(context), onPressed: () => videoIntroController.actionRelationMod(context),
style: TextButton.styleFrom( style: TextButton.styleFrom(
visualDensity: const VisualDensity(vertical: -3), padding: const EdgeInsets.symmetric(horizontal: 18),
visualDensity: const VisualDensity(vertical: -2.8),
foregroundColor: attr != 0 foregroundColor: attr != 0
? t.colorScheme.outline ? t.colorScheme.outline
: t.colorScheme.onSecondaryContainer, : t.colorScheme.onSecondaryContainer,
@@ -833,7 +834,7 @@ class _VideoInfoState extends State<VideoInfo> {
-10 => '特别关注', -10 => '特别关注',
_ => '关注' _ => '关注'
}, },
style: TextStyle(fontSize: t.textTheme.labelMedium!.fontSize), style: const TextStyle(fontSize: 13),
), ),
); );
}, },