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, debugShowCheckedModeBanner: false,
// initialRoute: loginRoute, initialRoute: loginRoute,
// initialRoute: splashScreen, // initialRoute: splashScreen,
initialRoute: transaksiRoute, // initialRoute: transaksiRoute,
// initialRoute: reportRoute, // initialRoute: reportRoute,
// initialRoute: testFilePickerRoute, // initialRoute: testFilePickerRoute,
onGenerateRoute: AppRoute.generateRoute, onGenerateRoute: AppRoute.generateRoute,

View File

@@ -33,7 +33,14 @@ class HomeScreen extends HookConsumerWidget {
), ),
child: Scaffold( child: Scaffold(
appBar: AppBar( 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(), drawer: CustomDrawer(),
body: SafeArea( body: SafeArea(

View File

@@ -2,6 +2,7 @@
import 'dart:async'; import 'dart:async';
import 'package:app_petty_cash/widget/sankbar_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
@@ -71,10 +72,11 @@ class LoginFormScreen extends HookConsumerWidget {
isLoading.value = true; isLoading.value = true;
} else if (next is LoginStateError) { } else if (next is LoginStateError) {
isLoading.value = false; isLoading.value = false;
errorMessage.value = next.message; // errorMessage.value = next.message;
Timer(const Duration(seconds: 3), () { // Timer(const Duration(seconds: 3), () {
errorMessage.value = ""; // errorMessage.value = "";
}); // });
SanckbarWidget(context, next.message, snackbarType.warning);
} else if (next is LoginStateDone) { } else if (next is LoginStateDone) {
isLoading.value = false; isLoading.value = false;
isSuccess.value = true; isSuccess.value = true;
@@ -92,10 +94,11 @@ class LoginFormScreen extends HookConsumerWidget {
} }
}); });
return Scaffold( final obscureText = useState<bool>(true);
body: SafeArea(
child: SingleChildScrollView( return ListView(
child: Column( children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
@@ -120,13 +123,12 @@ class LoginFormScreen extends HookConsumerWidget {
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 63), top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20), left: Constant.getActualXPhone(context: context, x: 20),
right: right: Constant.getActualXPhone(context: context, x: 113),
Constant.getActualXPhone(context: context, x: 113),
), ),
child: Text( child: Text(
'Selamat Datang', 'Selamat Datang',
style: Constant.titleH1Login_SelamatDatang( style:
context: context) Constant.titleH1Login_SelamatDatang(context: context)
.copyWith( .copyWith(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Constant.textBlack), color: Constant.textBlack),
@@ -136,8 +138,7 @@ class LoginFormScreen extends HookConsumerWidget {
padding: EdgeInsets.only( padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63), // top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20), left: Constant.getActualXPhone(context: context, x: 20),
right: right: Constant.getActualXPhone(context: context, x: 48),
Constant.getActualXPhone(context: context, x: 48),
), ),
child: Text( child: Text(
'Silahkan masuk untuk mengakses akun Anda', 'Silahkan masuk untuk mengakses akun Anda',
@@ -155,8 +156,7 @@ class LoginFormScreen extends HookConsumerWidget {
padding: EdgeInsets.only( padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63), // top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20), left: Constant.getActualXPhone(context: context, x: 20),
right: right: Constant.getActualXPhone(context: context, x: 20),
Constant.getActualXPhone(context: context, x: 20),
), ),
child: Text( child: Text(
'Email', 'Email',
@@ -171,10 +171,9 @@ class LoginFormScreen extends HookConsumerWidget {
), ),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63), top: Constant.getActualYPhone(context: context, y: 5),
left: Constant.getActualXPhone(context: context, x: 20), left: Constant.getActualXPhone(context: context, x: 20),
right: right: Constant.getActualXPhone(context: context, x: 20),
Constant.getActualXPhone(context: context, x: 20),
), ),
child: TextField( child: TextField(
controller: ctrlEmail, controller: ctrlEmail,
@@ -199,8 +198,8 @@ class LoginFormScreen extends HookConsumerWidget {
width: 1, width: 1,
), ),
), ),
// labelText: "Masukkan Email", labelText: "Email",
// hintText: 'Nama Pengirim', hintText: 'Email',
), ),
), ),
), ),
@@ -214,8 +213,7 @@ class LoginFormScreen extends HookConsumerWidget {
padding: EdgeInsets.only( padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63), // top: Constant.getActualYPhone(context: context, y: 63),
left: Constant.getActualXPhone(context: context, x: 20), left: Constant.getActualXPhone(context: context, x: 20),
right: right: Constant.getActualXPhone(context: context, x: 20),
Constant.getActualXPhone(context: context, x: 20),
), ),
child: Text( child: Text(
'Password', 'Password',
@@ -230,21 +228,32 @@ class LoginFormScreen extends HookConsumerWidget {
), ),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
// top: Constant.getActualYPhone(context: context, y: 63), top: Constant.getActualYPhone(context: context, y: 5),
left: Constant.getActualXPhone(context: context, x: 20), left: Constant.getActualXPhone(context: context, x: 20),
right: right: Constant.getActualXPhone(context: context, x: 20),
Constant.getActualXPhone(context: context, x: 20),
), ),
child: TextField( child: TextField(
obscureText: obscureText.value,
controller: ctrlPassword, controller: ctrlPassword,
decoration: InputDecoration( decoration: InputDecoration(
suffixIcon: IconButton(
icon: Icon(
obscureText.value
? Icons.visibility
: Icons.visibility_off,
color: Constant.textGreyv2,
),
onPressed: () {
obscureText.value = !obscureText.value;
},
),
hintStyle: hintStyle:
Constant.body2_400(context: context).copyWith( Constant.body2_400(context: context).copyWith(
color: Colors.orange, color: Constant.textGreyv2,
), ),
labelStyle: labelStyle:
Constant.body2_400(context: context).copyWith( Constant.body2_400(context: context).copyWith(
color: Colors.orange, color: Constant.textGreyv2,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
@@ -254,29 +263,28 @@ class LoginFormScreen extends HookConsumerWidget {
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Colors.orange, color: Constant.textGreyv2,
width: 1, width: 1,
), ),
), ),
// labelText: "Nama Pengirim", labelText: "Password",
// hintText: 'Nama Pengirim', hintText: 'Password',
), ),
), ),
), ),
if (errorMessage.value != "") ...[ // if (errorMessage.value != "") ...[
SizedBox( // SizedBox(
height: // height: Constant.getActualYPhone(context: context, y: 10),
Constant.getActualYPhone(context: context, y: 10), // ),
), // Center(
Center( // child: Text(
child: Text( // "Peringatan : ${errorMessage.value}",
"Peringatan : ${errorMessage.value}", // style: Constant.titleH7_700(context: context)
style: Constant.titleH7_700(context: context) // .copyWith(color: Constant.textRedProblemMaketing),
.copyWith(color: Constant.textRedProblemMaketing), // ),
), // ),
), // ],
],
SizedBox( SizedBox(
height: Constant.getActualYPhone(context: context, y: 40), height: Constant.getActualYPhone(context: context, y: 40),
@@ -284,14 +292,11 @@ class LoginFormScreen extends HookConsumerWidget {
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: Constant.getActualXPhone(context: context, x: 20), left: Constant.getActualXPhone(context: context, x: 20),
right: right: Constant.getActualXPhone(context: context, x: 20),
Constant.getActualXPhone(context: context, x: 20),
), ),
child: SizedBox( child: SizedBox(
width: width: Constant.getActualXPhone(context: context, x: 390),
Constant.getActualXPhone(context: context, x: 390), height: Constant.getActualYPhone(context: context, y: 50),
height:
Constant.getActualYPhone(context: context, y: 50),
child: ElevatedButton( child: ElevatedButton(
// onPressed: () { // onPressed: () {
// Navigator.of(context).pushNamed(homeRoute); // Navigator.of(context).pushNamed(homeRoute);
@@ -319,8 +324,8 @@ class LoginFormScreen extends HookConsumerWidget {
(st) => (isSuccess.value == true) (st) => (isSuccess.value == true)
? Constant.textGrey ? Constant.textGrey
: Constant.pcBtnBackgroundColor), : Constant.pcBtnBackgroundColor),
shape: MaterialStateProperty.all< shape:
RoundedRectangleBorder>( MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
side: BorderSide( side: BorderSide(
@@ -379,8 +384,7 @@ class LoginFormScreen extends HookConsumerWidget {
), ),
], ],
), ),
), ],
),
); );
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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