step 14 : fix userid transaksi post, typography, login, drawer

This commit is contained in:
sindhu
2024-01-16 08:03:25 +07:00
parent 15f63232a8
commit 088c18f536
10 changed files with 388 additions and 333 deletions

Binary file not shown.

View File

@@ -38,9 +38,9 @@ class MyApp extends StatelessWidget {
},
),
debugShowCheckedModeBanner: false,
// initialRoute: loginRoute,
initialRoute: loginRoute,
// initialRoute: splashScreen,
initialRoute: transaksiRoute,
// initialRoute: transaksiRoute,
// initialRoute: reportRoute,
// initialRoute: testFilePickerRoute,
onGenerateRoute: AppRoute.generateRoute,

View File

@@ -33,7 +33,14 @@ class HomeScreen extends HookConsumerWidget {
),
child: Scaffold(
appBar: AppBar(
title: Text('Home Screen'),
title: Text(
'Home Screen',
style: TextStyle(color: Constant.textWhite),
),
backgroundColor: Constant.pcBtnBackgroundColor,
iconTheme: IconThemeData(
color: Constant.textWhite,
),
),
drawer: CustomDrawer(),
body: SafeArea(

View File

@@ -2,6 +2,7 @@
import 'dart:async';
import 'package:app_petty_cash/widget/sankbar_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
@@ -71,10 +72,11 @@ class LoginFormScreen extends HookConsumerWidget {
isLoading.value = true;
} else if (next is LoginStateError) {
isLoading.value = false;
errorMessage.value = next.message;
Timer(const Duration(seconds: 3), () {
errorMessage.value = "";
});
// errorMessage.value = next.message;
// Timer(const Duration(seconds: 3), () {
// errorMessage.value = "";
// });
SanckbarWidget(context, next.message, snackbarType.warning);
} else if (next is LoginStateDone) {
isLoading.value = false;
isSuccess.value = true;
@@ -92,295 +94,297 @@ class LoginFormScreen extends HookConsumerWidget {
}
});
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
width: Constant.getActualXPhone(context: context, x: 390),
height: Constant.getActualYPhone(context: context, y: 359),
// decoration: BoxDecoration(color: Colors.grey),
child: Image.asset(
"images/login_top_bg.png",
fit: BoxFit.fill,
// scale: 1,
),
final obscureText = useState<bool>(true);
return ListView(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
width: Constant.getActualXPhone(context: context, x: 390),
height: Constant.getActualYPhone(context: context, y: 359),
// decoration: BoxDecoration(color: Colors.grey),
child: Image.asset(
"images/login_top_bg.png",
fit: BoxFit.fill,
// scale: 1,
),
Container(
width: Constant.getActualXPhone(context: context, x: 390),
height: Constant.getActualYPhone(context: context, y: 485),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right:
Constant.getActualXPhone(context: context, x: 113),
),
child: Text(
'Selamat Datang',
style: Constant.titleH1Login_SelamatDatang(
context: context)
.copyWith(
fontWeight: FontWeight.w600,
color: Constant.textBlack),
),
),
Container(
width: Constant.getActualXPhone(context: context, x: 390),
height: Constant.getActualYPhone(context: context, y: 485),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right: Constant.getActualXPhone(context: context, x: 113),
),
Padding(
padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right:
Constant.getActualXPhone(context: context, x: 48),
),
child: Text(
'Silahkan masuk untuk mengakses akun Anda',
style: Constant.body1(context: context).copyWith(
fontWeight: FontWeight.w600,
color: Constant.textGreyv2),
),
child: Text(
'Selamat Datang',
style:
Constant.titleH1Login_SelamatDatang(context: context)
.copyWith(
fontWeight: FontWeight.w600,
color: Constant.textBlack),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 39),
),
Padding(
padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right: Constant.getActualXPhone(context: context, x: 48),
),
child: Text(
'Silahkan masuk untuk mengakses akun Anda',
style: Constant.body1(context: context).copyWith(
fontWeight: FontWeight.w600,
color: Constant.textGreyv2),
),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 39),
),
// inputan email
Padding(
padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right:
Constant.getActualXPhone(context: context, x: 20),
),
child: Text(
'Email',
style: Constant.body1_400_dibulan(context: context)
.copyWith(
fontWeight: FontWeight.w600,
color: Constant.textBlack),
// inputan email
Padding(
padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right: Constant.getActualXPhone(context: context, x: 20),
),
child: Text(
'Email',
style: Constant.body1_400_dibulan(context: context)
.copyWith(
fontWeight: FontWeight.w600,
color: Constant.textBlack),
),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 4),
),
Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 5),
left: Constant.getActualXPhone(context: context, x: 20),
right: Constant.getActualXPhone(context: context, x: 20),
),
child: TextField(
controller: ctrlEmail,
decoration: InputDecoration(
hintStyle:
Constant.body2_400(context: context).copyWith(
color: Constant.textGreyv2,
),
labelStyle:
Constant.body2_400(context: context).copyWith(
color: Constant.textGreyv2,
),
border: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
width: 1,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Constant.textGreyv2,
width: 1,
),
),
labelText: "Email",
hintText: 'Email',
),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 4),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 21),
),
// password
Padding(
padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right: Constant.getActualXPhone(context: context, x: 20),
),
Padding(
padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right:
Constant.getActualXPhone(context: context, x: 20),
),
child: TextField(
controller: ctrlEmail,
decoration: InputDecoration(
hintStyle:
Constant.body2_400(context: context).copyWith(
child: Text(
'Password',
style: Constant.body1_400_dibulan(context: context)
.copyWith(
fontWeight: FontWeight.w600,
color: Constant.textBlack),
),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 4),
),
Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 5),
left: Constant.getActualXPhone(context: context, x: 20),
right: Constant.getActualXPhone(context: context, x: 20),
),
child: TextField(
obscureText: obscureText.value,
controller: ctrlPassword,
decoration: InputDecoration(
suffixIcon: IconButton(
icon: Icon(
obscureText.value
? Icons.visibility
: Icons.visibility_off,
color: Constant.textGreyv2,
),
labelStyle:
Constant.body2_400(context: context).copyWith(
onPressed: () {
obscureText.value = !obscureText.value;
},
),
hintStyle:
Constant.body2_400(context: context).copyWith(
color: Constant.textGreyv2,
),
labelStyle:
Constant.body2_400(context: context).copyWith(
color: Constant.textGreyv2,
),
border: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
width: 1,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Constant.textGreyv2,
width: 1,
),
border: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
width: 1,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Constant.textGreyv2,
width: 1,
),
),
// labelText: "Masukkan Email",
// hintText: 'Nama Pengirim',
),
labelText: "Password",
hintText: 'Password',
),
),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 21),
),
// if (errorMessage.value != "") ...[
// SizedBox(
// height: Constant.getActualYPhone(context: context, y: 10),
// ),
// Center(
// child: Text(
// "Peringatan : ${errorMessage.value}",
// style: Constant.titleH7_700(context: context)
// .copyWith(color: Constant.textRedProblemMaketing),
// ),
// ),
// ],
// password
Padding(
padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right:
Constant.getActualXPhone(context: context, x: 20),
),
child: Text(
'Password',
style: Constant.body1_400_dibulan(context: context)
.copyWith(
fontWeight: FontWeight.w600,
color: Constant.textBlack),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 40),
),
Padding(
padding: EdgeInsets.only(
left: Constant.getActualXPhone(context: context, x: 20),
right: Constant.getActualXPhone(context: context, x: 20),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 4),
),
Padding(
padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20),
right:
Constant.getActualXPhone(context: context, x: 20),
),
child: TextField(
controller: ctrlPassword,
decoration: InputDecoration(
hintStyle:
Constant.body2_400(context: context).copyWith(
color: Colors.orange,
),
labelStyle:
Constant.body2_400(context: context).copyWith(
color: Colors.orange,
),
border: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
width: 1,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
width: 1,
),
),
// labelText: "Nama Pengirim",
// hintText: 'Nama Pengirim',
),
),
),
if (errorMessage.value != "") ...[
SizedBox(
height:
Constant.getActualYPhone(context: context, y: 10),
),
Center(
child: Text(
"Peringatan : ${errorMessage.value}",
style: Constant.titleH7_700(context: context)
.copyWith(color: Constant.textRedProblemMaketing),
),
),
],
SizedBox(
height: Constant.getActualYPhone(context: context, y: 40),
),
Padding(
padding: EdgeInsets.only(
left: Constant.getActualXPhone(context: context, x: 20),
right:
Constant.getActualXPhone(context: context, x: 20),
),
child: SizedBox(
width:
Constant.getActualXPhone(context: context, x: 390),
height:
Constant.getActualYPhone(context: context, y: 50),
child: ElevatedButton(
// onPressed: () {
// Navigator.of(context).pushNamed(homeRoute);
// },
onPressed: (isSuccess.value == true)
? () {}
: () {
if (ctrlEmail.text.isEmpty ||
ctrlPassword.text.isEmpty) {
isLoading.value = true;
errorMessage.value = 'Inputan harus diisi';
Timer(const Duration(seconds: 3), () {
isLoading.value = false;
errorMessage.value = "";
});
} else {
ref.read(loginProvider.notifier).login(
email: ctrlEmail.text,
password: ctrlPassword.text,
);
}
},
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith(
(st) => (isSuccess.value == true)
? Constant.textGrey
: Constant.pcBtnBackgroundColor),
shape: MaterialStateProperty.all<
RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(
color: Constant.pcBtnBackgroundColor,
),
child: SizedBox(
width: Constant.getActualXPhone(context: context, x: 390),
height: Constant.getActualYPhone(context: context, y: 50),
child: ElevatedButton(
// onPressed: () {
// Navigator.of(context).pushNamed(homeRoute);
// },
onPressed: (isSuccess.value == true)
? () {}
: () {
if (ctrlEmail.text.isEmpty ||
ctrlPassword.text.isEmpty) {
isLoading.value = true;
errorMessage.value = 'Inputan harus diisi';
Timer(const Duration(seconds: 3), () {
isLoading.value = false;
errorMessage.value = "";
});
} else {
ref.read(loginProvider.notifier).login(
email: ctrlEmail.text,
password: ctrlPassword.text,
);
}
},
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith(
(st) => (isSuccess.value == true)
? Constant.textGrey
: Constant.pcBtnBackgroundColor),
shape:
MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(
color: Constant.pcBtnBackgroundColor,
),
),
shadowColor:
MaterialStateProperty.all(Color(0xffff48423d)),
elevation: MaterialStateProperty.all(4.0),
),
child: Stack(
children: [
(isLoading.value)
? SizedBox(
width: Constant.getActualXPhone(
context: context, x: 24),
height: Constant.getActualYPhone(
context: context, y: 32),
child: Center(
child: CircularProgressIndicator(
color: Colors.white,
),
),
)
: Align(
alignment: Alignment.center,
child: Text(
'Login',
style: Constant.titleH3_700(
context: context)
.copyWith(
color: Constant.textLoginColor),
shadowColor:
MaterialStateProperty.all(Color(0xffff48423d)),
elevation: MaterialStateProperty.all(4.0),
),
child: Stack(
children: [
(isLoading.value)
? SizedBox(
width: Constant.getActualXPhone(
context: context, x: 24),
height: Constant.getActualYPhone(
context: context, y: 32),
child: Center(
child: CircularProgressIndicator(
color: Colors.white,
),
),
],
),
)
: Align(
alignment: Alignment.center,
child: Text(
'Login',
style: Constant.titleH3_700(
context: context)
.copyWith(
color: Constant.textLoginColor),
),
),
],
),
),
),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 10),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 10),
),
Align(
alignment: Alignment.center,
child: Text(
'Versi ${Constant.version}',
style: Constant.titleH4Login(context: context)
.copyWith(color: Constant.textGrey),
),
Align(
alignment: Alignment.center,
child: Text(
'Versi ${Constant.version}',
style: Constant.titleH4Login(context: context)
.copyWith(color: Constant.textGrey),
),
],
),
),
],
),
],
),
),
],
),
),
],
);
}
}

View File

@@ -39,7 +39,7 @@ class LoginScreen extends HookConsumerWidget {
);
ref.read(currentUserProvider.notifier).state = authModel;
// ref.read(currentPageProvider.state).update((state) => 0);
ref.read(currentPageProvider.state).update((state) => 0);
Navigator.of(context).pushNamedAndRemoveUntil(
homeRoute,

View File

@@ -47,7 +47,14 @@ class ReportScreen extends HookConsumerWidget {
),
child: Scaffold(
appBar: AppBar(
title: Text('Report'),
title: Text(
'Report',
style: TextStyle(color: Constant.textWhite),
),
backgroundColor: Constant.pcBtnBackgroundColor,
iconTheme: IconThemeData(
color: Constant.textWhite,
),
),
drawer: CustomDrawer(),
body: SafeArea(

View File

@@ -176,6 +176,8 @@ class TransaksiScreen extends HookConsumerWidget {
// print('Height : ${sbHeight}');
final userIDLogin = ref.read(currentUserProvider)?.model.M_UserID ?? "0";
return Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 30),
@@ -183,7 +185,14 @@ class TransaksiScreen extends HookConsumerWidget {
child: Scaffold(
appBar: AppBar(
// centerTitle: true,
title: Text('Transaksi'),
title: Text(
'Transaksi',
style: TextStyle(color: Constant.textWhite),
),
backgroundColor: Constant.pcBtnBackgroundColor,
iconTheme: IconThemeData(
color: Constant.textWhite,
),
),
drawer: CustomDrawer(),
body: SafeArea(
@@ -210,11 +219,11 @@ class TransaksiScreen extends HookConsumerWidget {
decoration: InputDecoration(
hintStyle:
Constant.body2_400(context: context).copyWith(
color: Colors.orange,
color: Constant.textGreyv2,
),
labelStyle:
Constant.body2_400(context: context).copyWith(
color: Colors.orange,
color: Constant.textGreyv2,
),
border: OutlineInputBorder(
borderSide: BorderSide(
@@ -224,12 +233,12 @@ class TransaksiScreen extends HookConsumerWidget {
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
color: Constant.textGreyv2,
width: 1,
),
),
// labelText: "Tanggal Awal",
hintText: 'Tanggal Awal',
hintText: 'Tanggal Transaksi',
// suffixIcon: isLoadingFilterScope.value
// ? SizedBox(
// width: Constant.getActualXPhone(
@@ -288,9 +297,9 @@ class TransaksiScreen extends HookConsumerWidget {
height: Constant.getActualYPhone(context: context, y: 20),
),
// jenis
// tipe transaksi
Text(
'Jenis',
'Tipe Transaksi',
style: Constant.body1(context: context).copyWith(
fontWeight: FontWeight.w600, color: Constant.textBlack),
),
@@ -521,11 +530,11 @@ class TransaksiScreen extends HookConsumerWidget {
decoration: InputDecoration(
hintStyle:
Constant.body2_400(context: context).copyWith(
color: Colors.orange,
color: Constant.textGreyv2,
),
labelStyle:
Constant.body2_400(context: context).copyWith(
color: Colors.orange,
color: Constant.textGreyv2,
),
border: OutlineInputBorder(
borderSide: BorderSide(
@@ -535,26 +544,15 @@ class TransaksiScreen extends HookConsumerWidget {
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
color: Constant.textGreyv2,
width: 1,
),
),
// labelText: "Nama Pengirim",
// hintText: 'Nama Pengirim',
labelText: "Nama Pengirim",
hintText: 'Nama Pengirim',
),
),
],
// CustomTextField(
// isNumber: false,
// isReadOnly: false,
// ctrl: ctrlNamaPengirim,
// isPassword: false,
// isMaxLine: false,
// hintText: "Nama Pengirim",
// labelText: "Nama Pengirim",
// // onChange: (String searchResult) {},
// isPrefix: false,
// ),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 20),
),
@@ -573,10 +571,10 @@ class TransaksiScreen extends HookConsumerWidget {
keyboardType: TextInputType.number,
decoration: InputDecoration(
hintStyle: Constant.body2_400(context: context).copyWith(
color: Colors.orange,
color: Constant.textGreyv2,
),
labelStyle: Constant.body2_400(context: context).copyWith(
color: Colors.orange,
color: Constant.textGreyv2,
),
border: OutlineInputBorder(
borderSide: BorderSide(
@@ -586,25 +584,14 @@ class TransaksiScreen extends HookConsumerWidget {
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
color: Constant.textGreyv2,
width: 1,
),
),
// labelText: "Jumlah",
// hintText: 'Jumlah',
labelText: "Jumlah",
hintText: 'Jumlah',
),
),
// CustomTextField(
// isNumber: true,
// isReadOnly: false,
// ctrl: ctrlJumlah,
// isPassword: false,
// isMaxLine: false,
// hintText: "Jumlah",
// labelText: "Jumlah",
// // onChange: (String searchResult) {},
// isPrefix: false,
// ),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 20),
@@ -625,10 +612,10 @@ class TransaksiScreen extends HookConsumerWidget {
maxLines: 4,
decoration: InputDecoration(
hintStyle: Constant.body2_400(context: context).copyWith(
color: Colors.orange,
color: Constant.textGreyv2,
),
labelStyle: Constant.body2_400(context: context).copyWith(
color: Colors.orange,
color: Constant.textGreyv2,
),
border: OutlineInputBorder(
borderSide: BorderSide(
@@ -638,26 +625,14 @@ class TransaksiScreen extends HookConsumerWidget {
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
color: Constant.textGreyv2,
width: 1,
),
),
// labelText: "Catatan",
// hintText: 'Catatan',
labelText: "Catatan",
hintText: 'Catatan',
),
),
// CustomTextField(
// isNumber: false,
// isReadOnly: false,
// ctrl: ctrlCatatan,
// isPassword: false,
// isMaxLine: true,
// isTextArea: true,
// hintText: "Catatan",
// labelText: "Catatan",
// // onChange: (String searchResult) {},
// isPrefix: false,
// ),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 20),
@@ -762,7 +737,8 @@ class TransaksiScreen extends HookConsumerWidget {
selectedListCategory.value.categoryid.toString(),
"jumlah": ctrlJumlah.value.text.toString(),
"catatan": ctrlCatatan.value.text.toString(),
"userid": "1",
// "userid": "1",
"userid": userIDLogin,
"namapengirim": ctrlNamaPengirim.value.text.toString(),
"url": "",
};
@@ -773,7 +749,8 @@ class TransaksiScreen extends HookConsumerWidget {
selectedListCategory.value.categoryid.toString(),
ctrlJumlah.value.text.toString(),
ctrlCatatan.value.text.toString(),
"1",
// "1",
userIDLogin,
ctrlNamaPengirim.value.text.toString(),
"",
);

View File

@@ -32,7 +32,14 @@ class UserScreen extends HookConsumerWidget {
),
child: Scaffold(
appBar: AppBar(
title: Text('User'),
title: Text(
'User',
style: TextStyle(color: Constant.textWhite),
),
backgroundColor: Constant.pcBtnBackgroundColor,
iconTheme: IconThemeData(
color: Constant.textWhite,
),
),
drawer: CustomDrawer(),
body: SafeArea(

View File

@@ -7,6 +7,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import '../app/constant.dart';
import '../app/route.dart';
import '../provider/current_menu_provider.dart';
import '../provider/current_user_provider.dart';
import '../screen/login/logout_provider.dart';
@@ -64,6 +65,9 @@ class CustomDrawer extends HookConsumerWidget {
});
}
});
final currentMenu = ref.read(currentPageProvider);
return Drawer(
child: ListView(
padding: EdgeInsets.only(
@@ -83,40 +87,89 @@ class CustomDrawer extends HookConsumerWidget {
// ),
// ),
ListTile(
title: Text('Home'),
title: Text(
'Home',
style: TextStyle(
color: (currentMenu == 0)
? Constant.textWhite
: Constant.textBlack,
),
),
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(
title: Text('Transaksi'),
title: Text(
'Transaksi',
style: TextStyle(
color: (currentMenu == 1)
? Constant.textWhite
: Constant.textBlack,
),
),
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(
title: Text('Report'),
title: Text(
'Report',
style: TextStyle(
color: (currentMenu == 2)
? Constant.textWhite
: Constant.textBlack,
),
),
tileColor: (currentMenu == 2)
? Constant.pcBtnBackgroundColor
: Colors.transparent,
onTap: () {
// Handle navigation to Transaksi screen
Navigator.pop(context);
ref.read(currentPageProvider.state).update((state) => 2);
Navigator.pushNamed(context, reportRoute);
},
),
ListTile(
title: Text('User'),
title: Text(
'User',
style: TextStyle(
color: (currentMenu == 3)
? Constant.textWhite
: Constant.textBlack,
),
),
tileColor: (currentMenu == 3)
? Constant.pcBtnBackgroundColor
: Colors.transparent,
onTap: () {
// Handle navigation to User screen
Navigator.pop(context);
ref.read(currentPageProvider.state).update((state) => 3);
Navigator.pushNamed(context, userRoute);
},
),
ListTile(
title: Text('Logout'),
title: Text(
'Logout',
// style: TextStyle(color: Constant.textWhite),
),
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 ?? "",

View File

@@ -90,9 +90,9 @@ flutter:
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: Inter
- family: PublicSans
fonts:
- asset: fonts/Inter-Bold.ttf
- asset: fonts/PublicSans-Bold.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro