💄 Better sidebar navigation
This commit is contained in:
parent
bc5dbab9c5
commit
7f63fe7f0e
@ -40,15 +40,6 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
|||||||
rootScaffoldKey.currentState!.closeDrawer();
|
rootScaffoldKey.currentState!.closeDrawer();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSettingButton() {
|
|
||||||
return IconButton(
|
|
||||||
icon: const Icon(Icons.settings),
|
|
||||||
onPressed: () {
|
|
||||||
AppRouter.instance.pushNamed('settings');
|
|
||||||
_closeDrawer();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@ -72,7 +63,6 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
|||||||
leading: const Icon(Icons.account_circle),
|
leading: const Icon(Icons.account_circle),
|
||||||
title: Text('guest'.tr),
|
title: Text('guest'.tr),
|
||||||
subtitle: Text('unsignedIn'.tr),
|
subtitle: Text('unsignedIn'.tr),
|
||||||
trailing: _buildSettingButton(),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
AppRouter.instance.goNamed('account');
|
AppRouter.instance.goNamed('account');
|
||||||
_closeDrawer();
|
_closeDrawer();
|
||||||
@ -137,7 +127,6 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
trailing: _buildSettingButton(),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
AppRouter.instance.goNamed('account');
|
AppRouter.instance.goNamed('account');
|
||||||
_closeDrawer();
|
_closeDrawer();
|
||||||
@ -182,6 +171,23 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const Divider(thickness: 0.3, height: 1),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
minTileHeight: 0,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 20,
|
||||||
|
),
|
||||||
|
leading: const Icon(Icons.settings, size: 20).paddingAll(2),
|
||||||
|
title: Text('settings'.tr),
|
||||||
|
onTap: () {
|
||||||
|
AppRouter.instance.pushNamed('settings');
|
||||||
|
_closeDrawer();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingOnly(top: 8)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -68,6 +68,7 @@ class AppNavigationRegions extends StatelessWidget {
|
|||||||
.map((element) {
|
.map((element) {
|
||||||
return ExpansionTile(
|
return ExpansionTile(
|
||||||
minTileHeight: 0,
|
minTileHeight: 0,
|
||||||
|
initiallyExpanded: true,
|
||||||
tilePadding: const EdgeInsets.only(left: 20, right: 24),
|
tilePadding: const EdgeInsets.only(left: 20, right: 24),
|
||||||
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
|
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
collapsedBackgroundColor:
|
collapsedBackgroundColor:
|
||||||
@ -80,6 +81,7 @@ class AppNavigationRegions extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
const SliverPadding(padding: EdgeInsets.only(bottom: 8)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user