opt.: server tab navigation bar when landscape

This commit is contained in:
lollipopkit
2024-05-09 18:26:31 +08:00
parent 4d2a944310
commit 131ece725a
9 changed files with 145 additions and 126 deletions

View File

@@ -175,20 +175,19 @@ class _HomePageState extends State<HomePage>
: ValBuilder(
listenable: _isLandscape,
builder: (ls) {
if (ls) return const SizedBox();
return ListenableBuilder(
listenable: _selectIndex,
builder: (_, __) => _buildBottomBar(),
builder: (_, __) => _buildBottomBar(ls),
);
},
),
);
}
Widget _buildBottomBar() {
Widget _buildBottomBar(bool ls) {
return NavigationBar(
selectedIndex: _selectIndex.value,
height: kBottomNavigationBarHeight * 1.1,
height: kBottomNavigationBarHeight * (ls ? 0.75 : 1.1),
animationDuration: const Duration(milliseconds: 250),
onDestinationSelected: (int index) {
if (_selectIndex.value == index) return;
@@ -203,7 +202,9 @@ class _HomePageState extends State<HomePage>
_switchingPage = false;
});
},
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
labelBehavior: ls
? NavigationDestinationLabelBehavior.alwaysHide
: NavigationDestinationLabelBehavior.onlyShowSelected,
destinations: [
NavigationDestination(
icon: const Icon(BoxIcons.bx_server),