fix(home): 稳定二级标签切换布局
This commit is contained in:
1 parent
4304727ffd
commit
b3ea85df41
4 files changed
+33
-37
No files matched your search
@@ -111,12 +111,15 @@ abstract final class AppDimens {
|
||||
static const double homeSecondaryTagHeight = 26;
|
||||
static const double homeSecondaryTagHorizontalPadding = 10;
|
||||
static const double homeSecondaryTagRadius = 13;
|
||||
static const Duration homeSecondaryTagAnimationDuration = Duration(
|
||||
milliseconds: 150,
|
||||
);
|
||||
static const double homeSecondaryFilterGap = 8;
|
||||
static const double homeSecondaryFilterVisualSize = 26;
|
||||
static const double homeSecondaryFilterIcon = 16;
|
||||
static const double homeSecondaryFilterStroke = 1.7;
|
||||
static const double homePrimaryCategoryGap = 24;
|
||||
static const double homeSecondaryTagGap = 14;
|
||||
static const double homeSecondaryTagGap = 24;
|
||||
static const double homeSearchTopGap = 0;
|
||||
static const double homeSearchPrimaryGap = 8;
|
||||
static const double homePrimarySecondaryGap = 8;
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user