fix(home): 稳定二级标签切换布局

This commit is contained in:
Zhou Weidong committed 2026-10-22 18:40:56 +08:00
1 parent 4304727ffd
commit b3ea85df41
4 files changed
+33 -37

No files matched your search

+17 -21
View File
@@ -366,10 +366,10 @@ class HomeGridHeader extends StatelessWidget {
final selected = selectedTag == tag.id;
final label = Text(
tag.label,
style: TextStyle(
style: const TextStyle(
color: selected ? AppColors.navSelected : AppColors.textTertiary,
fontSize: AppDimens.homeSecondaryTagFont,
fontWeight: selected ? FontWeight.w600 : FontWeight.w400,
fontWeight: FontWeight.w600,
letterSpacing: 0,
),
);
@@ -377,25 +377,21 @@ class HomeGridHeader extends StatelessWidget {
key: Key('home-tag-${tag.id}'),
borderRadius: BorderRadius.circular(AppDimens.pillRadius),
onTap: () => onTagSelected(selected ? null : tag.id),
child: selected
? Container(
height: AppDimens.homeSecondaryTagHeight,
padding: const EdgeInsets.symmetric(
horizontal: AppDimens.homeSecondaryTagHorizontalPadding,
),
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.contentSurface,
borderRadius: BorderRadius.circular(
AppDimens.homeSecondaryTagRadius,
),
),
child: label,
)
: SizedBox(
height: AppDimens.homeSecondaryTagHeight,
child: Align(alignment: Alignment.centerLeft, child: label),
),
child: AnimatedContainer(
key: Key('home-tag-animated-${tag.id}'),
duration: AppDimens.homeSecondaryTagAnimationDuration,
curve: Curves.easeOut,
height: AppDimens.homeSecondaryTagHeight,
padding: const EdgeInsets.symmetric(
horizontal: AppDimens.homeSecondaryTagHorizontalPadding,
),
alignment: Alignment.center,
decoration: BoxDecoration(
color: selected ? AppColors.contentSurface : AppColors.transparent,
borderRadius: BorderRadius.circular(AppDimens.homeSecondaryTagRadius),
),
child: label,
),
);
}
}