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(
spacing: 5,
children: [
Text(
Expanded(
child: Row(
spacing: 5,
children: [
Flexible(
child: Text(
item.sessionInfo.sessionName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15,
color: vipInfo?['status'] != null &&
@@ -190,8 +198,8 @@ class WhisperSessionItem extends StatelessWidget {
: null,
),
),
if (item.sessionInfo.userLabel.style.borderedLabel.hasText()) ...[
const SizedBox(width: 5),
),
if (item.sessionInfo.userLabel.style.borderedLabel.hasText())
PBadge(
isStack: false,
type: PBadgeType.line_secondary,
@@ -200,36 +208,11 @@ class WhisperSessionItem extends StatelessWidget {
isBold: false,
text: item.sessionInfo.userLabel.style.borderedLabel.text,
),
],
if (item.sessionInfo.isLive) ...[
const SizedBox(width: 5),
if (item.sessionInfo.isLive)
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())
Text(
DateUtil.dateFormat((item.timestamp ~/ 1000000).toInt()),
@@ -238,18 +221,34 @@ class WhisperSessionItem extends StatelessWidget {
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)
Badge(
label: item.unread.style == UnreadStyle.UNREAD_STYLE_NUMBER
? Text(item.unread.number.toString())
: null,
alignment: Alignment.topRight,
)
],
),
],
),
);
}
}