feat(home): 重构首页为底部导航栏布局,支持首页与个人页面切换

This commit is contained in:
qzl
2026-04-07 18:43:58 +08:00
parent c121c1092f
commit 6e82053ea7
3 changed files with 314 additions and 216 deletions
+24 -3
View File
@@ -75,10 +75,31 @@ class _NavItem extends StatelessWidget {
final bool selected;
final VoidCallback onTap;
IconData get _filledIcon {
switch (icon) {
case Icons.home:
return Icons.home;
case Icons.person:
return Icons.person;
default:
return icon;
}
}
IconData get _outlinedIcon {
switch (icon) {
case Icons.home:
return Icons.home_outlined;
case Icons.person:
return Icons.person_outline;
default:
return icon;
}
}
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
final iconColor = colors.primary;
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(AppRadius.md),
@@ -87,12 +108,12 @@ class _NavItem extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, color: iconColor),
Icon(selected ? _filledIcon : _outlinedIcon, color: colors.primary),
const SizedBox(height: AppSpacing.xs),
Text(
label,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: iconColor,
color: colors.primary,
fontWeight: selected ? FontWeight.w600 : FontWeight.w500,
),
),