[Drawer] 1. improve styling drawer

This commit is contained in:
Stephen
2024-01-17 09:42:15 +07:00
parent f915ed2c10
commit e7685e8576
3 changed files with 79 additions and 56 deletions

View File

@@ -75,29 +75,30 @@ class CustomDrawer extends HookConsumerWidget {
// ),
children: [
DrawerHeader(
decoration: BoxDecoration(
color: Colors.blue,
),
child: Text(
'Drawer Header',
style: TextStyle(
color: Colors.white,
fontSize: 24,
),
),
// decoration: BoxDecoration(
// color: Colors.blue,
// ),
child:
Image(image: AssetImage('images/logo_sismedika_landscape.png')),
),
ListTile(
leading: Icon(
Icons.home,
color: (currentMenu == 0)
? Constant.pcBtnBackgroundColor
: Constant.textGreyv2,
),
title: Text(
'Home',
style: TextStyle(
color: (currentMenu == 0)
? Constant.textWhite
: Constant.textBlack,
? Constant.pcBtnBackgroundColor
: Constant.textGreyv2,
),
),
tileColor: (currentMenu == 0)
? Constant.pcBtnBackgroundColor
: Colors.transparent,
// tileColor: (currentMenu == 0)
// ? Constant.pcBtnBackgroundColor
// : Colors.transparent,
onTap: () {
// Handle navigation to Home screen
Navigator.pop(context);
@@ -106,17 +107,23 @@ class CustomDrawer extends HookConsumerWidget {
},
),
ListTile(
leading: Icon(
Icons.money,
color: (currentMenu == 1)
? Constant.pcBtnBackgroundColor
: Constant.textGreyv2,
),
title: Text(
'Transaksi',
style: TextStyle(
color: (currentMenu == 1)
? Constant.textWhite
: Constant.textBlack,
? Constant.pcBtnBackgroundColor
: Constant.textGreyv2,
),
),
tileColor: (currentMenu == 1)
? Constant.pcBtnBackgroundColor
: Colors.transparent,
// tileColor: (currentMenu == 1)
// ? Constant.pcBtnBackgroundColor
// : Colors.transparent,
onTap: () {
// Handle navigation to Transaksi screen
Navigator.pop(context);
@@ -125,17 +132,23 @@ class CustomDrawer extends HookConsumerWidget {
},
),
ListTile(
leading: Icon(
Icons.history,
color: (currentMenu == 2)
? Constant.pcBtnBackgroundColor
: Constant.textGreyv2,
),
title: Text(
'History Transaksi',
style: TextStyle(
color: (currentMenu == 2)
? Constant.textWhite
: Constant.textBlack,
? Constant.pcBtnBackgroundColor
: Constant.textGreyv2,
),
),
tileColor: (currentMenu == 2)
? Constant.pcBtnBackgroundColor
: Colors.transparent,
// tileColor: (currentMenu == 2)
// ? Constant.pcBtnBackgroundColor
// : Colors.transparent,
onTap: () {
// Handle navigation to User screen
Navigator.pop(context);
@@ -144,17 +157,23 @@ class CustomDrawer extends HookConsumerWidget {
},
),
ListTile(
leading: Icon(
Icons.feed,
color: (currentMenu == 3)
? Constant.pcBtnBackgroundColor
: Constant.textGreyv2,
),
title: Text(
'Report',
style: TextStyle(
color: (currentMenu == 3)
? Constant.textWhite
: Constant.textBlack,
? Constant.pcBtnBackgroundColor
: Constant.textGreyv2,
),
),
tileColor: (currentMenu == 3)
? Constant.pcBtnBackgroundColor
: Colors.transparent,
// tileColor: (currentMenu == 3)
// ? Constant.pcBtnBackgroundColor
// : Colors.transparent,
onTap: () {
// Handle navigation to Transaksi screen
Navigator.pop(context);
@@ -201,9 +220,13 @@ class CustomDrawer extends HookConsumerWidget {
// },
// ),
ListTile(
leading: Icon(
Icons.logout,
color: Constant.textGreyv2,
),
title: Text(
'Logout',
// style: TextStyle(color: Constant.textWhite),
style: TextStyle(color: Constant.textGreyv2),
),
onTap: () {
// di set ke 0 lagi