opt member relation

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-15 09:25:29 +08:00
parent c1aeaca09e
commit 1548624920
4 changed files with 40 additions and 15 deletions

View File

@@ -452,7 +452,7 @@ class UserInfoCard extends StatelessWidget {
),
Expanded(
child: FilledButton.tonal(
onPressed: onFollow,
onPressed: !isOwner && relation == -1 ? null : onFollow,
style: FilledButton.styleFrom(
backgroundColor: relation != 0
? colorScheme.onInverseSurface
@@ -461,12 +461,22 @@ class UserInfoCard extends StatelessWidget {
visualDensity: const VisualDensity(vertical: -1.8),
),
child: Text.rich(
style: TextStyle(
color: relation != 0 ? colorScheme.outline : null,
),
style: relation != 0
? TextStyle(color: colorScheme.outline)
: null,
TextSpan(
children: [
if (relation != 0 && relation != 128) ...[
if (relation == -1) ...[
WidgetSpan(
alignment: .middle,
child: Icon(
Icons.block,
size: 16,
color: colorScheme.outline,
),
),
const TextSpan(text: ' '),
] else if (relation != 0 && relation != 128) ...[
WidgetSpan(
alignment: .middle,
child: Icon(
@@ -481,7 +491,7 @@ class UserInfoCard extends StatelessWidget {
text: isOwner
? '编辑资料'
: switch (relation) {
0 => '关注',
0 || -1 => '关注',
1 => '悄悄关注',
2 => '已关注',
// 3 => '回关',