opt: navigation bar (#740)

This commit is contained in:
Noo6
2025-04-22 11:54:29 +08:00
committed by GitHub
parent ede238c647
commit fa90c1ef31

View File

@@ -144,10 +144,7 @@ class _HomePageState extends State<HomePage>
config: {
Breakpoints.small: SlotLayout.from(
key: const Key('bottomNavigation'),
builder: (context) => ListenableBuilder(
listenable: _selectIndex,
builder: (context, child) => _buildBottomBar(),
),
builder: (context) => _buildBottomBar(),
),
},
),
@@ -156,23 +153,29 @@ class _HomePageState extends State<HomePage>
}
Widget _buildBottomBar() {
return ListenableBuilder(
return Stores.setting.fullScreen.fetch()
? UIs.placeholder
: ListenableBuilder(
listenable: _selectIndex,
builder: (context, child) => NavigationBar(
selectedIndex: _selectIndex.value,
height: kBottomNavigationBarHeight * 1.1,
animationDuration: const Duration(milliseconds: 250),
onDestinationSelected: _onDestinationSelected,
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
labelBehavior:
NavigationDestinationLabelBehavior.onlyShowSelected,
destinations: AppTab.navDestinations,
),
);
}
Widget _buildRailBar({bool extended = false}) {
return ListenableBuilder(
return Stores.setting.fullScreen.fetch()
? UIs.placeholder
: ListenableBuilder(
listenable: _selectIndex,
builder: (context, child) => AdaptiveScaffold.standardNavigationRail(
builder: (context, child) =>
AdaptiveScaffold.standardNavigationRail(
extended: extended,
padding: EdgeInsets.zero,
selectedIndex: _selectIndex.value,