step 14 : fix userid transaksi post, typography, login, drawer
This commit is contained in:
BIN
app_petty_cash/fonts/PublicSans-Bold.ttf
Normal file
BIN
app_petty_cash/fonts/PublicSans-Bold.ttf
Normal file
Binary file not shown.
@@ -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,
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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,295 +94,297 @@ class LoginFormScreen extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return Scaffold(
|
final obscureText = useState<bool>(true);
|
||||||
body: SafeArea(
|
|
||||||
child: SingleChildScrollView(
|
return ListView(
|
||||||
child: Column(
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Container(
|
children: [
|
||||||
width: Constant.getActualXPhone(context: context, x: 390),
|
Container(
|
||||||
height: Constant.getActualYPhone(context: context, y: 359),
|
width: Constant.getActualXPhone(context: context, x: 390),
|
||||||
// decoration: BoxDecoration(color: Colors.grey),
|
height: Constant.getActualYPhone(context: context, y: 359),
|
||||||
child: Image.asset(
|
// decoration: BoxDecoration(color: Colors.grey),
|
||||||
"images/login_top_bg.png",
|
child: Image.asset(
|
||||||
fit: BoxFit.fill,
|
"images/login_top_bg.png",
|
||||||
// scale: 1,
|
fit: BoxFit.fill,
|
||||||
),
|
// scale: 1,
|
||||||
),
|
),
|
||||||
Container(
|
),
|
||||||
width: Constant.getActualXPhone(context: context, x: 390),
|
Container(
|
||||||
height: Constant.getActualYPhone(context: context, y: 485),
|
width: Constant.getActualXPhone(context: context, x: 390),
|
||||||
child: Column(
|
height: Constant.getActualYPhone(context: context, y: 485),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Padding(
|
children: [
|
||||||
padding: EdgeInsets.only(
|
Padding(
|
||||||
top: Constant.getActualYPhone(context: context, y: 63),
|
padding: EdgeInsets.only(
|
||||||
left: Constant.getActualXPhone(context: context, x: 20),
|
top: Constant.getActualYPhone(context: context, y: 63),
|
||||||
right:
|
left: Constant.getActualXPhone(context: context, x: 20),
|
||||||
Constant.getActualXPhone(context: context, x: 113),
|
right: Constant.getActualXPhone(context: context, x: 113),
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'Selamat Datang',
|
|
||||||
style: Constant.titleH1Login_SelamatDatang(
|
|
||||||
context: context)
|
|
||||||
.copyWith(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: Constant.textBlack),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Padding(
|
child: Text(
|
||||||
padding: EdgeInsets.only(
|
'Selamat Datang',
|
||||||
// top: Constant.getActualYPhone(context: context, y: 63),
|
style:
|
||||||
left: Constant.getActualXPhone(context: context, x: 20),
|
Constant.titleH1Login_SelamatDatang(context: context)
|
||||||
right:
|
.copyWith(
|
||||||
Constant.getActualXPhone(context: context, x: 48),
|
fontWeight: FontWeight.w600,
|
||||||
),
|
color: Constant.textBlack),
|
||||||
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),
|
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
|
// inputan email
|
||||||
Padding(
|
Padding(
|
||||||
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',
|
style: Constant.body1_400_dibulan(context: context)
|
||||||
style: Constant.body1_400_dibulan(context: context)
|
.copyWith(
|
||||||
.copyWith(
|
fontWeight: FontWeight.w600,
|
||||||
fontWeight: FontWeight.w600,
|
color: Constant.textBlack),
|
||||||
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(
|
child: Text(
|
||||||
padding: EdgeInsets.only(
|
'Password',
|
||||||
// top: Constant.getActualYPhone(context: context, y: 63),
|
style: Constant.body1_400_dibulan(context: context)
|
||||||
left: Constant.getActualXPhone(context: context, x: 20),
|
.copyWith(
|
||||||
right:
|
fontWeight: FontWeight.w600,
|
||||||
Constant.getActualXPhone(context: context, x: 20),
|
color: Constant.textBlack),
|
||||||
),
|
),
|
||||||
child: TextField(
|
),
|
||||||
controller: ctrlEmail,
|
SizedBox(
|
||||||
decoration: InputDecoration(
|
height: Constant.getActualYPhone(context: context, y: 4),
|
||||||
hintStyle:
|
),
|
||||||
Constant.body2_400(context: context).copyWith(
|
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,
|
color: Constant.textGreyv2,
|
||||||
),
|
),
|
||||||
labelStyle:
|
onPressed: () {
|
||||||
Constant.body2_400(context: context).copyWith(
|
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,
|
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(
|
// if (errorMessage.value != "") ...[
|
||||||
height: Constant.getActualYPhone(context: context, y: 21),
|
// 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
|
SizedBox(
|
||||||
Padding(
|
height: Constant.getActualYPhone(context: context, y: 40),
|
||||||
padding: EdgeInsets.only(
|
),
|
||||||
// top: Constant.getActualYPhone(context: context, y: 63),
|
Padding(
|
||||||
left: Constant.getActualXPhone(context: context, x: 20),
|
padding: EdgeInsets.only(
|
||||||
right:
|
left: Constant.getActualXPhone(context: context, x: 20),
|
||||||
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(
|
child: SizedBox(
|
||||||
height: Constant.getActualYPhone(context: context, y: 4),
|
width: Constant.getActualXPhone(context: context, x: 390),
|
||||||
),
|
height: Constant.getActualYPhone(context: context, y: 50),
|
||||||
Padding(
|
child: ElevatedButton(
|
||||||
padding: EdgeInsets.only(
|
// onPressed: () {
|
||||||
// top: Constant.getActualYPhone(context: context, y: 63),
|
// Navigator.of(context).pushNamed(homeRoute);
|
||||||
left: Constant.getActualXPhone(context: context, x: 20),
|
// },
|
||||||
right:
|
onPressed: (isSuccess.value == true)
|
||||||
Constant.getActualXPhone(context: context, x: 20),
|
? () {}
|
||||||
),
|
: () {
|
||||||
child: TextField(
|
if (ctrlEmail.text.isEmpty ||
|
||||||
controller: ctrlPassword,
|
ctrlPassword.text.isEmpty) {
|
||||||
decoration: InputDecoration(
|
isLoading.value = true;
|
||||||
hintStyle:
|
errorMessage.value = 'Inputan harus diisi';
|
||||||
Constant.body2_400(context: context).copyWith(
|
Timer(const Duration(seconds: 3), () {
|
||||||
color: Colors.orange,
|
isLoading.value = false;
|
||||||
),
|
errorMessage.value = "";
|
||||||
labelStyle:
|
});
|
||||||
Constant.body2_400(context: context).copyWith(
|
} else {
|
||||||
color: Colors.orange,
|
ref.read(loginProvider.notifier).login(
|
||||||
),
|
email: ctrlEmail.text,
|
||||||
border: OutlineInputBorder(
|
password: ctrlPassword.text,
|
||||||
borderSide: BorderSide(
|
);
|
||||||
color: Colors.orange,
|
}
|
||||||
width: 1,
|
},
|
||||||
),
|
style: ButtonStyle(
|
||||||
),
|
backgroundColor: MaterialStateColor.resolveWith(
|
||||||
focusedBorder: OutlineInputBorder(
|
(st) => (isSuccess.value == true)
|
||||||
borderSide: BorderSide(
|
? Constant.textGrey
|
||||||
color: Colors.orange,
|
: Constant.pcBtnBackgroundColor),
|
||||||
width: 1,
|
shape:
|
||||||
),
|
MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||||
),
|
RoundedRectangleBorder(
|
||||||
// labelText: "Nama Pengirim",
|
borderRadius: BorderRadius.circular(8),
|
||||||
// hintText: 'Nama Pengirim',
|
side: BorderSide(
|
||||||
),
|
color: Constant.pcBtnBackgroundColor,
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
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,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
shadowColor:
|
|
||||||
MaterialStateProperty.all(Color(0xffff48423d)),
|
|
||||||
elevation: MaterialStateProperty.all(4.0),
|
|
||||||
),
|
),
|
||||||
child: Stack(
|
shadowColor:
|
||||||
children: [
|
MaterialStateProperty.all(Color(0xffff48423d)),
|
||||||
(isLoading.value)
|
elevation: MaterialStateProperty.all(4.0),
|
||||||
? SizedBox(
|
),
|
||||||
width: Constant.getActualXPhone(
|
child: Stack(
|
||||||
context: context, x: 24),
|
children: [
|
||||||
height: Constant.getActualYPhone(
|
(isLoading.value)
|
||||||
context: context, y: 32),
|
? SizedBox(
|
||||||
child: Center(
|
width: Constant.getActualXPhone(
|
||||||
child: CircularProgressIndicator(
|
context: context, x: 24),
|
||||||
color: Colors.white,
|
height: Constant.getActualYPhone(
|
||||||
),
|
context: context, y: 32),
|
||||||
),
|
child: Center(
|
||||||
)
|
child: CircularProgressIndicator(
|
||||||
: Align(
|
color: Colors.white,
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Text(
|
|
||||||
'Login',
|
|
||||||
style: Constant.titleH3_700(
|
|
||||||
context: context)
|
|
||||||
.copyWith(
|
|
||||||
color: Constant.textLoginColor),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
)
|
||||||
),
|
: Align(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
'Login',
|
||||||
|
style: Constant.titleH3_700(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textLoginColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: Constant.getActualYPhone(context: context, y: 10),
|
height: Constant.getActualYPhone(context: context, y: 10),
|
||||||
),
|
),
|
||||||
|
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Versi ${Constant.version}',
|
'Versi ${Constant.version}',
|
||||||
style: Constant.titleH4Login(context: context)
|
style: Constant.titleH4Login(context: context)
|
||||||
.copyWith(color: Constant.textGrey),
|
.copyWith(color: Constant.textGrey),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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(),
|
||||||
"",
|
"",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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 ?? "",
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user