Better side navigation bar

This commit is contained in:
LittleSheep 2024-08-09 22:59:24 +08:00
parent 0135b8d838
commit 2356eac118
2 changed files with 7 additions and 7 deletions

View File

@ -4,17 +4,17 @@ import 'package:get/utils.dart';
abstract class AppNavigation { abstract class AppNavigation {
static List<AppNavigationDestination> destinations = [ static List<AppNavigationDestination> destinations = [
AppNavigationDestination( AppNavigationDestination(
icon: const Icon(Icons.home), icon: Icons.home,
label: 'home'.tr, label: 'home'.tr,
page: 'home', page: 'home',
), ),
AppNavigationDestination( AppNavigationDestination(
icon: const Icon(Icons.workspaces), icon: Icons.workspaces,
label: 'realms'.tr, label: 'realms'.tr,
page: 'realms', page: 'realms',
), ),
AppNavigationDestination( AppNavigationDestination(
icon: const Icon(Icons.forum), icon: Icons.forum,
label: 'channelTypeDirect'.tr, label: 'channelTypeDirect'.tr,
page: 'chat', page: 'chat',
), ),
@ -25,7 +25,7 @@ abstract class AppNavigation {
} }
class AppNavigationDestination { class AppNavigationDestination {
final Widget icon; final IconData icon;
final String label; final String label;
final String page; final String page;

View File

@ -81,7 +81,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
} }
return ListTile( return ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 24), contentPadding: const EdgeInsets.only(left: 20, right: 20),
title: Text( title: Text(
auth.userProfile.value!['nick'], auth.userProfile.value!['nick'],
maxLines: 1, maxLines: 1,
@ -154,7 +154,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
}); });
}, },
); );
}).paddingOnly(top: 8), }).paddingSymmetric(vertical: 8),
const Divider(thickness: 0.3, height: 1), const Divider(thickness: 0.3, height: 1),
Column( Column(
children: AppNavigation.destinations children: AppNavigation.destinations
@ -163,7 +163,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer> {
contentPadding: const EdgeInsets.symmetric( contentPadding: const EdgeInsets.symmetric(
horizontal: 20, horizontal: 20,
), ),
leading: e.icon, leading: Icon(e.icon, size: 20).paddingAll(2),
title: Text(e.label), title: Text(e.label),
enabled: true, enabled: true,
onTap: () { onTap: () {