fix(flutter): 去除关注 tab 并加深色首页导航
This commit is contained in:
1 parent
ee6f0d7e72
commit
d36d62f6a6
12 files changed
+48
-39
No files matched your search
@@ -26,18 +26,20 @@ class AppBottomNavItem {
|
||||
final bool selected;
|
||||
}
|
||||
|
||||
/// 四槽底部导航,仅做浅色暖橙视觉换肤。
|
||||
/// 四槽底部导航:首页 feed 用深色样式,其它页面保持浅色暖橙风格。
|
||||
class AppBottomNav extends StatelessWidget {
|
||||
const AppBottomNav({
|
||||
super.key,
|
||||
required this.items,
|
||||
this.backgroundColor = AppColors.bar,
|
||||
this.barKey,
|
||||
this.dark = false,
|
||||
});
|
||||
|
||||
final List<AppBottomNavItem> items;
|
||||
final Color backgroundColor;
|
||||
final Key? barKey;
|
||||
final bool dark;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -50,11 +52,25 @@ class AppBottomNav extends StatelessWidget {
|
||||
key: barKey,
|
||||
height: AppDimens.navHeight,
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor.withValues(alpha: 0.95),
|
||||
border: const Border(top: BorderSide(color: AppColors.border)),
|
||||
color: dark
|
||||
? const Color(0xE6000000)
|
||||
: backgroundColor.withValues(alpha: 0.95),
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
color: dark ? Colors.white12 : AppColors.border,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [for (final item in items) _NavDestination(item: item)],
|
||||
children: [
|
||||
for (final item in items)
|
||||
_NavDestination(
|
||||
item: item,
|
||||
unselectedColor: dark
|
||||
? Colors.white70
|
||||
: AppColors.navUnselected,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -64,9 +80,10 @@ class AppBottomNav extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _NavDestination extends StatelessWidget {
|
||||
const _NavDestination({required this.item});
|
||||
const _NavDestination({required this.item, required this.unselectedColor});
|
||||
|
||||
final AppBottomNavItem item;
|
||||
final Color unselectedColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Expanded(
|
||||
@@ -89,9 +106,7 @@ class _NavDestination extends StatelessWidget {
|
||||
child: Icon(
|
||||
item.selected ? item.selectedIcon : item.icon,
|
||||
size: AppDimens.navIcon,
|
||||
color: item.selected
|
||||
? AppColors.blue
|
||||
: AppColors.navUnselected,
|
||||
color: item.selected ? AppColors.blue : unselectedColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
@@ -102,9 +117,7 @@ class _NavDestination extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: AppDimens.navLabel,
|
||||
fontWeight: item.selected ? FontWeight.w700 : FontWeight.w500,
|
||||
color: item.selected
|
||||
? AppColors.blue
|
||||
: AppColors.navUnselected,
|
||||
color: item.selected ? AppColors.blue : unselectedColor,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user