mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 16:48:16 +08:00
change msg badge pos
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -139,13 +139,18 @@ class WhisperSessionItem extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
leading: Builder(
|
leading: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
Widget buildAvatar() {
|
final pendant = item.sessionInfo.avatar.fallbackLayers.layers
|
||||||
final pendant = item.sessionInfo.avatar.fallbackLayers.layers
|
.getOrNull(1)
|
||||||
.getOrNull(1)
|
?.resource;
|
||||||
?.resource;
|
final offcial = item.sessionInfo.avatar.fallbackLayers.layers
|
||||||
final offcial = item.sessionInfo.avatar.fallbackLayers.layers
|
.lastOrNull?.resource.resImage.imageSrc;
|
||||||
.lastOrNull?.resource.resImage.imageSrc;
|
|
||||||
return PendantAvatar(
|
return GestureDetector(
|
||||||
|
onTap: item.sessionInfo.avatar.hasMid()
|
||||||
|
? () =>
|
||||||
|
Get.toNamed('/member?mid=${item.sessionInfo.avatar.mid}')
|
||||||
|
: null,
|
||||||
|
child: PendantAvatar(
|
||||||
size: 42,
|
size: 42,
|
||||||
badgeSize: 14,
|
badgeSize: 14,
|
||||||
avatar: item.sessionInfo.avatar.fallbackLayers.layers.first
|
avatar: item.sessionInfo.avatar.fallbackLayers.layers.first
|
||||||
@@ -162,25 +167,7 @@ class WhisperSessionItem extends StatelessWidget {
|
|||||||
_ => null,
|
_ => null,
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
);
|
),
|
||||||
}
|
|
||||||
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: item.sessionInfo.avatar.hasMid()
|
|
||||||
? () => Get.toNamed(
|
|
||||||
'/member?mid=${item.sessionInfo.avatar.mid}',
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
child: item.hasUnread() &&
|
|
||||||
item.unread.style != UnreadStyle.UNREAD_STYLE_NONE
|
|
||||||
? Badge(
|
|
||||||
label: item.unread.style == UnreadStyle.UNREAD_STYLE_NUMBER
|
|
||||||
? Text(" ${item.unread.number} ")
|
|
||||||
: null,
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: buildAvatar(),
|
|
||||||
)
|
|
||||||
: buildAvatar(),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -232,15 +219,30 @@ class WhisperSessionItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (item.hasTimestamp()) const SizedBox(width: 4),
|
if (item.hasTimestamp()) const SizedBox(width: 4),
|
||||||
],
|
],
|
||||||
if (item.hasTimestamp())
|
Column(
|
||||||
Text(
|
spacing: 10,
|
||||||
Utils.dateFormat((item.timestamp ~/ 1000000).toInt(),
|
mainAxisSize: MainAxisSize.min,
|
||||||
formatType: "day"),
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
style: TextStyle(
|
children: [
|
||||||
fontSize: 12,
|
if (item.hasTimestamp())
|
||||||
color: theme.colorScheme.outline,
|
Text(
|
||||||
),
|
Utils.dateFormat((item.timestamp ~/ 1000000).toInt(),
|
||||||
),
|
formatType: "day"),
|
||||||
|
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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user