opt msg item

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-16 13:42:53 +08:00
parent a2c24fb33c
commit fcdb04b728

View File

@@ -178,76 +178,75 @@ class WhisperSessionItem extends StatelessWidget {
}, },
), ),
title: Row( title: Row(
spacing: 5,
children: [ children: [
Text( Expanded(
item.sessionInfo.sessionName, child: Row(
style: TextStyle( spacing: 5,
fontSize: 15, children: [
color: vipInfo?['status'] != null && Flexible(
vipInfo!['status'] > 0 && child: Text(
vipInfo['type'] == 2 item.sessionInfo.sessionName,
? context.vipColor maxLines: 1,
: null, overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15,
color: vipInfo?['status'] != null &&
vipInfo!['status'] > 0 &&
vipInfo['type'] == 2
? context.vipColor
: null,
),
),
),
if (item.sessionInfo.userLabel.style.borderedLabel.hasText())
PBadge(
isStack: false,
type: PBadgeType.line_secondary,
size: PBadgeSize.small,
fontSize: 10,
isBold: false,
text: item.sessionInfo.userLabel.style.borderedLabel.text,
),
if (item.sessionInfo.isLive)
Image.asset('assets/images/live/live.gif', height: 15),
],
), ),
), ),
if (item.sessionInfo.userLabel.style.borderedLabel.hasText()) ...[ if (item.hasTimestamp())
const SizedBox(width: 5), Text(
PBadge( DateUtil.dateFormat((item.timestamp ~/ 1000000).toInt()),
isStack: false, style: TextStyle(
type: PBadgeType.line_secondary, fontSize: 12,
size: PBadgeSize.small, color: theme.colorScheme.outline,
fontSize: 10, ),
isBold: false,
text: item.sessionInfo.userLabel.style.borderedLabel.text,
), ),
],
if (item.sessionInfo.isLive) ...[
const SizedBox(width: 5),
Image.asset('assets/images/live/live.gif', height: 15),
],
], ],
), ),
subtitle: Text( subtitle: Row(
item.msgSummary.rawMsg,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.labelMedium!
.copyWith(color: theme.colorScheme.outline),
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [ children: [
if (item.isMuted) ...[ Expanded(
child: Text(
item.msgSummary.rawMsg,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.labelMedium!
.copyWith(color: theme.colorScheme.outline),
),
),
if (item.isMuted)
Icon( Icon(
size: 16, size: 16,
Icons.notifications_off, Icons.notifications_off,
color: theme.colorScheme.outline, color: theme.colorScheme.outline,
), )
if (item.hasTimestamp()) const SizedBox(width: 4), else if (item.hasUnread() &&
], item.unread.style != UnreadStyle.UNREAD_STYLE_NONE)
Column( Badge(
spacing: 10, label: item.unread.style == UnreadStyle.UNREAD_STYLE_NUMBER
mainAxisSize: MainAxisSize.min, ? Text(item.unread.number.toString())
crossAxisAlignment: CrossAxisAlignment.end, : null,
children: [ )
if (item.hasTimestamp())
Text(
DateUtil.dateFormat((item.timestamp ~/ 1000000).toInt()),
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
),
),
if (item.hasUnread() &&
item.unread.style != UnreadStyle.UNREAD_STYLE_NONE)
Badge(
label: item.unread.style == UnreadStyle.UNREAD_STYLE_NUMBER
? Text(item.unread.number.toString())
: null,
alignment: Alignment.topRight,
)
],
),
], ],
), ),
); );