mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: tablet nav
Closes #692 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -204,36 +204,88 @@ class _MainAppState extends State<MainApp>
|
|||||||
context.orientation == Orientation.landscape) ...[
|
context.orientation == Orientation.landscape) ...[
|
||||||
Obx(
|
Obx(
|
||||||
() => _mainController.navigationBars.length > 1
|
() => _mainController.navigationBars.length > 1
|
||||||
? NavigationRail(
|
? context.isTablet
|
||||||
groupAlignment: 0.5,
|
? Column(
|
||||||
selectedIndex: _mainController.selectedIndex.value,
|
children: [
|
||||||
onDestinationSelected: setIndex,
|
SizedBox(
|
||||||
labelType: NavigationRailLabelType.selected,
|
height:
|
||||||
leading: userAndSearchVertical,
|
MediaQuery.paddingOf(context).top + 50),
|
||||||
destinations: _mainController.navigationBars
|
userAndSearchVertical,
|
||||||
.map(
|
const Spacer(flex: 2),
|
||||||
(e) => NavigationRailDestination(
|
Expanded(
|
||||||
icon: _buildIcon(
|
flex: 5,
|
||||||
id: e['id'],
|
child: SizedBox(
|
||||||
count: e['count'],
|
width: 130,
|
||||||
icon: e['icon'],
|
child: MediaQuery.removePadding(
|
||||||
|
context: context,
|
||||||
|
removeRight: true,
|
||||||
|
child: NavigationDrawer(
|
||||||
|
tilePadding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 5, horizontal: 12),
|
||||||
|
indicatorShape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(16)),
|
||||||
|
onDestinationSelected: setIndex,
|
||||||
|
selectedIndex:
|
||||||
|
_mainController.selectedIndex.value,
|
||||||
|
children: [
|
||||||
|
..._mainController.navigationBars
|
||||||
|
.map((e) {
|
||||||
|
return NavigationDrawerDestination(
|
||||||
|
label: Text(e['label']),
|
||||||
|
icon: _buildIcon(
|
||||||
|
id: e['id'],
|
||||||
|
count: e['count'],
|
||||||
|
icon: e['icon'],
|
||||||
|
),
|
||||||
|
selectedIcon: _buildIcon(
|
||||||
|
id: e['id'],
|
||||||
|
count: e['count'],
|
||||||
|
icon: e['selectIcon'],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
selectedIcon: _buildIcon(
|
|
||||||
id: e['id'],
|
|
||||||
count: e['count'],
|
|
||||||
icon: e['selectIcon'],
|
|
||||||
),
|
|
||||||
label: Text(e['label']),
|
|
||||||
),
|
),
|
||||||
)
|
],
|
||||||
.toList(),
|
)
|
||||||
)
|
: NavigationRail(
|
||||||
: Container(
|
groupAlignment: 0.5,
|
||||||
padding: EdgeInsets.only(
|
selectedIndex:
|
||||||
top: MediaQuery.paddingOf(context).top + 10,
|
_mainController.selectedIndex.value,
|
||||||
|
onDestinationSelected: setIndex,
|
||||||
|
labelType: NavigationRailLabelType.selected,
|
||||||
|
leading: userAndSearchVertical,
|
||||||
|
destinations: _mainController.navigationBars
|
||||||
|
.map(
|
||||||
|
(e) => NavigationRailDestination(
|
||||||
|
icon: _buildIcon(
|
||||||
|
id: e['id'],
|
||||||
|
count: e['count'],
|
||||||
|
icon: e['icon'],
|
||||||
|
),
|
||||||
|
selectedIcon: _buildIcon(
|
||||||
|
id: e['id'],
|
||||||
|
count: e['count'],
|
||||||
|
icon: e['selectIcon'],
|
||||||
|
),
|
||||||
|
label: Text(e['label']),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
|
)
|
||||||
|
: SafeArea(
|
||||||
|
right: false,
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 10,
|
||||||
|
),
|
||||||
|
width: 80,
|
||||||
|
child: userAndSearchVertical,
|
||||||
),
|
),
|
||||||
width: 56,
|
|
||||||
child: userAndSearchVertical,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
VerticalDivider(
|
VerticalDivider(
|
||||||
|
|||||||
Reference in New Issue
Block a user