fix: restore room short badge size

This commit is contained in:
zhx 2026-05-18 12:30:10 +08:00
parent 5a44ec0c6d
commit 79ec634ba0
2 changed files with 14 additions and 9 deletions

View File

@ -18,6 +18,7 @@ class SCUserBadgeStrip extends StatefulWidget {
this.badgeHeight,
this.longBadgeWidth,
this.spacing,
this.runSpacing,
this.maxBadges,
this.wrap = false,
this.maxWrapRows,
@ -33,6 +34,7 @@ class SCUserBadgeStrip extends StatefulWidget {
final double? badgeHeight;
final double? longBadgeWidth;
final double? spacing;
final double? runSpacing;
final int? maxBadges;
final bool wrap;
final int? maxWrapRows;
@ -163,6 +165,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
final badgeHeight = widget.badgeHeight ?? stripHeight;
final spacing = widget.spacing ?? 5.w;
final runSpacing = widget.runSpacing ?? 5.w;
final children =
badges
.map((badge) => _buildBadge(badge, badgeHeight: badgeHeight))
@ -175,6 +178,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
stripHeight: stripHeight,
badgeHeight: badgeHeight,
spacing: spacing,
runSpacing: runSpacing,
);
}
return SizedBox(
@ -183,7 +187,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
child: Wrap(
alignment: widget.alignment,
spacing: spacing,
runSpacing: 5.w,
runSpacing: runSpacing,
children: children,
),
),
@ -205,6 +209,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
required double stripHeight,
required double badgeHeight,
required double spacing,
required double runSpacing,
}) {
final maxRows = widget.maxWrapRows ?? 1;
if (maxRows <= 1) {
@ -278,7 +283,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
}
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: _withVerticalSpacing(rows, 5.w),
children: _withVerticalSpacing(rows, runSpacing),
);
},
),

View File

@ -282,13 +282,13 @@ class _RoomUserInfoCardState extends State<RoomUserInfoCard> {
mainAxisSize: MainAxisSize.min,
children: [
_buildProfileHeader(context, profile, ref),
SizedBox(height: 6.w),
SizedBox(height: 4.w),
_buildBadgeStrip(
profile?.id ?? widget.userId,
ref,
profile,
),
SizedBox(height: 8.w),
SizedBox(height: 5.w),
_buildActions(
context: context,
ref: ref,
@ -588,12 +588,12 @@ class _RoomUserInfoCardState extends State<RoomUserInfoCard> {
userId: userId,
fallbackBadges: _roomCardFallbackBadges(ref, profile),
displayScope: SCUserBadgeDisplayScope.short,
height: 82.w,
badgeHeight: 34.5.w,
longBadgeWidth: 87.w,
spacing: 10.w,
height: 62.w,
badgeHeight: 57.5.w,
longBadgeWidth: 145.w,
spacing: 12.w,
maxBadges: 12,
wrap: true,
wrap: false,
reserveSpace: false,
);
}