fix: show long badges in room chat items
This commit is contained in:
parent
5be1f05899
commit
27c89a9f9e
@ -1313,6 +1313,30 @@ class _MsgItemState extends State<MsgItem> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLongMedals({
|
||||
required String? userId,
|
||||
List<WearBadge> fallbackBadges = const <WearBadge>[],
|
||||
}) {
|
||||
final hasUserId = (userId ?? "").trim().isNotEmpty;
|
||||
if (!hasUserId && fallbackBadges.isEmpty) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: SCUserBadgeStrip(
|
||||
userId: userId,
|
||||
fallbackBadges: fallbackBadges,
|
||||
displayScope: SCUserBadgeDisplayScope.long,
|
||||
height: 22.w,
|
||||
badgeHeight: 20.w,
|
||||
longBadgeWidth: 62.w,
|
||||
spacing: 4.w,
|
||||
maxBadges: 8,
|
||||
reserveSpace: false,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
int _msgColor(String type) {
|
||||
switch (type) {
|
||||
case SCRoomMsgType.joinRoom:
|
||||
@ -1851,13 +1875,18 @@ class _MsgItemState extends State<MsgItem> {
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: 50.w,
|
||||
height: 73.w,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildUserNameAndLevels(widget.msg.user),
|
||||
SizedBox(height: 2.w),
|
||||
_buildLongMedals(
|
||||
userId: widget.msg.user?.id,
|
||||
fallbackBadges: _activeWearBadges(widget.msg.user),
|
||||
),
|
||||
SizedBox(height: 2.w),
|
||||
_buildMedals(
|
||||
userId: widget.msg.user?.id,
|
||||
fallbackBadges: _activeWearBadges(widget.msg.user),
|
||||
@ -1897,13 +1926,18 @@ class _MsgItemState extends State<MsgItem> {
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: 50.w,
|
||||
height: 73.w,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildUserNameAndLevels(user),
|
||||
SizedBox(height: 2.w),
|
||||
_buildLongMedals(
|
||||
userId: user.id,
|
||||
fallbackBadges: _activeWearBadges(user),
|
||||
),
|
||||
SizedBox(height: 2.w),
|
||||
_buildMedals(
|
||||
userId: user.id,
|
||||
fallbackBadges: _activeWearBadges(user),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user