Compare commits
2 Commits
main
...
add_drawer
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d23236d6a3 | ||
|
|
bfe30a7c17 |
@@ -91,248 +91,204 @@ class CustomDrawer extends HookConsumerWidget {
|
|||||||
|
|
||||||
final currentMenu = ref.read(currentPageProvider);
|
final currentMenu = ref.read(currentPageProvider);
|
||||||
|
|
||||||
return Drawer(
|
return Container(
|
||||||
elevation: 0,
|
width: Constant.getActualXPhone(context: context, x: 300),
|
||||||
shape: RoundedRectangleBorder(
|
height: Constant.getActualYPhone(context: context, y: 844),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(0))),
|
child: Drawer(
|
||||||
child: Container(
|
elevation: 0,
|
||||||
child: ListView(
|
shape: RoundedRectangleBorder(
|
||||||
// padding: EdgeInsets.only(
|
borderRadius: BorderRadius.all(Radius.circular(0))),
|
||||||
// top: Constant.getActualYPhone(context: context, y: 10),
|
child: Column(
|
||||||
// ),
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Expanded(
|
||||||
// decoration: BoxDecoration(
|
child: ListView(
|
||||||
// border: Border(bottom: BorderSide(color: Colors.transparent)) // <--- use the global theme to change the dividerColor property
|
children: [
|
||||||
// ),
|
Container(
|
||||||
child: Image(
|
child: Image(
|
||||||
image: AssetImage('images/logo_sismedika_landscape.png')),
|
image:
|
||||||
),
|
AssetImage('images/logo_sismedika_landscape.png')),
|
||||||
|
),
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: Constant.getActualYPhone(context: context, y: 8),
|
height: Constant.getActualYPhone(context: context, y: 8),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualYPhone(context: context, y: 10),
|
||||||
|
bottom: Constant.getActualYPhone(context: context, y: 10),
|
||||||
|
right: Constant.getActualXPhone(context: context, x: 24),
|
||||||
|
left: Constant.getActualXPhone(context: context, x: 24),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 300),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.only(
|
||||||
|
// left: Constant.getActualXPhone(context: context, x: 24),
|
||||||
|
// right: Constant.getActualXPhone(context: context, x: 71),
|
||||||
|
// ),
|
||||||
|
// child: Container(
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// borderRadius: BorderRadius.circular(6),
|
||||||
|
// color: Constant.textGrey.withOpacity(0.16),
|
||||||
|
// ),
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.only(
|
||||||
|
// left: Constant.getActualXPhone(context: context, x: 8),
|
||||||
|
// right: Constant.getActualXPhone(context: context, x: 8),
|
||||||
|
// ),
|
||||||
|
// child: Text(
|
||||||
|
// M_CompanyName.value,
|
||||||
|
// style: Constant.body3(context: context).copyWith(
|
||||||
|
// fontWeight: FontWeight.w700,
|
||||||
|
// color: Constant.textGreyv2,
|
||||||
|
// backgroundColor: Constant.textGrey.withOpacity(0.16),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
Chip(
|
||||||
|
backgroundColor: Constant.textGrey.withOpacity(0.16),
|
||||||
|
label: Text(
|
||||||
|
M_CompanyName.value,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(
|
||||||
|
Icons.home,
|
||||||
|
color: (currentMenu == 0)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'Home',
|
||||||
|
style: TextStyle(
|
||||||
|
color: (currentMenu == 0)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
// Handle navigation to Home screen
|
||||||
|
Navigator.pop(context);
|
||||||
|
ref.read(currentPageProvider.state).update((state) => 0);
|
||||||
|
Navigator.pushNamed(context, homeRoute);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(
|
||||||
|
Icons.money,
|
||||||
|
color: (currentMenu == 1)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'Transaksi',
|
||||||
|
style: TextStyle(
|
||||||
|
color: (currentMenu == 1)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
// Handle navigation to Transaksi screen
|
||||||
|
Navigator.pop(context);
|
||||||
|
ref.read(currentPageProvider.state).update((state) => 1);
|
||||||
|
Navigator.pushNamed(context, transaksiRoute);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(
|
||||||
|
Icons.history,
|
||||||
|
color: (currentMenu == 2)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'History Transaksi',
|
||||||
|
style: TextStyle(
|
||||||
|
color: (currentMenu == 2)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
// Handle navigation to User screen
|
||||||
|
Navigator.pop(context);
|
||||||
|
ref.read(currentPageProvider.state).update((state) => 2);
|
||||||
|
Navigator.pushNamed(context, historyTransaksiRoute);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(
|
||||||
|
Icons.feed,
|
||||||
|
color: (currentMenu == 3)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'Report',
|
||||||
|
style: TextStyle(
|
||||||
|
color: (currentMenu == 3)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
// Handle navigation to Transaksi screen
|
||||||
|
Navigator.pop(context);
|
||||||
|
ref.read(currentPageProvider.state).update((state) => 3);
|
||||||
|
Navigator.pushNamed(context, reportRoute);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(
|
||||||
|
Icons.logout,
|
||||||
|
color: Constant.textGreyv2,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'Logout',
|
||||||
|
style: TextStyle(color: Constant.textGreyv2),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
// di set ke 0 lagi
|
||||||
|
ref.read(currentPageProvider.state).update((state) => 0);
|
||||||
|
ref.read(logoutProvider.notifier).logout(
|
||||||
|
M_UserID: selectedUser?.model.M_UserID ?? "",
|
||||||
|
M_UserUsername:
|
||||||
|
selectedUser?.model.M_UserUsername ?? "",
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Versi Aplikasi
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: Constant.getActualYPhone(context: context, y: 10),
|
right: Constant.getActualXPhone(context: context, x: 20),
|
||||||
bottom: Constant.getActualYPhone(context: context, y: 10),
|
bottom: Constant.getActualYPhone(context: context, y: 10),
|
||||||
right: Constant.getActualXPhone(context: context, x: 24),
|
|
||||||
left: Constant.getActualXPhone(context: context, x: 24),
|
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Align(
|
||||||
width: Constant.getActualXPhone(context: context, x: 300),
|
alignment: Alignment.bottomRight,
|
||||||
),
|
child: Text(
|
||||||
),
|
'Versi ${Constant.version}',
|
||||||
|
style: Constant.titleH4Login(context: context)
|
||||||
// Expanded(
|
.copyWith(color: Constant.textGrey),
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsets.only(
|
|
||||||
// left: Constant.getActualXPhone(context: context, x: 24),
|
|
||||||
// right: Constant.getActualXPhone(context: context, x: 71),
|
|
||||||
// ),
|
|
||||||
// child: Container(
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// borderRadius: BorderRadius.circular(6),
|
|
||||||
// color: Constant.textGrey.withOpacity(0.16),
|
|
||||||
// ),
|
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsets.only(
|
|
||||||
// left: Constant.getActualXPhone(context: context, x: 8),
|
|
||||||
// right: Constant.getActualXPhone(context: context, x: 8),
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// M_CompanyName.value,
|
|
||||||
// style: Constant.body3(context: context).copyWith(
|
|
||||||
// fontWeight: FontWeight.w700,
|
|
||||||
// color: Constant.textGreyv2,
|
|
||||||
// backgroundColor: Constant.textGrey.withOpacity(0.16),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
|
|
||||||
Chip(
|
|
||||||
backgroundColor: Constant.textGrey.withOpacity(0.16),
|
|
||||||
label: Text(
|
|
||||||
M_CompanyName.value,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Constant.textGreyv2,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
ListTile(
|
|
||||||
leading: Icon(
|
|
||||||
Icons.home,
|
|
||||||
color: (currentMenu == 0)
|
|
||||||
? Constant.pcBtnBackgroundColor
|
|
||||||
: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Home',
|
|
||||||
style: TextStyle(
|
|
||||||
color: (currentMenu == 0)
|
|
||||||
? Constant.pcBtnBackgroundColor
|
|
||||||
: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// tileColor: (currentMenu == 0)
|
|
||||||
// ? Constant.pcBtnBackgroundColor
|
|
||||||
// : Colors.transparent,
|
|
||||||
onTap: () {
|
|
||||||
// Handle navigation to Home screen
|
|
||||||
Navigator.pop(context);
|
|
||||||
ref.read(currentPageProvider.state).update((state) => 0);
|
|
||||||
Navigator.pushNamed(context, homeRoute);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
leading: Icon(
|
|
||||||
Icons.money,
|
|
||||||
color: (currentMenu == 1)
|
|
||||||
? Constant.pcBtnBackgroundColor
|
|
||||||
: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Transaksi',
|
|
||||||
style: TextStyle(
|
|
||||||
color: (currentMenu == 1)
|
|
||||||
? Constant.pcBtnBackgroundColor
|
|
||||||
: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// tileColor: (currentMenu == 1)
|
|
||||||
// ? Constant.pcBtnBackgroundColor
|
|
||||||
// : Colors.transparent,
|
|
||||||
onTap: () {
|
|
||||||
// Handle navigation to Transaksi screen
|
|
||||||
Navigator.pop(context);
|
|
||||||
ref.read(currentPageProvider.state).update((state) => 1);
|
|
||||||
Navigator.pushNamed(context, transaksiRoute);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
leading: Icon(
|
|
||||||
Icons.history,
|
|
||||||
color: (currentMenu == 2)
|
|
||||||
? Constant.pcBtnBackgroundColor
|
|
||||||
: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'History Transaksi',
|
|
||||||
style: TextStyle(
|
|
||||||
color: (currentMenu == 2)
|
|
||||||
? Constant.pcBtnBackgroundColor
|
|
||||||
: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// tileColor: (currentMenu == 2)
|
|
||||||
// ? Constant.pcBtnBackgroundColor
|
|
||||||
// : Colors.transparent,
|
|
||||||
onTap: () {
|
|
||||||
// Handle navigation to User screen
|
|
||||||
Navigator.pop(context);
|
|
||||||
ref.read(currentPageProvider.state).update((state) => 2);
|
|
||||||
Navigator.pushNamed(context, historyTransaksiRoute);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
leading: Icon(
|
|
||||||
Icons.feed,
|
|
||||||
color: (currentMenu == 3)
|
|
||||||
? Constant.pcBtnBackgroundColor
|
|
||||||
: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Report',
|
|
||||||
style: TextStyle(
|
|
||||||
color: (currentMenu == 3)
|
|
||||||
? Constant.pcBtnBackgroundColor
|
|
||||||
: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// tileColor: (currentMenu == 3)
|
|
||||||
// ? Constant.pcBtnBackgroundColor
|
|
||||||
// : Colors.transparent,
|
|
||||||
onTap: () {
|
|
||||||
// Handle navigation to Transaksi screen
|
|
||||||
Navigator.pop(context);
|
|
||||||
ref.read(currentPageProvider.state).update((state) => 3);
|
|
||||||
Navigator.pushNamed(context, reportRoute);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
// ListTile(
|
|
||||||
// title: Text(
|
|
||||||
// 'User',
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: (currentMenu == 4)
|
|
||||||
// ? Constant.textWhite
|
|
||||||
// : Constant.textBlack,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// tileColor: (currentMenu == 4)
|
|
||||||
// ? Constant.pcBtnBackgroundColor
|
|
||||||
// : Colors.transparent,
|
|
||||||
// onTap: () {
|
|
||||||
// // Handle navigation to User screen
|
|
||||||
// Navigator.pop(context);
|
|
||||||
// ref.read(currentPageProvider.state).update((state) => 4);
|
|
||||||
// Navigator.pushNamed(context, userRoute);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ListTile(
|
|
||||||
// title: Text(
|
|
||||||
// 'Change Company',
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: (currentMenu == 5)
|
|
||||||
// ? Constant.textWhite
|
|
||||||
// : Constant.textBlack,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// tileColor: (currentMenu == 5)
|
|
||||||
// ? Constant.pcBtnBackgroundColor
|
|
||||||
// : Colors.transparent,
|
|
||||||
// onTap: () {
|
|
||||||
// // Handle navigation to User screen
|
|
||||||
// Navigator.pop(context);
|
|
||||||
// ref.read(currentPageProvider.state).update((state) => 5);
|
|
||||||
// Navigator.pushNamed(context, changeCompanyRoute);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
ListTile(
|
|
||||||
leading: Icon(
|
|
||||||
Icons.logout,
|
|
||||||
color: Constant.textGreyv2,
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Logout',
|
|
||||||
style: TextStyle(color: Constant.textGreyv2),
|
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
// di set ke 0 lagi
|
|
||||||
ref.read(currentPageProvider.state).update((state) => 0);
|
|
||||||
ref.read(logoutProvider.notifier).logout(
|
|
||||||
M_UserID: selectedUser?.model.M_UserID ?? "",
|
|
||||||
M_UserUsername: selectedUser?.model.M_UserUsername ?? "",
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
Spacer(),
|
|
||||||
|
|
||||||
// Versi Aplikasi
|
|
||||||
ListTile(
|
|
||||||
title: Text(
|
|
||||||
'Versi ${Constant.version}',
|
|
||||||
style: Constant.titleH4Login(context: context)
|
|
||||||
.copyWith(color: Constant.textGrey),
|
|
||||||
),
|
|
||||||
onTap: () {},
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user