mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt: navigation bar (#740)
This commit is contained in:
@@ -144,10 +144,7 @@ class _HomePageState extends State<HomePage>
|
|||||||
config: {
|
config: {
|
||||||
Breakpoints.small: SlotLayout.from(
|
Breakpoints.small: SlotLayout.from(
|
||||||
key: const Key('bottomNavigation'),
|
key: const Key('bottomNavigation'),
|
||||||
builder: (context) => ListenableBuilder(
|
builder: (context) => _buildBottomBar(),
|
||||||
listenable: _selectIndex,
|
|
||||||
builder: (context, child) => _buildBottomBar(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -156,23 +153,29 @@ class _HomePageState extends State<HomePage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBottomBar() {
|
Widget _buildBottomBar() {
|
||||||
return ListenableBuilder(
|
return Stores.setting.fullScreen.fetch()
|
||||||
|
? UIs.placeholder
|
||||||
|
: ListenableBuilder(
|
||||||
listenable: _selectIndex,
|
listenable: _selectIndex,
|
||||||
builder: (context, child) => NavigationBar(
|
builder: (context, child) => NavigationBar(
|
||||||
selectedIndex: _selectIndex.value,
|
selectedIndex: _selectIndex.value,
|
||||||
height: kBottomNavigationBarHeight * 1.1,
|
height: kBottomNavigationBarHeight * 1.1,
|
||||||
animationDuration: const Duration(milliseconds: 250),
|
animationDuration: const Duration(milliseconds: 250),
|
||||||
onDestinationSelected: _onDestinationSelected,
|
onDestinationSelected: _onDestinationSelected,
|
||||||
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
labelBehavior:
|
||||||
|
NavigationDestinationLabelBehavior.onlyShowSelected,
|
||||||
destinations: AppTab.navDestinations,
|
destinations: AppTab.navDestinations,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildRailBar({bool extended = false}) {
|
Widget _buildRailBar({bool extended = false}) {
|
||||||
return ListenableBuilder(
|
return Stores.setting.fullScreen.fetch()
|
||||||
|
? UIs.placeholder
|
||||||
|
: ListenableBuilder(
|
||||||
listenable: _selectIndex,
|
listenable: _selectIndex,
|
||||||
builder: (context, child) => AdaptiveScaffold.standardNavigationRail(
|
builder: (context, child) =>
|
||||||
|
AdaptiveScaffold.standardNavigationRail(
|
||||||
extended: extended,
|
extended: extended,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
selectedIndex: _selectIndex.value,
|
selectedIndex: _selectIndex.value,
|
||||||
|
|||||||
Reference in New Issue
Block a user