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