diff --git a/app_petty_cash/fonts/PublicSans-Bold.ttf b/app_petty_cash/fonts/PublicSans-Bold.ttf new file mode 100644 index 0000000..7a14109 Binary files /dev/null and b/app_petty_cash/fonts/PublicSans-Bold.ttf differ diff --git a/app_petty_cash/lib/main.dart b/app_petty_cash/lib/main.dart index 175c9fe..f3acc47 100644 --- a/app_petty_cash/lib/main.dart +++ b/app_petty_cash/lib/main.dart @@ -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, diff --git a/app_petty_cash/lib/screen/home/home_screen.dart b/app_petty_cash/lib/screen/home/home_screen.dart index 606c5b2..b279317 100644 --- a/app_petty_cash/lib/screen/home/home_screen.dart +++ b/app_petty_cash/lib/screen/home/home_screen.dart @@ -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( diff --git a/app_petty_cash/lib/screen/login/login_form.dart b/app_petty_cash/lib/screen/login/login_form.dart index 8b1713b..e064e82 100644 --- a/app_petty_cash/lib/screen/login/login_form.dart +++ b/app_petty_cash/lib/screen/login/login_form.dart @@ -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(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( + 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), ), - ], - ), + ), + ], ), - ], - ), + ), + ], ), - ), + ], ); } } diff --git a/app_petty_cash/lib/screen/login/login_screen.dart b/app_petty_cash/lib/screen/login/login_screen.dart index e71f394..3feb10c 100644 --- a/app_petty_cash/lib/screen/login/login_screen.dart +++ b/app_petty_cash/lib/screen/login/login_screen.dart @@ -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, diff --git a/app_petty_cash/lib/screen/report/report_screen.dart b/app_petty_cash/lib/screen/report/report_screen.dart index 6fa2e5c..75318aa 100644 --- a/app_petty_cash/lib/screen/report/report_screen.dart +++ b/app_petty_cash/lib/screen/report/report_screen.dart @@ -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( diff --git a/app_petty_cash/lib/screen/transaksi/transaksi_screen.dart b/app_petty_cash/lib/screen/transaksi/transaksi_screen.dart index f2c6375..3dfedab 100644 --- a/app_petty_cash/lib/screen/transaksi/transaksi_screen.dart +++ b/app_petty_cash/lib/screen/transaksi/transaksi_screen.dart @@ -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(), "", ); diff --git a/app_petty_cash/lib/screen/user/user_screen.dart b/app_petty_cash/lib/screen/user/user_screen.dart index 3f48330..9939327 100644 --- a/app_petty_cash/lib/screen/user/user_screen.dart +++ b/app_petty_cash/lib/screen/user/user_screen.dart @@ -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( diff --git a/app_petty_cash/lib/widget/custom_drawer.dart b/app_petty_cash/lib/widget/custom_drawer.dart index d25b359..2c352b6 100644 --- a/app_petty_cash/lib/widget/custom_drawer.dart +++ b/app_petty_cash/lib/widget/custom_drawer.dart @@ -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 ?? "", diff --git a/app_petty_cash/pubspec.yaml b/app_petty_cash/pubspec.yaml index 44d74ea..93edb0c 100644 --- a/app_petty_cash/pubspec.yaml +++ b/app_petty_cash/pubspec.yaml @@ -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