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.badgeHeight,
this.longBadgeWidth, this.longBadgeWidth,
this.spacing, this.spacing,
this.runSpacing,
this.maxBadges, this.maxBadges,
this.wrap = false, this.wrap = false,
this.maxWrapRows, this.maxWrapRows,
@ -33,6 +34,7 @@ class SCUserBadgeStrip extends StatefulWidget {
final double? badgeHeight; final double? badgeHeight;
final double? longBadgeWidth; final double? longBadgeWidth;
final double? spacing; final double? spacing;
final double? runSpacing;
final int? maxBadges; final int? maxBadges;
final bool wrap; final bool wrap;
final int? maxWrapRows; final int? maxWrapRows;
@ -163,6 +165,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
final badgeHeight = widget.badgeHeight ?? stripHeight; final badgeHeight = widget.badgeHeight ?? stripHeight;
final spacing = widget.spacing ?? 5.w; final spacing = widget.spacing ?? 5.w;
final runSpacing = widget.runSpacing ?? 5.w;
final children = final children =
badges badges
.map((badge) => _buildBadge(badge, badgeHeight: badgeHeight)) .map((badge) => _buildBadge(badge, badgeHeight: badgeHeight))
@ -175,6 +178,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
stripHeight: stripHeight, stripHeight: stripHeight,
badgeHeight: badgeHeight, badgeHeight: badgeHeight,
spacing: spacing, spacing: spacing,
runSpacing: runSpacing,
); );
} }
return SizedBox( return SizedBox(
@ -183,7 +187,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
child: Wrap( child: Wrap(
alignment: widget.alignment, alignment: widget.alignment,
spacing: spacing, spacing: spacing,
runSpacing: 5.w, runSpacing: runSpacing,
children: children, children: children,
), ),
), ),
@ -205,6 +209,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
required double stripHeight, required double stripHeight,
required double badgeHeight, required double badgeHeight,
required double spacing, required double spacing,
required double runSpacing,
}) { }) {
final maxRows = widget.maxWrapRows ?? 1; final maxRows = widget.maxWrapRows ?? 1;
if (maxRows <= 1) { if (maxRows <= 1) {
@ -278,7 +283,7 @@ class _SCUserBadgeStripState extends State<SCUserBadgeStrip> {
} }
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, 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, mainAxisSize: MainAxisSize.min,
children: [ children: [
_buildProfileHeader(context, profile, ref), _buildProfileHeader(context, profile, ref),
SizedBox(height: 6.w), SizedBox(height: 4.w),
_buildBadgeStrip( _buildBadgeStrip(
profile?.id ?? widget.userId, profile?.id ?? widget.userId,
ref, ref,
profile, profile,
), ),
SizedBox(height: 8.w), SizedBox(height: 5.w),
_buildActions( _buildActions(
context: context, context: context,
ref: ref, ref: ref,
@ -588,12 +588,12 @@ class _RoomUserInfoCardState extends State<RoomUserInfoCard> {
userId: userId, userId: userId,
fallbackBadges: _roomCardFallbackBadges(ref, profile), fallbackBadges: _roomCardFallbackBadges(ref, profile),
displayScope: SCUserBadgeDisplayScope.short, displayScope: SCUserBadgeDisplayScope.short,
height: 82.w, height: 62.w,
badgeHeight: 34.5.w, badgeHeight: 57.5.w,
longBadgeWidth: 87.w, longBadgeWidth: 145.w,
spacing: 10.w, spacing: 12.w,
maxBadges: 12, maxBadges: 12,
wrap: true, wrap: false,
reserveSpace: false, reserveSpace: false,
); );
} }