Compare commits
9 Commits
3c9253c1c1
...
add-homepa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc41ad389c | ||
|
|
150046115d | ||
|
|
4bfb4f5e8c | ||
|
|
178dd3b509 | ||
|
|
9416c010d7 | ||
|
|
de84b76170 | ||
|
|
198f7ccd17 | ||
|
|
a317946fc2 | ||
|
|
088c18f536 |
BIN
app_petty_cash/fonts/PublicSans-Bold.ttf
Normal file
BIN
app_petty_cash/images/background_card.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
app_petty_cash/images/icon_12.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
30
app_petty_cash/images/icon_12.svg
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="32" height="32" fill="#F5F5F5"/>
|
||||||
|
<path d="M-2213 -1590C-2213 -1591.1 -2212.1 -1592 -2211 -1592H1326C1327.1 -1592 1328 -1591.1 1328 -1590V2084C1328 2085.1 1327.1 2086 1326 2086H-2211C-2212.1 2086 -2213 2085.1 -2213 2084V-1590Z" fill="#2C2C2D"/>
|
||||||
|
<path d="M-2211 -1591H1326V-1593H-2211V-1591ZM1327 -1590V2084H1329V-1590H1327ZM1326 2085H-2211V2087H1326V2085ZM-2212 2084V-1590H-2214V2084H-2212ZM-2211 2085C-2211.55 2085 -2212 2084.55 -2212 2084H-2214C-2214 2085.66 -2212.66 2087 -2211 2087V2085ZM1327 2084C1327 2084.55 1326.55 2085 1326 2085V2087C1327.66 2087 1329 2085.66 1329 2084H1327ZM1326 -1591C1326.55 -1591 1327 -1590.55 1327 -1590H1329C1329 -1591.66 1327.66 -1593 1326 -1593V-1591ZM-2211 -1593C-2212.66 -1593 -2214 -1591.66 -2214 -1590H-2212C-2212 -1590.55 -2211.55 -1591 -2211 -1591V-1593Z" fill="black" fill-opacity="0.1"/>
|
||||||
|
<rect width="390" height="1084" transform="translate(-44 -414)" fill="white"/>
|
||||||
|
<g filter="url(#filter0_dd_11_141)">
|
||||||
|
<rect x="-24" y="-28" width="350" height="145" rx="12" fill="white"/>
|
||||||
|
<rect x="-12" y="-12" width="56" height="56" rx="8" fill="#F15A29" fill-opacity="0.08"/>
|
||||||
|
<path d="M20 14.6666H20.0133M14.6666 20H14.68M21.3333 21.3333H21.3466M2.66663 21.3333L29.3333 29.3333L21.3333 2.66663C16.8694 3.89048 12.801 6.25514 9.52805 9.52805C6.25514 12.801 3.89048 16.8694 2.66663 21.3333Z" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M7.61328 22.8133C8.69531 19.2219 10.6497 15.9542 13.3019 13.3019C15.9542 10.6497 19.2219 8.69531 22.8133 7.61328" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<filter id="filter0_dd_11_141" x="-44" y="-36" width="390" height="185" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||||
|
<feMorphology radius="4" operator="erode" in="SourceAlpha" result="effect1_dropShadow_11_141"/>
|
||||||
|
<feOffset dy="12"/>
|
||||||
|
<feGaussianBlur stdDeviation="12"/>
|
||||||
|
<feColorMatrix type="matrix" values="0 0 0 0 0.568627 0 0 0 0 0.619608 0 0 0 0 0.670588 0 0 0 0.12 0"/>
|
||||||
|
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_11_141"/>
|
||||||
|
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||||
|
<feOffset/>
|
||||||
|
<feGaussianBlur stdDeviation="1"/>
|
||||||
|
<feComposite in2="hardAlpha" operator="out"/>
|
||||||
|
<feColorMatrix type="matrix" values="0 0 0 0 0.568627 0 0 0 0 0.619608 0 0 0 0 0.670588 0 0 0 0.2 0"/>
|
||||||
|
<feBlend mode="normal" in2="effect1_dropShadow_11_141" result="effect2_dropShadow_11_141"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_11_141" result="shape"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.8 KiB |
5
app_petty_cash/images/icon_13.svg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M28 16V9.33333H6.66667C5.95942 9.33333 5.28115 9.05238 4.78105 8.55229C4.28095 8.05219 4 7.37391 4 6.66667C4 5.95942 4.28095 5.28115 4.78105 4.78105C5.28115 4.28095 5.95942 4 6.66667 4H25.3333V9.33333" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M4 6.66675V25.3334C4 26.0407 4.28095 26.7189 4.78105 27.219C5.28115 27.7191 5.95942 28.0001 6.66667 28.0001H28V21.3334" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M24 16C23.2928 16 22.6145 16.281 22.1144 16.781C21.6143 17.2811 21.3334 17.9594 21.3334 18.6667C21.3334 19.3739 21.6143 20.0522 22.1144 20.5523C22.6145 21.0524 23.2928 21.3333 24 21.3333H29.3334V16H24Z" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 904 B |
5
app_petty_cash/images/icon_3.svg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M20.0001 2.66663H12.0001C11.2637 2.66663 10.6667 3.26358 10.6667 3.99996V6.66663C10.6667 7.40301 11.2637 7.99996 12.0001 7.99996H20.0001C20.7365 7.99996 21.3334 7.40301 21.3334 6.66663V3.99996C21.3334 3.26358 20.7365 2.66663 20.0001 2.66663Z" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M13.8667 16.8C14.3971 16.2696 15.1166 15.9716 15.8667 15.9716C16.6169 15.9716 17.3363 16.2696 17.8667 16.8C18.3971 17.3304 18.6951 18.0498 18.6951 18.8C18.6951 19.5501 18.3971 20.2696 17.8667 20.8L10.6667 28L5.33337 29.3333L6.66671 24L13.8667 16.8Z" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M21.3334 5.33325H24C24.7073 5.33325 25.3856 5.6142 25.8857 6.1143C26.3858 6.6144 26.6667 7.29267 26.6667 7.99992V26.6666C26.6667 27.3738 26.3858 28.0521 25.8857 28.5522C25.3856 29.0523 24.7073 29.3333 24 29.3333H16.6667M5.33337 17.9999V7.99992C5.33337 7.29267 5.61433 6.6144 6.11442 6.1143C6.61452 5.6142 7.2928 5.33325 8.00004 5.33325H10.6667" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app_petty_cash/images/icon_4.png
Normal file
|
After Width: | Height: | Size: 775 B |
BIN
app_petty_cash/images/icon_5.png
Normal file
|
After Width: | Height: | Size: 716 B |
4
app_petty_cash/images/icon_5.svg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M26.6666 18.6666H5.33329C3.86053 18.6666 2.66663 19.8605 2.66663 21.3333V26.6666C2.66663 28.1394 3.86053 29.3333 5.33329 29.3333H26.6666C28.1394 29.3333 29.3333 28.1394 29.3333 26.6666V21.3333C29.3333 19.8605 28.1394 18.6666 26.6666 18.6666Z" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M8.01333 24H8M13.3467 24H13.3333M20 13.3333V18.6666M23.7867 9.55997C23.2913 9.0641 22.7031 8.67072 22.0557 8.40232C21.4082 8.13392 20.7142 7.99578 20.0133 7.99578C19.3125 7.99578 18.6184 8.13392 17.971 8.40232C17.3235 8.67072 16.7353 9.0641 16.24 9.55997M27.5467 5.78664C25.5465 3.78776 22.8344 2.66492 20.0067 2.66492C17.1789 2.66492 14.4669 3.78776 12.4667 5.78664" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 898 B |
BIN
app_petty_cash/images/icon_6.png
Normal file
|
After Width: | Height: | Size: 599 B |
3
app_petty_cash/images/icon_6.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M2.66663 29.3333L6.66663 25.3333M9.99996 18L13.3333 14.6667M14 22L17.3333 18.6667M24 4L18.6666 9.33333H26.6666L21.3333 14.6667M8.39996 27.0667C8.69725 27.365 9.05051 27.6017 9.43947 27.7632C9.82844 27.9247 10.2455 28.0079 10.6666 28.0079C11.0878 28.0079 11.5048 27.9247 11.8938 27.7632C12.2827 27.6017 12.636 27.365 12.9333 27.0667L16 24L7.99996 16L4.93329 19.0667C4.63497 19.364 4.39826 19.7172 4.23675 20.1062C4.07524 20.4951 3.9921 20.9122 3.9921 21.3333C3.9921 21.7545 4.07524 22.1715 4.23675 22.5605C4.39826 22.9495 4.63497 23.3027 4.93329 23.6L8.39996 27.0667Z" stroke="#F15A29" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 763 B |
BIN
app_petty_cash/images/icon_delete.png
Normal file
|
After Width: | Height: | Size: 407 B |
BIN
app_petty_cash/images/pizza_icon.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
@@ -15,6 +15,8 @@ class Constant {
|
|||||||
// static String baseUrl = "https://devregonline.pramita.co.id/one-api/xdoc/";
|
// static String baseUrl = "https://devregonline.pramita.co.id/one-api/xdoc/";
|
||||||
|
|
||||||
// tester devbandungraya
|
// tester devbandungraya
|
||||||
|
static String baseUrlDevoneReport = "devone.aplikasi.web.id";
|
||||||
|
|
||||||
static String baseUrlDevone =
|
static String baseUrlDevone =
|
||||||
"http://devone.aplikasi.web.id/one-api-pettycash/pettycash/";
|
"http://devone.aplikasi.web.id/one-api-pettycash/pettycash/";
|
||||||
|
|
||||||
@@ -260,6 +262,18 @@ class Constant {
|
|||||||
// background upload file
|
// background upload file
|
||||||
static Color bgUploadFile = Color.fromRGBO(207, 207, 207, 0.20);
|
static Color bgUploadFile = Color.fromRGBO(207, 207, 207, 0.20);
|
||||||
|
|
||||||
|
// background icon history
|
||||||
|
static Color bgIconHistory = Color.fromRGBO(241, 90, 41, 0.16);
|
||||||
|
|
||||||
|
// background chip confirmed
|
||||||
|
static Color bgChipConfirmed = Color(0xffe8f4f5);
|
||||||
|
|
||||||
|
static Color bgTextChipConfirmed = Color(0xff32827C);
|
||||||
|
|
||||||
|
// delete text
|
||||||
|
static Color bgTextDelete = Color(0xffFF4842);
|
||||||
|
static Color bgTextChipDelete = Color.fromRGBO(255, 72, 66, 0.12);
|
||||||
|
|
||||||
//typoGraphy
|
//typoGraphy
|
||||||
static TextStyle titleH1Login({required BuildContext context}) {
|
static TextStyle titleH1Login({required BuildContext context}) {
|
||||||
return TextStyle(
|
return TextStyle(
|
||||||
@@ -521,6 +535,14 @@ class Constant {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//homepage
|
||||||
|
static TextStyle titleH6_700({required BuildContext context}) {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: Constant.getActualYPhone(context: context, y: 18),
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// pendaftaran pasien
|
// pendaftaran pasien
|
||||||
static TextStyle titleH5_600({required BuildContext context}) {
|
static TextStyle titleH5_600({required BuildContext context}) {
|
||||||
return TextStyle(
|
return TextStyle(
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
|
import 'package:app_petty_cash/screen/home/homepage_screen.dart';
|
||||||
|
|
||||||
|
import '../screen/change_company/change_company.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../screen/home/home_screen.dart';
|
import '../screen/home/home_screen.dart';
|
||||||
|
import '../screen/transaksi/history_transaksi_screen.dart';
|
||||||
import '../screen/transaksi/transaksi_screen.dart';
|
import '../screen/transaksi/transaksi_screen.dart';
|
||||||
import '../screen/login/login_screen.dart';
|
import '../screen/login/login_screen.dart';
|
||||||
import '../screen/splash/splash_screen.dart';
|
import '../screen/splash/splash_screen.dart';
|
||||||
@@ -16,6 +19,8 @@ const homeRoute = "/homeRoute";
|
|||||||
const transaksiRoute = "/transaksiRoute";
|
const transaksiRoute = "/transaksiRoute";
|
||||||
const userRoute = "/userRoute";
|
const userRoute = "/userRoute";
|
||||||
const reportRoute = "/reportRoute";
|
const reportRoute = "/reportRoute";
|
||||||
|
const changeCompanyRoute = "/changeCompanyRoute";
|
||||||
|
const historyTransaksiRoute = "/historyTransaksiRoute";
|
||||||
|
|
||||||
// test screen
|
// test screen
|
||||||
const testFilePickerRoute = "/testFilePickerRoute";
|
const testFilePickerRoute = "/testFilePickerRoute";
|
||||||
@@ -35,6 +40,32 @@ class AppRoute {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// change Company
|
||||||
|
if (settings.name == changeCompanyRoute) {
|
||||||
|
return MaterialPageRoute(builder: (context) {
|
||||||
|
return MediaQuery(
|
||||||
|
data: MediaQuery.of(context).copyWith(
|
||||||
|
textScaleFactor: 1.0,
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
child: ChangeCompanyScreen(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// history transaksi
|
||||||
|
if (settings.name == historyTransaksiRoute) {
|
||||||
|
return MaterialPageRoute(builder: (context) {
|
||||||
|
return MediaQuery(
|
||||||
|
data: MediaQuery.of(context).copyWith(
|
||||||
|
textScaleFactor: 1.0,
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
child: HistoryTransaksiScreen(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// report screen
|
// report screen
|
||||||
if (settings.name == reportRoute) {
|
if (settings.name == reportRoute) {
|
||||||
return MaterialPageRoute(builder: (context) {
|
return MaterialPageRoute(builder: (context) {
|
||||||
@@ -69,7 +100,8 @@ class AppRoute {
|
|||||||
textScaleFactor: 1.0,
|
textScaleFactor: 1.0,
|
||||||
padding: EdgeInsets.all(0),
|
padding: EdgeInsets.all(0),
|
||||||
),
|
),
|
||||||
child: HomeScreen(),
|
// child: HomeScreen(),
|
||||||
|
child: HomePageScreen(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,9 +40,10 @@ 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,
|
||||||
|
initialRoute: homeRoute,
|
||||||
onGenerateRoute: AppRoute.generateRoute,
|
onGenerateRoute: AppRoute.generateRoute,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ class AuthDoctorModel {
|
|||||||
late String M_UserID;
|
late String M_UserID;
|
||||||
late String M_UserUsername;
|
late String M_UserUsername;
|
||||||
late String M_UserEmail;
|
late String M_UserEmail;
|
||||||
// late String M_UserM_DoctorCode;
|
late String M_CompanyID;
|
||||||
// late String M_UserM_DoctorID;
|
late String M_CompanyName;
|
||||||
// late String M_UserM_StaffID;
|
// late String M_UserM_StaffID;
|
||||||
// late String M_UserM_MouID;
|
// late String M_UserM_MouID;
|
||||||
late String ip;
|
late String ip;
|
||||||
@@ -39,8 +39,8 @@ class AuthDoctorModel {
|
|||||||
required this.M_UserID,
|
required this.M_UserID,
|
||||||
required this.M_UserUsername,
|
required this.M_UserUsername,
|
||||||
required this.M_UserEmail,
|
required this.M_UserEmail,
|
||||||
// required this.M_UserM_DoctorCode,
|
required this.M_CompanyID,
|
||||||
// required this.M_UserM_DoctorID,
|
required this.M_CompanyName,
|
||||||
// this.M_UserM_StaffID = "",
|
// this.M_UserM_StaffID = "",
|
||||||
// this.M_UserM_MouID = "",
|
// this.M_UserM_MouID = "",
|
||||||
this.ip = "",
|
this.ip = "",
|
||||||
@@ -51,8 +51,8 @@ class AuthDoctorModel {
|
|||||||
M_UserID = json['M_UserID'].toString();
|
M_UserID = json['M_UserID'].toString();
|
||||||
M_UserUsername = json['M_UserUsername'].toString();
|
M_UserUsername = json['M_UserUsername'].toString();
|
||||||
M_UserEmail = json['M_UserEmail'].toString();
|
M_UserEmail = json['M_UserEmail'].toString();
|
||||||
// M_UserM_DoctorCode = json['M_UserM_DoctorCode'].toString();
|
M_CompanyID = json['M_CompanyID'].toString();
|
||||||
// M_UserM_DoctorID = json['M_UserM_DoctorID'].toString();
|
M_CompanyName = json['M_CompanyName'].toString();
|
||||||
// M_UserM_StaffID = json['M_UserM_StaffID'].toString();
|
// M_UserM_StaffID = json['M_UserM_StaffID'].toString();
|
||||||
// M_UserM_MouID = json['M_UserM_MouID'].toString();
|
// M_UserM_MouID = json['M_UserM_MouID'].toString();
|
||||||
ip = json['ip'].toString();
|
ip = json['ip'].toString();
|
||||||
@@ -64,8 +64,8 @@ class AuthDoctorModel {
|
|||||||
data['M_UserID'] = M_UserID;
|
data['M_UserID'] = M_UserID;
|
||||||
data['M_UserUsername'] = M_UserUsername;
|
data['M_UserUsername'] = M_UserUsername;
|
||||||
data['M_UserEmail'] = M_UserEmail;
|
data['M_UserEmail'] = M_UserEmail;
|
||||||
// data['M_UserM_DoctorCode'] = M_UserM_DoctorCode;
|
data['M_CompanyID'] = M_CompanyID;
|
||||||
// data['M_UserM_DoctorID'] = M_UserM_DoctorID;
|
data['M_CompanyName'] = M_CompanyName;
|
||||||
// data['M_UserM_StaffID'] = M_UserM_StaffID;
|
// data['M_UserM_StaffID'] = M_UserM_StaffID;
|
||||||
// data['M_UserM_MouID'] = M_UserM_MouID;
|
// data['M_UserM_MouID'] = M_UserM_MouID;
|
||||||
data['ip'] = ip;
|
data['ip'] = ip;
|
||||||
|
|||||||
64
app_petty_cash/lib/model/history_transaksi_model.dart
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
class HistoryTransaksiModel {
|
||||||
|
String? id;
|
||||||
|
String? tanggaltransaksi;
|
||||||
|
String? tipe;
|
||||||
|
String? kategoriid;
|
||||||
|
String? kategoriname;
|
||||||
|
String? note;
|
||||||
|
String? amount;
|
||||||
|
String? sender;
|
||||||
|
String? imgurl;
|
||||||
|
String? isconfirm;
|
||||||
|
String? tanggalconfirm;
|
||||||
|
String? usertransaksi;
|
||||||
|
String? userconfirm;
|
||||||
|
|
||||||
|
HistoryTransaksiModel(
|
||||||
|
{this.id,
|
||||||
|
this.tanggaltransaksi,
|
||||||
|
this.tipe,
|
||||||
|
this.kategoriid,
|
||||||
|
this.kategoriname,
|
||||||
|
this.note,
|
||||||
|
this.amount,
|
||||||
|
this.sender,
|
||||||
|
this.imgurl,
|
||||||
|
this.isconfirm,
|
||||||
|
this.tanggalconfirm,
|
||||||
|
this.usertransaksi,
|
||||||
|
this.userconfirm});
|
||||||
|
|
||||||
|
HistoryTransaksiModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
tanggaltransaksi = json['tanggaltransaksi'];
|
||||||
|
tipe = json['tipe'];
|
||||||
|
kategoriid = json['kategoriid'];
|
||||||
|
kategoriname = json['kategoriname'];
|
||||||
|
note = json['note'];
|
||||||
|
amount = json['amount'];
|
||||||
|
sender = json['sender'];
|
||||||
|
imgurl = json['imgurl'];
|
||||||
|
isconfirm = json['isconfirm'];
|
||||||
|
tanggalconfirm = json['tanggalconfirm'];
|
||||||
|
usertransaksi = json['usertransaksi'];
|
||||||
|
userconfirm = json['userconfirm'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['tanggaltransaksi'] = this.tanggaltransaksi;
|
||||||
|
data['tipe'] = this.tipe;
|
||||||
|
data['kategoriid'] = this.kategoriid;
|
||||||
|
data['kategoriname'] = this.kategoriname;
|
||||||
|
data['note'] = this.note;
|
||||||
|
data['amount'] = this.amount;
|
||||||
|
data['sender'] = this.sender;
|
||||||
|
data['imgurl'] = this.imgurl;
|
||||||
|
data['isconfirm'] = this.isconfirm;
|
||||||
|
data['tanggalconfirm'] = this.tanggalconfirm;
|
||||||
|
data['usertransaksi'] = this.usertransaksi;
|
||||||
|
data['userconfirm'] = this.userconfirm;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import '../app/constant.dart';
|
import '../app/constant.dart';
|
||||||
import '../model/auth_model.dart';
|
import '../model/auth_model.dart';
|
||||||
import 'base_repository.dart';
|
import 'base_repository.dart';
|
||||||
@@ -19,6 +23,8 @@ class AuthRepository extends BaseRepository {
|
|||||||
// "doctor_id": "2891",
|
// "doctor_id": "2891",
|
||||||
// "password": "3"
|
// "password": "3"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
print(param);
|
||||||
// final service = "${Constant.baseUrlDevone}xauth/login";
|
// final service = "${Constant.baseUrlDevone}xauth/login";
|
||||||
final service = "${Constant.baseUrlDevone}auth/login";
|
final service = "${Constant.baseUrlDevone}auth/login";
|
||||||
print('url login $service');
|
print('url login $service');
|
||||||
|
|||||||
@@ -2,11 +2,33 @@ import 'dart:convert';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
import '../app/constant.dart';
|
||||||
|
|
||||||
abstract class BaseRepository {
|
abstract class BaseRepository {
|
||||||
final Dio dio;
|
final Dio dio;
|
||||||
BaseRepository({required this.dio});
|
BaseRepository({required this.dio});
|
||||||
|
|
||||||
|
Future<String> getCompanyID() async {
|
||||||
|
final shared = await SharedPreferences.getInstance();
|
||||||
|
String M_CompanyID = "0";
|
||||||
|
|
||||||
|
if (shared != null) {
|
||||||
|
final bearerString = shared.get(Constant.bearerName).toString();
|
||||||
|
final xmodel = jsonDecode(bearerString);
|
||||||
|
if (xmodel != null) {
|
||||||
|
M_CompanyID = xmodel["model"]["M_CompanyID"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (M_CompanyID == "0") {
|
||||||
|
throw BaseRepositoryException(message: 'Invalid Company ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
return M_CompanyID;
|
||||||
|
}
|
||||||
|
|
||||||
Future<Map<String, dynamic>> post({
|
Future<Map<String, dynamic>> post({
|
||||||
required Map<String, dynamic> param,
|
required Map<String, dynamic> param,
|
||||||
required String service,
|
required String service,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:app_petty_cash/model/list_type_model.dart';
|
import 'package:app_petty_cash/model/list_type_model.dart';
|
||||||
|
|
||||||
import '../app/constant.dart';
|
import '../app/constant.dart';
|
||||||
|
import '../model/history_transaksi_model.dart';
|
||||||
import '../model/list_category_model.dart';
|
import '../model/list_category_model.dart';
|
||||||
import 'base_repository.dart';
|
import 'base_repository.dart';
|
||||||
|
|
||||||
@@ -58,17 +59,20 @@ class TransaksiRepository extends BaseRepository {
|
|||||||
String sender,
|
String sender,
|
||||||
String url) async {
|
String url) async {
|
||||||
String paramPostInUrl = "";
|
String paramPostInUrl = "";
|
||||||
if (tipe == "KREDIT") {
|
String M_CompanyID = await getCompanyID();
|
||||||
|
if (tipe == "DEBIT") {
|
||||||
sender = "";
|
sender = "";
|
||||||
paramPostInUrl =
|
paramPostInUrl =
|
||||||
"?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender";
|
"?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender";
|
||||||
} else {
|
} else {
|
||||||
if (tipe == "DEBIT") {
|
if (tipe == "KREDIT") {
|
||||||
kategoriid = "0";
|
kategoriid = "0";
|
||||||
paramPostInUrl =
|
paramPostInUrl =
|
||||||
"?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender";
|
"?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paramPostInUrl += "&companyid=$M_CompanyID";
|
||||||
// /?tanggal=2023-12-29&tipe=KREDIT&kategoriid=3&jumlah=5000&catatan=Lakban%20Besar&url=&userid=1&sender=
|
// /?tanggal=2023-12-29&tipe=KREDIT&kategoriid=3&jumlah=5000&catatan=Lakban%20Besar&url=&userid=1&sender=
|
||||||
|
|
||||||
final service =
|
final service =
|
||||||
@@ -90,4 +94,31 @@ class TransaksiRepository extends BaseRepository {
|
|||||||
|
|
||||||
return resp['status'];
|
return resp['status'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// list history transaksi
|
||||||
|
Future<List<HistoryTransaksiModel>> getListHistoryTransaksi(
|
||||||
|
String companyid,
|
||||||
|
String tglAwal,
|
||||||
|
String tglAkhir,
|
||||||
|
String categoryid,
|
||||||
|
) async {
|
||||||
|
final service =
|
||||||
|
"${Constant.baseUrlDevone}/homescreen/list_transaction/?companyid=$companyid&startdate=$tglAwal&enddate=$tglAkhir&kategoriid=$categoryid";
|
||||||
|
// https://devone.aplikasi.web.id/one-api-pettycash/pettycash/history/list_transaction/?companyid=1&startdate=2023-12-01&enddate=2023-12-30&kategoriid=0
|
||||||
|
final resp = await get(
|
||||||
|
// param: {
|
||||||
|
// "": "",
|
||||||
|
// },
|
||||||
|
service: service,
|
||||||
|
);
|
||||||
|
|
||||||
|
print("url list history transaksi : $service");
|
||||||
|
|
||||||
|
final result = List<HistoryTransaksiModel>.empty(growable: true);
|
||||||
|
resp['data'].forEach((e) {
|
||||||
|
final model = HistoryTransaksiModel.fromJson(e);
|
||||||
|
result.add(model);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
50
app_petty_cash/lib/screen/change_company/change_company.dart
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
|
import '../../app/constant.dart';
|
||||||
|
import '../../app/route.dart';
|
||||||
|
import '../../provider/current_user_provider.dart';
|
||||||
|
import '../../widget/custom_drawer.dart';
|
||||||
|
|
||||||
|
class ChangeCompanyScreen extends HookConsumerWidget {
|
||||||
|
const ChangeCompanyScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
useEffect(() {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||||
|
final userID = ref.read(currentUserProvider)?.model.M_UserID ?? "0";
|
||||||
|
if (userID == "0") {
|
||||||
|
//not login
|
||||||
|
Navigator.of(context)
|
||||||
|
.pushNamedAndRemoveUntil(loginRoute, (route) => true);
|
||||||
|
|
||||||
|
// Navigator.popAndPushNamed(context, loginRoute);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return () {};
|
||||||
|
}, []);
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualYPhone(context: context, y: 30),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
// centerTitle: true,
|
||||||
|
title: Text(
|
||||||
|
'Change Company',
|
||||||
|
style: TextStyle(color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
backgroundColor: Constant.pcBtnBackgroundColor,
|
||||||
|
iconTheme: IconThemeData(
|
||||||
|
color: Constant.textWhite,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
drawer: CustomDrawer(),
|
||||||
|
body: Text('Under Construction'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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(
|
||||||
|
|||||||
279
app_petty_cash/lib/screen/home/homepage_screen.dart
Normal file
@@ -0,0 +1,279 @@
|
|||||||
|
import 'package:app_petty_cash/model/history_transaksi_model.dart';
|
||||||
|
import 'package:app_petty_cash/widget/homepage_row_transaksi.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
|
import '../../app/constant.dart';
|
||||||
|
import '../../app/route.dart';
|
||||||
|
import '../../provider/current_user_provider.dart';
|
||||||
|
import '../../widget/custom_drawer.dart';
|
||||||
|
|
||||||
|
class HomePageScreen extends HookConsumerWidget {
|
||||||
|
const HomePageScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final listSearchHistory = useState<List<HistoryTransaksiModel>>(
|
||||||
|
List.empty(
|
||||||
|
growable: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||||
|
final userID = ref.read(currentUserProvider)?.model.M_UserID ?? "0";
|
||||||
|
if (userID == "0") {
|
||||||
|
//not login
|
||||||
|
Navigator.of(context)
|
||||||
|
.pushNamedAndRemoveUntil(loginRoute, (route) => true);
|
||||||
|
|
||||||
|
// Navigator.popAndPushNamed(context, loginRoute);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return () {};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(
|
||||||
|
'Home Screen',
|
||||||
|
style: TextStyle(color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
backgroundColor: Constant.pcBtnBackgroundColor,
|
||||||
|
iconTheme: IconThemeData(
|
||||||
|
color: Constant.textWhite,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
drawer: CustomDrawer(),
|
||||||
|
body: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualYPhone(context: context, y: 36),
|
||||||
|
left: Constant.getActualXPhone(context: context, x: 34),
|
||||||
|
right: Constant.getActualXPhone(context: context, x: 34),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 390),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 844),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 332),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 173),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: Colors.black12,
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('images/background_card.png'),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Color.fromRGBO(145, 158, 171, 0.16),
|
||||||
|
offset: Offset(0, 24),
|
||||||
|
blurRadius: 48,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
//Isi Card
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// Text1 & Text2
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualYPhone(
|
||||||
|
context: context, y: 17),
|
||||||
|
left: Constant.getActualXPhone(
|
||||||
|
context: context, x: 81),
|
||||||
|
right: Constant.getActualXPhone(
|
||||||
|
context: context, x: 81),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Account Balance',
|
||||||
|
style: Constant.body1(context: context)
|
||||||
|
.copyWith(
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Rp. 1,440,000',
|
||||||
|
style: Constant.H4_700V2(context: context)
|
||||||
|
.copyWith(
|
||||||
|
fontSize: Constant.getActualYPhone(
|
||||||
|
context: context, y: 24),
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 27),
|
||||||
|
),
|
||||||
|
|
||||||
|
//Debit dan Kredit
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment
|
||||||
|
.center, // Menengahkan secara horizontal
|
||||||
|
children: [
|
||||||
|
// Spasi di sebelah kiri "Check In"
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: Constant.getActualXPhone(
|
||||||
|
context: context, x: 20),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Debit',
|
||||||
|
style: Constant.body1(context: context)
|
||||||
|
.copyWith(
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Rp. 2,000,000',
|
||||||
|
style: Constant.titleH6_700(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 51),
|
||||||
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
right: Constant.getActualXPhone(
|
||||||
|
context: context, x: 28),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Credit',
|
||||||
|
style: Constant.body1(context: context)
|
||||||
|
.copyWith(
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Rp. 560,000',
|
||||||
|
style: Constant.titleH6_700(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 17),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
//Card
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 36),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 44),
|
||||||
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: Constant.getActualXPhone(context: context, x: 20),
|
||||||
|
right: Constant.getActualXPhone(context: context, x: 20),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
// color: Colors.amber,
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
|
||||||
|
child: Column(children: [
|
||||||
|
Text(
|
||||||
|
'Transaksi Terkini',
|
||||||
|
style: Constant.titleH5_600(context: context)
|
||||||
|
.copyWith(color: Constant.textBlack),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height:
|
||||||
|
Constant.getActualYPhone(context: context, y: 24),
|
||||||
|
),
|
||||||
|
// Expanded(
|
||||||
|
// child: ListView.builder(
|
||||||
|
// itemCount: listSearchHistory.value.length,
|
||||||
|
// itemBuilder: (context, idx) {
|
||||||
|
// return Padding(
|
||||||
|
// padding: EdgeInsets.only(
|
||||||
|
// bottom: Constant.getActualYPhone(
|
||||||
|
// context: context,
|
||||||
|
// y: 10,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// child: Card(
|
||||||
|
// elevation: 2.0,
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.all(10),
|
||||||
|
// child: Column(
|
||||||
|
// // crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
// // mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// // atas
|
||||||
|
// HomepageRowTransaksiWidget(
|
||||||
|
// icon_category_id: listSearchHistory
|
||||||
|
// .value[idx].kategoriid
|
||||||
|
// .toString(),
|
||||||
|
// icon_category_name: listSearchHistory
|
||||||
|
// .value[idx].kategoriname
|
||||||
|
// .toString(),
|
||||||
|
// amount: listSearchHistory
|
||||||
|
// .value[idx].amount
|
||||||
|
// .toString(),
|
||||||
|
// tglTransaksi: listSearchHistory
|
||||||
|
// .value[idx].tanggaltransaksi
|
||||||
|
// .toString(),
|
||||||
|
// tipe: listSearchHistory.value[idx].tipe
|
||||||
|
// .toString(),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ class LoginScreen extends HookConsumerWidget {
|
|||||||
final authModel = AuthModel(
|
final authModel = AuthModel(
|
||||||
token: xmodel["token"],
|
token: xmodel["token"],
|
||||||
model: AuthDoctorModel(
|
model: AuthDoctorModel(
|
||||||
// M_UserM_DoctorID: xmodel["model"]["M_UserM_DoctorID"],
|
M_CompanyID: xmodel["model"]["M_CompanyID"],
|
||||||
|
M_CompanyName: xmodel["model"]["M_CompanyName"],
|
||||||
M_UserEmail: xmodel["model"]["M_UserEmail"],
|
M_UserEmail: xmodel["model"]["M_UserEmail"],
|
||||||
M_UserUsername: xmodel["model"]["M_UserUsername"],
|
M_UserUsername: xmodel["model"]["M_UserUsername"],
|
||||||
// M_UserM_DoctorCode: xmodel["model"]["M_UserM_DoctorCode"],
|
// M_UserM_DoctorCode: xmodel["model"]["M_UserM_DoctorCode"],
|
||||||
@@ -39,7 +40,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,
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import '../../widget/sankbar_widget.dart';
|
import '../../widget/sankbar_widget.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
@@ -25,6 +29,26 @@ class ReportScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
final tglAkhir = useState<DateTime>(DateTime.now());
|
final tglAkhir = useState<DateTime>(DateTime.now());
|
||||||
final tglAkhirTmp = useState<String>("");
|
final tglAkhirTmp = useState<String>("");
|
||||||
|
String M_CompanyID = "0";
|
||||||
|
|
||||||
|
Future<String> getCompanyID() async {
|
||||||
|
final shared = await SharedPreferences.getInstance();
|
||||||
|
String M_CompanyID = "0";
|
||||||
|
|
||||||
|
if (shared != null) {
|
||||||
|
final bearerString = shared.get(Constant.bearerName).toString();
|
||||||
|
final xmodel = jsonDecode(bearerString);
|
||||||
|
if (xmodel != null) {
|
||||||
|
M_CompanyID = xmodel["model"]["M_CompanyID"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (M_CompanyID == "0") {
|
||||||
|
// throw BaseRepositoryException(message: 'Invalid Company ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
return M_CompanyID;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||||
@@ -47,229 +71,212 @@ 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(
|
||||||
child: SingleChildScrollView(
|
child: Padding(
|
||||||
child: Padding(
|
padding: EdgeInsets.all(20),
|
||||||
padding: EdgeInsets.all(20),
|
child: Column(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Text(
|
||||||
Text(
|
'Tanggal Awal',
|
||||||
'Tanggal Awal',
|
style: Constant.body1(context: context).copyWith(
|
||||||
style: Constant.body1(context: context).copyWith(
|
fontWeight: FontWeight.w600, color: Constant.textBlack),
|
||||||
fontWeight: FontWeight.w600, color: Constant.textBlack),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: Constant.getActualYPhone(context: context, y: 10),
|
|
||||||
),
|
|
||||||
// Tanggal Awal
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: TextField(
|
|
||||||
controller: ctrlTglAwal,
|
|
||||||
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: "Tanggal Awal",
|
|
||||||
hintText: 'Tanggal Awal',
|
|
||||||
// suffixIcon: isLoadingFilterScope.value
|
|
||||||
// ? SizedBox(
|
|
||||||
// width: Constant.getActualXPhone(
|
|
||||||
// context: context,
|
|
||||||
// x: 4,
|
|
||||||
// ),
|
|
||||||
// height: Constant.getActualYPhone(
|
|
||||||
// context: context,
|
|
||||||
// y: 4,
|
|
||||||
// ),
|
|
||||||
// child: CircularProgressIndicator(
|
|
||||||
// color: Constant.textRed,
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// : Icon(
|
|
||||||
// Icons.calendar_month_sharp,
|
|
||||||
// color: Constant.colorIconDate,
|
|
||||||
// ),
|
|
||||||
),
|
|
||||||
onTap: () async {
|
|
||||||
final selectedDateAwal = await showDatePicker(
|
|
||||||
// locale: const Locale("en-CA"),
|
|
||||||
// locale: ,
|
|
||||||
context: context,
|
|
||||||
initialEntryMode:
|
|
||||||
DatePickerEntryMode.calendarOnly,
|
|
||||||
firstDate: DateTime(2000),
|
|
||||||
lastDate: DateTime(2100),
|
|
||||||
|
|
||||||
initialDate: (ctrlTglAwal.text.isEmpty)
|
|
||||||
? DateTime.now()
|
|
||||||
: tglAwal.value,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedDateAwal != null) {
|
|
||||||
String formattedDate = DateFormat('dd-MM-yyyy')
|
|
||||||
.format(selectedDateAwal);
|
|
||||||
// ctrlTglAwal.text =
|
|
||||||
// selectedDateAwal.toString().split(' ')[0];
|
|
||||||
ctrlTglAwal.text = formattedDate;
|
|
||||||
tglAwal.value = selectedDateAwal;
|
|
||||||
tglAwalTmp.value = selectedDateAwal.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedDateAwal == null) {
|
|
||||||
print('cancel button');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: Constant.getActualYPhone(context: context, y: 20),
|
|
||||||
),
|
|
||||||
|
|
||||||
Text(
|
|
||||||
'Tanggal Akhir',
|
|
||||||
style: Constant.body1(context: context).copyWith(
|
|
||||||
fontWeight: FontWeight.w600, color: Constant.textBlack),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: Constant.getActualYPhone(context: context, y: 10),
|
|
||||||
),
|
|
||||||
// Tanggal Akhir
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: TextField(
|
|
||||||
controller: ctrlTglAkhir,
|
|
||||||
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: "Tanggal Awal",
|
|
||||||
hintText: 'Tanggal Akhir',
|
|
||||||
// suffixIcon: isLoadingFilterScope.value
|
|
||||||
// ? SizedBox(
|
|
||||||
// width: Constant.getActualXPhone(
|
|
||||||
// context: context,
|
|
||||||
// x: 4,
|
|
||||||
// ),
|
|
||||||
// height: Constant.getActualYPhone(
|
|
||||||
// context: context,
|
|
||||||
// y: 4,
|
|
||||||
// ),
|
|
||||||
// child: CircularProgressIndicator(
|
|
||||||
// color: Constant.textRed,
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// : Icon(
|
|
||||||
// Icons.calendar_month_sharp,
|
|
||||||
// color: Constant.colorIconDate,
|
|
||||||
// ),
|
|
||||||
),
|
|
||||||
onTap: () async {
|
|
||||||
final selectedDateAkhir = await showDatePicker(
|
|
||||||
// locale: const Locale("en-CA"),
|
|
||||||
// locale: ,
|
|
||||||
context: context,
|
|
||||||
initialEntryMode:
|
|
||||||
DatePickerEntryMode.calendarOnly,
|
|
||||||
firstDate: DateTime(2000),
|
|
||||||
lastDate: DateTime(2100),
|
|
||||||
|
|
||||||
initialDate: (ctrlTglAkhir.text.isEmpty)
|
|
||||||
? DateTime.now()
|
|
||||||
: tglAkhir.value,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedDateAkhir != null) {
|
|
||||||
String formattedDate = DateFormat('dd-MM-yyyy')
|
|
||||||
.format(selectedDateAkhir);
|
|
||||||
// ctrlTglAkhir.text =
|
|
||||||
// selectedDateAkhir.toString().split(' ')[0];
|
|
||||||
ctrlTglAkhir.text = formattedDate;
|
|
||||||
tglAkhir.value = selectedDateAkhir;
|
|
||||||
tglAkhirTmp.value = selectedDateAkhir.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedDateAkhir == null) {
|
|
||||||
print('cancel button');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
bottomNavigationBar: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
// right: Constant.getActualXPhone(context: context, x: 27),
|
|
||||||
// left: Constant.getActualXPhone(context: context, x: 27),
|
|
||||||
// bottom: Constant.getActualYPhone(context: context, y: 32),
|
|
||||||
top: Constant.getActualYPhone(context: context, y: 10),
|
|
||||||
),
|
|
||||||
child: BottomAppBar(
|
|
||||||
child: Container(
|
|
||||||
height: 150,
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
// right: Constant.getActualXPhone(context: context, x: 27),
|
|
||||||
// left: Constant.getActualXPhone(context: context, x: 27),
|
|
||||||
// bottom: Constant.getActualYPhone(context: context, y: 32),
|
|
||||||
top: Constant.getActualYPhone(context: context, y: 24),
|
|
||||||
),
|
),
|
||||||
child: Column(
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 10),
|
||||||
|
),
|
||||||
|
// Tanggal Awal
|
||||||
|
Row(
|
||||||
children: [
|
children: [
|
||||||
// Excel
|
Expanded(
|
||||||
Container(
|
child: TextField(
|
||||||
width: Constant.getActualXPhone(context: context, x: 336),
|
controller: ctrlTglAwal,
|
||||||
height: Constant.getActualYPhone(context: context, y: 42),
|
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: "Tanggal Awal",
|
||||||
|
hintText: 'Tanggal Awal',
|
||||||
|
// suffixIcon: isLoadingFilterScope.value
|
||||||
|
// ? SizedBox(
|
||||||
|
// width: Constant.getActualXPhone(
|
||||||
|
// context: context,
|
||||||
|
// x: 4,
|
||||||
|
// ),
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context,
|
||||||
|
// y: 4,
|
||||||
|
// ),
|
||||||
|
// child: CircularProgressIndicator(
|
||||||
|
// color: Constant.textRed,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : Icon(
|
||||||
|
// Icons.calendar_month_sharp,
|
||||||
|
// color: Constant.colorIconDate,
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
final selectedDateAwal = await showDatePicker(
|
||||||
|
// locale: const Locale("en-CA"),
|
||||||
|
// locale: ,
|
||||||
|
context: context,
|
||||||
|
initialEntryMode: DatePickerEntryMode.calendarOnly,
|
||||||
|
firstDate: DateTime(2000),
|
||||||
|
lastDate: DateTime(2100),
|
||||||
|
|
||||||
|
initialDate: (ctrlTglAwal.text.isEmpty)
|
||||||
|
? DateTime.now()
|
||||||
|
: tglAwal.value,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedDateAwal != null) {
|
||||||
|
String formattedDate = DateFormat('dd-MM-yyyy')
|
||||||
|
.format(selectedDateAwal);
|
||||||
|
// ctrlTglAwal.text =
|
||||||
|
// selectedDateAwal.toString().split(' ')[0];
|
||||||
|
ctrlTglAwal.text = formattedDate;
|
||||||
|
tglAwal.value = selectedDateAwal;
|
||||||
|
tglAwalTmp.value = selectedDateAwal.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDateAwal == null) {
|
||||||
|
print('cancel button');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 20),
|
||||||
|
),
|
||||||
|
|
||||||
|
Text(
|
||||||
|
'Tanggal Akhir',
|
||||||
|
style: Constant.body1(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600, color: Constant.textBlack),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 10),
|
||||||
|
),
|
||||||
|
// Tanggal Akhir
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
controller: ctrlTglAkhir,
|
||||||
|
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: "Tanggal Awal",
|
||||||
|
hintText: 'Tanggal Akhir',
|
||||||
|
// suffixIcon: isLoadingFilterScope.value
|
||||||
|
// ? SizedBox(
|
||||||
|
// width: Constant.getActualXPhone(
|
||||||
|
// context: context,
|
||||||
|
// x: 4,
|
||||||
|
// ),
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context,
|
||||||
|
// y: 4,
|
||||||
|
// ),
|
||||||
|
// child: CircularProgressIndicator(
|
||||||
|
// color: Constant.textRed,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : Icon(
|
||||||
|
// Icons.calendar_month_sharp,
|
||||||
|
// color: Constant.colorIconDate,
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
final selectedDateAkhir = await showDatePicker(
|
||||||
|
// locale: const Locale("en-CA"),
|
||||||
|
// locale: ,
|
||||||
|
context: context,
|
||||||
|
initialEntryMode: DatePickerEntryMode.calendarOnly,
|
||||||
|
firstDate: DateTime(2000),
|
||||||
|
lastDate: DateTime(2100),
|
||||||
|
|
||||||
|
initialDate: (ctrlTglAkhir.text.isEmpty)
|
||||||
|
? DateTime.now()
|
||||||
|
: tglAkhir.value,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedDateAkhir != null) {
|
||||||
|
String formattedDate = DateFormat('dd-MM-yyyy')
|
||||||
|
.format(selectedDateAkhir);
|
||||||
|
// ctrlTglAkhir.text =
|
||||||
|
// selectedDateAkhir.toString().split(' ')[0];
|
||||||
|
ctrlTglAkhir.text = formattedDate;
|
||||||
|
tglAkhir.value = selectedDateAkhir;
|
||||||
|
tglAkhirTmp.value = selectedDateAkhir.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDateAkhir == null) {
|
||||||
|
print('cancel button');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
Spacer(),
|
||||||
|
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: MaterialStateColor.resolveWith(
|
backgroundColor: MaterialStateColor.resolveWith(
|
||||||
@@ -309,11 +316,11 @@ class ReportScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: Constant.getActualXPhone(
|
width: Constant.getActualXPhone(
|
||||||
context: context, x: 8),
|
context: context, x: 6),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Download Report (xls) ',
|
'Excel',
|
||||||
style: Constant.body1(context: context).copyWith(
|
style: Constant.body1(context: context).copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
@@ -321,18 +328,47 @@ class ReportScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
onPressed: () {},
|
onPressed: () async {
|
||||||
|
M_CompanyID = await getCompanyID();
|
||||||
|
if (M_CompanyID == "0") {
|
||||||
|
SanckbarWidget(
|
||||||
|
context, 'Invalid Company', snackbarType.error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Awal
|
||||||
|
DateTime parsedDateAwal =
|
||||||
|
DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAwal =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAwal);
|
||||||
|
|
||||||
|
// Akhir
|
||||||
|
DateTime parsedDateAkhir =
|
||||||
|
DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAkhir =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAkhir);
|
||||||
|
|
||||||
|
String url =
|
||||||
|
"https://${Constant.baseUrlDevoneReport}/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=xls&PStartDate=$formattedDateAwal&PEndDate=$formattedDateAkhir&PCompanyID=$M_CompanyID&username=adminsas%20";
|
||||||
|
if (!await launchUrl(Uri.parse(url))) {
|
||||||
|
// throw Exception('Could not launch $url');
|
||||||
|
SanckbarWidget(context, 'Could not launch $url',
|
||||||
|
snackbarType.error);
|
||||||
|
}
|
||||||
|
// https://devone.aplikasi.web.id/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=pdf&PStartDate=2023-11-01&PEndDate=2023-12-30&PCompanyID=0&username=adminsas%20&tm=1701327096267
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: Constant.getActualYPhone(context: context, y: 20),
|
width: Constant.getActualXPhone(context: context, x: 10),
|
||||||
),
|
),
|
||||||
|
|
||||||
// PDF
|
// PDF
|
||||||
Container(
|
Expanded(
|
||||||
width: Constant.getActualXPhone(context: context, x: 336),
|
|
||||||
height: Constant.getActualYPhone(context: context, y: 42),
|
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: MaterialStateColor.resolveWith(
|
backgroundColor: MaterialStateColor.resolveWith(
|
||||||
@@ -366,11 +402,11 @@ class ReportScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: Constant.getActualXPhone(
|
width: Constant.getActualXPhone(
|
||||||
context: context, x: 8),
|
context: context, x: 6),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Download Report (PDF)',
|
'PDF',
|
||||||
style: Constant.body1(context: context).copyWith(
|
style: Constant.body1(context: context).copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Constant.white),
|
color: Constant.white),
|
||||||
@@ -378,8 +414,30 @@ class ReportScreen extends HookConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
M_CompanyID = await getCompanyID();
|
||||||
|
if (M_CompanyID == "0") {
|
||||||
|
SanckbarWidget(
|
||||||
|
context, 'Invalid Company', snackbarType.error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Awal
|
||||||
|
DateTime parsedDateAwal =
|
||||||
|
DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAwal =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAwal);
|
||||||
|
|
||||||
|
// Akhir
|
||||||
|
DateTime parsedDateAkhir =
|
||||||
|
DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAkhir =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAkhir);
|
||||||
|
|
||||||
String url =
|
String url =
|
||||||
"https://pub.dev/packages?q=url+launcher";
|
"https://${Constant.baseUrlDevoneReport}/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=pdf&PStartDate=$formattedDateAwal&PEndDate=$formattedDateAkhir&PCompanyID=$M_CompanyID&username=adminsas%20";
|
||||||
if (!await launchUrl(Uri.parse(url))) {
|
if (!await launchUrl(Uri.parse(url))) {
|
||||||
// throw Exception('Could not launch $url');
|
// throw Exception('Could not launch $url');
|
||||||
SanckbarWidget(context, 'Could not launch $url',
|
SanckbarWidget(context, 'Could not launch $url',
|
||||||
@@ -390,7 +448,7 @@ class ReportScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -0,0 +1,907 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:app_petty_cash/screen/transaksi/search_history_transaksi_provider.dart';
|
||||||
|
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
import 'package:flutter_svg/svg.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
import '../../app/constant.dart';
|
||||||
|
import '../../app/route.dart';
|
||||||
|
import '../../model/history_transaksi_model.dart';
|
||||||
|
import '../../model/list_category_model.dart';
|
||||||
|
import '../../model/list_type_model.dart';
|
||||||
|
import '../../provider/current_user_provider.dart';
|
||||||
|
import '../../widget/custom_drawer.dart';
|
||||||
|
import '../../widget/field_row_history_transaksi.dart';
|
||||||
|
import '../../widget/history_row_atas_widget.dart';
|
||||||
|
import '../../widget/sankbar_widget.dart';
|
||||||
|
import 'list_category_provider.dart';
|
||||||
|
import 'list_type_provider.dart';
|
||||||
|
|
||||||
|
class HistoryTransaksiScreen extends HookConsumerWidget {
|
||||||
|
const HistoryTransaksiScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final listTypeData = useState<List<ListType>>(List.empty(growable: true));
|
||||||
|
final selectedListTypeData = useState<ListType>(ListType());
|
||||||
|
|
||||||
|
final listTypeLoading = useState(false);
|
||||||
|
|
||||||
|
// category
|
||||||
|
final listCategoryLoading = useState(false);
|
||||||
|
final selectedListCategory = useState<ListCategory>(ListCategory());
|
||||||
|
final listCategoryData = useState<List<ListCategory>>(
|
||||||
|
List.empty(
|
||||||
|
growable: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
String M_CompanyID = "0";
|
||||||
|
String formattedDate = DateFormat('dd-MM-yyyy').format(DateTime.now());
|
||||||
|
final ctrlTglAwal = useTextEditingController(text: formattedDate);
|
||||||
|
|
||||||
|
final tglAwal = useState<DateTime>(DateTime.now());
|
||||||
|
final tglAwalTmp = useState<String>("");
|
||||||
|
|
||||||
|
final ctrlTglAkhir = useTextEditingController(text: formattedDate);
|
||||||
|
|
||||||
|
final tglAkhir = useState<DateTime>(DateTime.now());
|
||||||
|
final tglAkhirTmp = useState<String>("");
|
||||||
|
final categoryIsLoading = useState<bool>(false);
|
||||||
|
final searchHistoryIsLoading = useState<bool>(false);
|
||||||
|
final listSearchHistory = useState<List<HistoryTransaksiModel>>(
|
||||||
|
List.empty(
|
||||||
|
growable: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// A. LISTEN PROVIDER
|
||||||
|
|
||||||
|
// type
|
||||||
|
ref.listen(
|
||||||
|
listTypeProvider,
|
||||||
|
(previous, next) {
|
||||||
|
if (next is ListTypeStateLoading) {
|
||||||
|
listTypeLoading.value = true;
|
||||||
|
} else if (next is ListTypeStateError) {
|
||||||
|
// print(next.message);
|
||||||
|
listTypeLoading.value = false;
|
||||||
|
SanckbarWidget(context, next.message, snackbarType.error);
|
||||||
|
} else if (next is ListTypeStateDone) {
|
||||||
|
// print(jsonEncode(next.model));
|
||||||
|
// print(next.model.length);
|
||||||
|
listTypeData.value = next.model;
|
||||||
|
listTypeLoading.value = false;
|
||||||
|
|
||||||
|
var idx = 0;
|
||||||
|
for (var i = 0; i < listTypeData.value.length; i++) {
|
||||||
|
if (listTypeData.value[i].typeid == "KREDIT") {
|
||||||
|
selectedListTypeData.value = listTypeData.value[i];
|
||||||
|
idx = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
selectedListTypeData.value = listTypeData.value[idx];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// category
|
||||||
|
ref.listen(
|
||||||
|
listCategoryProvider,
|
||||||
|
(previous, next) {
|
||||||
|
if (next is ListCategoryStateLoading) {
|
||||||
|
listCategoryLoading.value = true;
|
||||||
|
} else if (next is ListCategoryStateError) {
|
||||||
|
// print(next.message);
|
||||||
|
listCategoryLoading.value = false;
|
||||||
|
SanckbarWidget(context, next.message, snackbarType.error);
|
||||||
|
} else if (next is ListCategoryStateDone) {
|
||||||
|
// print(jsonEncode(next.model));
|
||||||
|
// print(next.model.length);
|
||||||
|
// listCategoryData.value = next.model;
|
||||||
|
final xList = List<ListCategory>.empty(growable: true);
|
||||||
|
xList.add(
|
||||||
|
ListCategory(
|
||||||
|
categoryid: "0",
|
||||||
|
categoryname: "ALL",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
xList.addAll(next.model);
|
||||||
|
listCategoryData.value = xList;
|
||||||
|
listCategoryLoading.value = false;
|
||||||
|
selectedListCategory.value = listCategoryData.value[0];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// search
|
||||||
|
ref.listen(
|
||||||
|
searchHistoryTransaksiProvider,
|
||||||
|
(previous, next) {
|
||||||
|
if (next is SearchHistoryTransaksiStateLoading) {
|
||||||
|
searchHistoryIsLoading.value = true;
|
||||||
|
} else if (next is SearchHistoryTransaksiStateError) {
|
||||||
|
// print(next.message);
|
||||||
|
searchHistoryIsLoading.value = false;
|
||||||
|
SanckbarWidget(context, next.message, snackbarType.error);
|
||||||
|
} else if (next is SearchHistoryTransaksiStateDone) {
|
||||||
|
// print(jsonEncode(next.model));
|
||||||
|
// print(next.model.length);
|
||||||
|
listSearchHistory.value = next.model;
|
||||||
|
searchHistoryIsLoading.value = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
Future<String> getCompanyID() async {
|
||||||
|
final shared = await SharedPreferences.getInstance();
|
||||||
|
String M_CompanyID = "0";
|
||||||
|
|
||||||
|
if (shared != null) {
|
||||||
|
final bearerString = shared.get(Constant.bearerName).toString();
|
||||||
|
final xmodel = jsonDecode(bearerString);
|
||||||
|
if (xmodel != null) {
|
||||||
|
M_CompanyID = xmodel["model"]["M_CompanyID"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (M_CompanyID == "0") {
|
||||||
|
// throw BaseRepositoryException(message: 'Invalid Company ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
return M_CompanyID;
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||||
|
final userID = ref.read(currentUserProvider)?.model.M_UserID ?? "0";
|
||||||
|
if (userID == "0") {
|
||||||
|
//not login
|
||||||
|
Navigator.of(context)
|
||||||
|
.pushNamedAndRemoveUntil(loginRoute, (route) => true);
|
||||||
|
|
||||||
|
// Navigator.popAndPushNamed(context, loginRoute);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return () {};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||||
|
// list Type Provider
|
||||||
|
ref.read(listTypeProvider.notifier).getListType();
|
||||||
|
|
||||||
|
// list category provider
|
||||||
|
ref.read(listCategoryProvider.notifier).getListCategory();
|
||||||
|
|
||||||
|
M_CompanyID = await getCompanyID();
|
||||||
|
|
||||||
|
DateTime parsedDate = DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAwal = DateFormat('yyyy-MM-dd').format(parsedDate);
|
||||||
|
|
||||||
|
DateTime parsedDateAkhir = DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAkhir.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAkhir =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAkhir);
|
||||||
|
|
||||||
|
final categoryid = selectedListCategory.value.categoryid ?? "0";
|
||||||
|
|
||||||
|
// search
|
||||||
|
ref
|
||||||
|
.read(searchHistoryTransaksiProvider.notifier)
|
||||||
|
.searchHistoryTransaksi(
|
||||||
|
M_CompanyID, formattedDateAwal, formattedDateAkhir, categoryid);
|
||||||
|
});
|
||||||
|
return () {};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualYPhone(context: context, y: 30),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(
|
||||||
|
'History Transaksi',
|
||||||
|
style: TextStyle(color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
backgroundColor: Constant.pcBtnBackgroundColor,
|
||||||
|
iconTheme: IconThemeData(
|
||||||
|
color: Constant.textWhite,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
drawer: CustomDrawer(),
|
||||||
|
body: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualYPhone(context: context, y: 15),
|
||||||
|
left: Constant.getActualXPhone(context: context, x: 10),
|
||||||
|
right: Constant.getActualXPhone(context: context, x: 10),
|
||||||
|
bottom: Constant.getActualYPhone(context: context, y: 10),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
// height: MediaQuery.of(context).size.height - 10,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// filter
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
// Tanggal Awal
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
controller: ctrlTglAwal,
|
||||||
|
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: "Tanggal Awal",
|
||||||
|
hintText: 'Tanggal Awal',
|
||||||
|
// suffixIcon: isLoadingFilterScope.value
|
||||||
|
// ? SizedBox(
|
||||||
|
// width: Constant.getActualXPhone(
|
||||||
|
// context: context,
|
||||||
|
// x: 4,
|
||||||
|
// ),
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context,
|
||||||
|
// y: 4,
|
||||||
|
// ),
|
||||||
|
// child: CircularProgressIndicator(
|
||||||
|
// color: Constant.textRed,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : Icon(
|
||||||
|
// Icons.calendar_month_sharp,
|
||||||
|
// color: Constant.colorIconDate,
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
final selectedDateAwal = await showDatePicker(
|
||||||
|
// locale: const Locale("en-CA"),
|
||||||
|
// locale: ,
|
||||||
|
context: context,
|
||||||
|
initialEntryMode:
|
||||||
|
DatePickerEntryMode.calendarOnly,
|
||||||
|
firstDate: DateTime(2000),
|
||||||
|
lastDate: DateTime(2100),
|
||||||
|
|
||||||
|
initialDate: (ctrlTglAwal.text.isEmpty)
|
||||||
|
? DateTime.now()
|
||||||
|
: tglAwal.value,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedDateAwal != null) {
|
||||||
|
String formattedDate = DateFormat('dd-MM-yyyy')
|
||||||
|
.format(selectedDateAwal);
|
||||||
|
// ctrlTglAwal.text =
|
||||||
|
// selectedDateAwal.toString().split(' ')[0];
|
||||||
|
ctrlTglAwal.text = formattedDate;
|
||||||
|
tglAwal.value = selectedDateAwal;
|
||||||
|
tglAwalTmp.value = selectedDateAwal.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDateAwal == null) {
|
||||||
|
print('cancel button');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
width:
|
||||||
|
Constant.getActualXPhone(context: context, x: 10),
|
||||||
|
),
|
||||||
|
// Tanggal Akhir
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
controller: ctrlTglAkhir,
|
||||||
|
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: "Tanggal Akhir",
|
||||||
|
hintText: 'Tanggal Akhir',
|
||||||
|
// suffixIcon: isLoadingFilterScope.value
|
||||||
|
// ? SizedBox(
|
||||||
|
// width: Constant.getActualXPhone(
|
||||||
|
// context: context,
|
||||||
|
// x: 4,
|
||||||
|
// ),
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context,
|
||||||
|
// y: 4,
|
||||||
|
// ),
|
||||||
|
// child: CircularProgressIndicator(
|
||||||
|
// color: Constant.textRed,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : Icon(
|
||||||
|
// Icons.calendar_month_sharp,
|
||||||
|
// color: Constant.colorIconDate,
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
final selectedDateAkhir = await showDatePicker(
|
||||||
|
// locale: const Locale("en-CA"),
|
||||||
|
// locale: ,
|
||||||
|
context: context,
|
||||||
|
initialEntryMode:
|
||||||
|
DatePickerEntryMode.calendarOnly,
|
||||||
|
firstDate: DateTime(2000),
|
||||||
|
lastDate: DateTime(2100),
|
||||||
|
|
||||||
|
initialDate: (ctrlTglAkhir.text.isEmpty)
|
||||||
|
? DateTime.now()
|
||||||
|
: tglAkhir.value,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedDateAkhir != null) {
|
||||||
|
String formattedDate = DateFormat('dd-MM-yyyy')
|
||||||
|
.format(selectedDateAkhir);
|
||||||
|
// ctrlTglAkhir.text =
|
||||||
|
// selectedDateAkhir.toString().split(' ')[0];
|
||||||
|
ctrlTglAkhir.text = formattedDate;
|
||||||
|
tglAkhir.value = selectedDateAkhir;
|
||||||
|
tglAkhirTmp.value = selectedDateAkhir.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDateAkhir == null) {
|
||||||
|
print('cancel button');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 20),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Kategori',
|
||||||
|
style: Constant.body1(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.textBlack,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 10),
|
||||||
|
),
|
||||||
|
// Dropdown kategori
|
||||||
|
(listCategoryLoading.value)
|
||||||
|
? SizedBox(
|
||||||
|
width:
|
||||||
|
Constant.getActualXPhone(context: context, x: 24),
|
||||||
|
height:
|
||||||
|
Constant.getActualYPhone(context: context, y: 32),
|
||||||
|
child: Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: SizedBox(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 390),
|
||||||
|
child: DropdownButtonHideUnderline(
|
||||||
|
child: DropdownButton2<ListCategory>(
|
||||||
|
isExpanded: true,
|
||||||
|
hint: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
'Select Item',
|
||||||
|
style: Constant.body1(context: context)
|
||||||
|
.copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.textBlack),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
items: listCategoryData.value
|
||||||
|
.map((ListCategory option) {
|
||||||
|
return DropdownMenuItem<ListCategory>(
|
||||||
|
value: option,
|
||||||
|
child: Text(
|
||||||
|
option.categoryname ?? "",
|
||||||
|
style: Constant.body1(context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textBlack,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
value: selectedListCategory.value,
|
||||||
|
onChanged: (ListCategory? newValue) {
|
||||||
|
// if (newValue) {
|
||||||
|
selectedListCategory.value = newValue!;
|
||||||
|
print(selectedListCategory.value.categoryid);
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
buttonStyleData: ButtonStyleData(
|
||||||
|
height: Constant.getActualY(
|
||||||
|
context: context, y: 56),
|
||||||
|
width: Constant.getActualX(
|
||||||
|
context: context, x: 320),
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: Constant.getActualX(
|
||||||
|
context: context, x: 10),
|
||||||
|
right: Constant.getActualX(
|
||||||
|
context: context, x: 10),
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Constant.white,
|
||||||
|
border: Border.all(
|
||||||
|
color: Constant.textBlack, width: 1),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
elevation: 2,
|
||||||
|
),
|
||||||
|
iconStyleData: IconStyleData(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.keyboard_arrow_down_outlined,
|
||||||
|
),
|
||||||
|
iconSize: 24,
|
||||||
|
iconEnabledColor: Constant.textBlack,
|
||||||
|
iconDisabledColor: Colors.grey,
|
||||||
|
),
|
||||||
|
dropdownStyleData: DropdownStyleData(
|
||||||
|
maxHeight: Constant.getActualY(
|
||||||
|
context: context, y: 200),
|
||||||
|
// width: Constant.getActualX(context: context, x: 320),
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualY(
|
||||||
|
context: context, y: 10),
|
||||||
|
left: Constant.getActualX(
|
||||||
|
context: context, x: 10),
|
||||||
|
right: Constant.getActualX(
|
||||||
|
context: context, x: 10),
|
||||||
|
bottom: Constant.getActualY(
|
||||||
|
context: context, y: 10),
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Constant.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.grey,
|
||||||
|
blurRadius: 20.0,
|
||||||
|
spreadRadius: 2.0,
|
||||||
|
offset: Offset(0.0, 0.0),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
elevation: 8,
|
||||||
|
offset: const Offset(0, -10),
|
||||||
|
scrollbarTheme: ScrollbarThemeData(
|
||||||
|
radius: const Radius.circular(40),
|
||||||
|
thickness:
|
||||||
|
MaterialStateProperty.all<double>(6),
|
||||||
|
thumbVisibility:
|
||||||
|
MaterialStateProperty.all<bool>(true),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
menuItemStyleData: MenuItemStyleData(
|
||||||
|
height: Constant.getActualY(
|
||||||
|
context: context, y: 56),
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualY(
|
||||||
|
context: context, y: 10),
|
||||||
|
left: Constant.getActualX(
|
||||||
|
context: context, x: 10),
|
||||||
|
right: Constant.getActualX(
|
||||||
|
context: context, x: 10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 10),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 390),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ButtonStyle(
|
||||||
|
backgroundColor: MaterialStateColor.resolveWith(
|
||||||
|
(st) => 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: [
|
||||||
|
(categoryIsLoading.value)
|
||||||
|
? SizedBox(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 24),
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 32),
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
'Search',
|
||||||
|
style: Constant.body1(context: context)
|
||||||
|
.copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.white),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
M_CompanyID = await getCompanyID();
|
||||||
|
ref
|
||||||
|
.read(searchHistoryTransaksiProvider.notifier)
|
||||||
|
.searchHistoryTransaksi(
|
||||||
|
M_CompanyID,
|
||||||
|
ctrlTglAwal.text,
|
||||||
|
ctrlTglAkhir.text,
|
||||||
|
selectedListCategory.value.categoryid ?? "0",
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 20),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Card looping transaksi
|
||||||
|
|
||||||
|
// (searchHistoryIsLoading.value)
|
||||||
|
// ? Center(
|
||||||
|
// child: CircularProgressIndicator(),
|
||||||
|
// )
|
||||||
|
// : Expanded(
|
||||||
|
// child: ListView.builder(
|
||||||
|
// itemCount: listSearchHistory.value.length,
|
||||||
|
// itemBuilder: (context, idx) {
|
||||||
|
// return Card(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.all(16.0),
|
||||||
|
// child: Column(
|
||||||
|
// crossAxisAlignment:
|
||||||
|
// CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// FieldRowHistoryTransaksi(
|
||||||
|
// label: "Tipe",
|
||||||
|
// value: listSearchHistory
|
||||||
|
// .value[idx].tipe
|
||||||
|
// .toString(),
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 8.0),
|
||||||
|
// FieldRowHistoryTransaksi(
|
||||||
|
// label: "Tanggal",
|
||||||
|
// value: listSearchHistory
|
||||||
|
// .value[idx].tanggaltransaksi
|
||||||
|
// .toString(),
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 8.0),
|
||||||
|
// FieldRowHistoryTransaksi(
|
||||||
|
// label: "Nominal",
|
||||||
|
// value: listSearchHistory
|
||||||
|
// .value[idx].amount
|
||||||
|
// .toString(),
|
||||||
|
// // value: "nunggu api",
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 8.0),
|
||||||
|
// FieldRowHistoryTransaksi(
|
||||||
|
// label: "Kategori",
|
||||||
|
// value: listSearchHistory
|
||||||
|
// .value[idx].kategoriname
|
||||||
|
// .toString(),
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 8.0),
|
||||||
|
// if (listSearchHistory
|
||||||
|
// .value[idx].isconfirm ==
|
||||||
|
// "Y")
|
||||||
|
// Row(
|
||||||
|
// mainAxisAlignment:
|
||||||
|
// MainAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Chip(
|
||||||
|
// label: Text(
|
||||||
|
// 'Confirmed',
|
||||||
|
// style: TextStyle(
|
||||||
|
// color:
|
||||||
|
// Constant.green_600),
|
||||||
|
// ),
|
||||||
|
// shape: RoundedRectangleBorder(
|
||||||
|
// side: BorderSide(
|
||||||
|
// color:
|
||||||
|
// Constant.green_600),
|
||||||
|
// borderRadius:
|
||||||
|
// BorderRadius.circular(
|
||||||
|
// 4.0),
|
||||||
|
// ),
|
||||||
|
// backgroundColor: Colors.white,
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// SizedBox(
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context, y: 6),
|
||||||
|
// ),
|
||||||
|
// if (listSearchHistory
|
||||||
|
// .value[idx].isconfirm ==
|
||||||
|
// "N")
|
||||||
|
// Row(
|
||||||
|
// mainAxisAlignment:
|
||||||
|
// MainAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// ElevatedButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// // Handle delete button tap
|
||||||
|
// },
|
||||||
|
// child: Text(
|
||||||
|
// 'Delete',
|
||||||
|
// style: TextStyle(
|
||||||
|
// color:
|
||||||
|
// Constant.textWhite),
|
||||||
|
// ),
|
||||||
|
// style: ElevatedButton.styleFrom(
|
||||||
|
// backgroundColor: Colors
|
||||||
|
// .red, // Ganti dengan warna delete button yang diinginkan
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
(searchHistoryIsLoading.value)
|
||||||
|
? Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
)
|
||||||
|
: Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: listSearchHistory.value.length,
|
||||||
|
itemBuilder: (context, idx) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
bottom: Constant.getActualYPhone(
|
||||||
|
context: context,
|
||||||
|
y: 10,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Card(
|
||||||
|
elevation: 2.0,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: Column(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// atas
|
||||||
|
HistoryRowAtasWidget(
|
||||||
|
icon_category_id: listSearchHistory
|
||||||
|
.value[idx].kategoriid
|
||||||
|
.toString(),
|
||||||
|
icon_category_name: listSearchHistory
|
||||||
|
.value[idx].kategoriname
|
||||||
|
.toString(),
|
||||||
|
amount: listSearchHistory
|
||||||
|
.value[idx].amount
|
||||||
|
.toString(),
|
||||||
|
tglTransaksi: listSearchHistory
|
||||||
|
.value[idx].tanggaltransaksi
|
||||||
|
.toString(),
|
||||||
|
tipe: listSearchHistory
|
||||||
|
.value[idx].tipe
|
||||||
|
.toString(),
|
||||||
|
),
|
||||||
|
|
||||||
|
// bawah
|
||||||
|
|
||||||
|
if (listSearchHistory
|
||||||
|
.value[idx].isconfirm ==
|
||||||
|
"Y")
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Chip(
|
||||||
|
label: Text(
|
||||||
|
'Confirmed',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Constant.textWhite,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
side: BorderSide(
|
||||||
|
color:
|
||||||
|
Constant.bgChipConfirmed),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(
|
||||||
|
50,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
backgroundColor:
|
||||||
|
Constant.bgChipConfirmed,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 6),
|
||||||
|
),
|
||||||
|
|
||||||
|
if (listSearchHistory
|
||||||
|
.value[idx].isconfirm ==
|
||||||
|
"N")
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
print('Deleted');
|
||||||
|
},
|
||||||
|
child: Chip(
|
||||||
|
label: Text(
|
||||||
|
'Deleted',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Constant.textWhite,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
side: BorderSide(
|
||||||
|
color:
|
||||||
|
Constant.bgTextChipDelete),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(
|
||||||
|
50,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
backgroundColor:
|
||||||
|
Constant.bgTextDelete,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// Container(
|
||||||
|
// width: Constant.getActualXPhone(
|
||||||
|
// context: context, x: 40),
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context,
|
||||||
|
// y: 40,
|
||||||
|
// ),
|
||||||
|
// child: Image.asset(
|
||||||
|
// "images/icon_delete.png",
|
||||||
|
// // scale: 1,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// SizedBox(
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context, y: 12),
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// child: ElevatedButton(
|
||||||
|
// style: ButtonStyle(
|
||||||
|
// backgroundColor: MaterialStateColor
|
||||||
|
// .resolveWith((st) => 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: [
|
||||||
|
// Text(
|
||||||
|
// 'Confirmed',
|
||||||
|
// style: Constant.body1(
|
||||||
|
// context: context)
|
||||||
|
// .copyWith(
|
||||||
|
// fontWeight:
|
||||||
|
// FontWeight
|
||||||
|
// .w600,
|
||||||
|
// color: Constant
|
||||||
|
// .white),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// onPressed: () {},
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
|
import '../../model/history_transaksi_model.dart';
|
||||||
|
import '../../repository/transaksi_repository.dart';
|
||||||
|
import '../../provider/dio_provider.dart';
|
||||||
|
import '../../repository/base_repository.dart';
|
||||||
|
|
||||||
|
abstract class SearchHistoryTransaksiState extends Equatable {
|
||||||
|
final DateTime date;
|
||||||
|
const SearchHistoryTransaksiState(this.date);
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [date];
|
||||||
|
}
|
||||||
|
|
||||||
|
class SearchHistoryTransaksiStateInit extends SearchHistoryTransaksiState {
|
||||||
|
SearchHistoryTransaksiStateInit() : super(DateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
class SearchHistoryTransaksiStateLoading extends SearchHistoryTransaksiState {
|
||||||
|
SearchHistoryTransaksiStateLoading() : super(DateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
class SearchHistoryTransaksiStateError extends SearchHistoryTransaksiState {
|
||||||
|
final String message;
|
||||||
|
SearchHistoryTransaksiStateError({
|
||||||
|
required this.message,
|
||||||
|
}) : super(DateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
class SearchHistoryTransaksiStateDone extends SearchHistoryTransaksiState {
|
||||||
|
final List<HistoryTransaksiModel> model;
|
||||||
|
SearchHistoryTransaksiStateDone({
|
||||||
|
required this.model,
|
||||||
|
}) : super(DateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
//notifier
|
||||||
|
class SearchHistoryTransaksiNotifier
|
||||||
|
extends StateNotifier<SearchHistoryTransaksiState> {
|
||||||
|
final Ref ref;
|
||||||
|
SearchHistoryTransaksiNotifier({
|
||||||
|
required this.ref,
|
||||||
|
}) : super(SearchHistoryTransaksiStateInit());
|
||||||
|
|
||||||
|
void searchHistoryTransaksi(
|
||||||
|
String companyid,
|
||||||
|
String tglAwal,
|
||||||
|
String tglAkhir,
|
||||||
|
String categoryid,
|
||||||
|
) async {
|
||||||
|
try {
|
||||||
|
state = SearchHistoryTransaksiStateLoading();
|
||||||
|
final dio = ref.read(dioProvider);
|
||||||
|
final resp = await TransaksiRepository(dio: dio).getListHistoryTransaksi(
|
||||||
|
companyid,
|
||||||
|
tglAwal,
|
||||||
|
tglAkhir,
|
||||||
|
categoryid,
|
||||||
|
);
|
||||||
|
state = SearchHistoryTransaksiStateDone(model: resp);
|
||||||
|
} catch (e) {
|
||||||
|
if (e is BaseRepositoryException) {
|
||||||
|
state = SearchHistoryTransaksiStateError(message: e.message.toString());
|
||||||
|
} else {
|
||||||
|
state = SearchHistoryTransaksiStateError(message: e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//provider
|
||||||
|
final searchHistoryTransaksiProvider = StateNotifierProvider<
|
||||||
|
SearchHistoryTransaksiNotifier, SearchHistoryTransaksiState>(
|
||||||
|
(ref) => SearchHistoryTransaksiNotifier(ref: ref),
|
||||||
|
);
|
||||||
@@ -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,59 +65,149 @@ class CustomDrawer extends HookConsumerWidget {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final currentMenu = ref.read(currentPageProvider);
|
||||||
|
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.only(
|
// padding: EdgeInsets.only(
|
||||||
top: Constant.getActualYPhone(context: context, y: 10),
|
// top: Constant.getActualYPhone(context: context, y: 10),
|
||||||
),
|
// ),
|
||||||
children: [
|
children: [
|
||||||
// DrawerHeader(
|
DrawerHeader(
|
||||||
// decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: Colors.blue,
|
color: Colors.blue,
|
||||||
// ),
|
),
|
||||||
// child: Text(
|
child: Text(
|
||||||
// 'Drawer Header',
|
'Drawer Header',
|
||||||
// style: TextStyle(
|
style: TextStyle(
|
||||||
// color: Colors.white,
|
color: Colors.white,
|
||||||
// fontSize: 24,
|
fontSize: 24,
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
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(
|
||||||
onTap: () {
|
'History Transaksi',
|
||||||
// Handle navigation to Transaksi screen
|
style: TextStyle(
|
||||||
Navigator.pop(context);
|
color: (currentMenu == 2)
|
||||||
Navigator.pushNamed(context, reportRoute);
|
? Constant.textWhite
|
||||||
},
|
: Constant.textBlack,
|
||||||
),
|
),
|
||||||
ListTile(
|
),
|
||||||
title: Text('User'),
|
tileColor: (currentMenu == 2)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Colors.transparent,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Handle navigation to User screen
|
// Handle navigation to User screen
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
Navigator.pushNamed(context, userRoute);
|
ref.read(currentPageProvider.state).update((state) => 2);
|
||||||
|
Navigator.pushNamed(context, historyTransaksiRoute);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text('Logout'),
|
title: Text(
|
||||||
|
'Report',
|
||||||
|
style: TextStyle(
|
||||||
|
color: (currentMenu == 3)
|
||||||
|
? Constant.textWhite
|
||||||
|
: Constant.textBlack,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
tileColor: (currentMenu == 3)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Colors.transparent,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
// Handle navigation to Transaksi screen
|
||||||
|
Navigator.pop(context);
|
||||||
|
ref.read(currentPageProvider.state).update((state) => 3);
|
||||||
|
Navigator.pushNamed(context, reportRoute);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// ListTile(
|
||||||
|
// title: Text(
|
||||||
|
// 'User',
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: (currentMenu == 4)
|
||||||
|
// ? Constant.textWhite
|
||||||
|
// : Constant.textBlack,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// tileColor: (currentMenu == 4)
|
||||||
|
// ? Constant.pcBtnBackgroundColor
|
||||||
|
// : Colors.transparent,
|
||||||
|
// onTap: () {
|
||||||
|
// // Handle navigation to User screen
|
||||||
|
// Navigator.pop(context);
|
||||||
|
// ref.read(currentPageProvider.state).update((state) => 4);
|
||||||
|
// Navigator.pushNamed(context, userRoute);
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ListTile(
|
||||||
|
// title: Text(
|
||||||
|
// 'Change Company',
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: (currentMenu == 5)
|
||||||
|
// ? Constant.textWhite
|
||||||
|
// : Constant.textBlack,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// tileColor: (currentMenu == 5)
|
||||||
|
// ? Constant.pcBtnBackgroundColor
|
||||||
|
// : Colors.transparent,
|
||||||
|
// onTap: () {
|
||||||
|
// // Handle navigation to User screen
|
||||||
|
// Navigator.pop(context);
|
||||||
|
// ref.read(currentPageProvider.state).update((state) => 5);
|
||||||
|
// Navigator.pushNamed(context, changeCompanyRoute);
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
ListTile(
|
||||||
|
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(
|
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 ?? "",
|
||||||
|
|||||||
42
app_petty_cash/lib/widget/field_row_history_transaksi.dart
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
|
import '../app/constant.dart';
|
||||||
|
|
||||||
|
class FieldRowHistoryTransaksi extends HookConsumerWidget {
|
||||||
|
final String label;
|
||||||
|
final String value;
|
||||||
|
const FieldRowHistoryTransaksi({
|
||||||
|
Key? key,
|
||||||
|
required this.label,
|
||||||
|
required this.value,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 10),
|
||||||
|
child: SizedBox(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 100),
|
||||||
|
child: Text(label),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
child: Text(':'),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(right: 10),
|
||||||
|
child: Text(
|
||||||
|
value,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
177
app_petty_cash/lib/widget/history_row_atas_widget.dart
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
import 'package:app_petty_cash/widget/sankbar_widget.dart';
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
|
import '../app/constant.dart';
|
||||||
|
|
||||||
|
class HistoryRowAtasWidget extends HookConsumerWidget {
|
||||||
|
final String icon_category_id;
|
||||||
|
final String icon_category_name;
|
||||||
|
final String amount;
|
||||||
|
final String tipe;
|
||||||
|
final String tglTransaksi;
|
||||||
|
|
||||||
|
const HistoryRowAtasWidget({
|
||||||
|
Key? key,
|
||||||
|
required this.icon_category_id,
|
||||||
|
required this.icon_category_name,
|
||||||
|
required this.amount,
|
||||||
|
required this.tipe,
|
||||||
|
required this.tglTransaksi,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
|
||||||
|
// check file exist
|
||||||
|
Future<Widget> checkFileExistence(String fileUrl) async {
|
||||||
|
try {
|
||||||
|
final dio = Dio();
|
||||||
|
final response = await dio.head(fileUrl);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
return SvgPicture.network(
|
||||||
|
fileUrl,
|
||||||
|
semanticsLabel: 'Icon pizza',
|
||||||
|
placeholderBuilder: (BuildContext context) => Container(
|
||||||
|
padding: const EdgeInsets.all(30.0),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return SvgPicture.network(
|
||||||
|
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg',
|
||||||
|
semanticsLabel: 'Icon pizza',
|
||||||
|
placeholderBuilder: (BuildContext context) => Container(
|
||||||
|
padding: const EdgeInsets.all(30.0),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// print('Error checking file existence: $e');
|
||||||
|
return SvgPicture.network(
|
||||||
|
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg',
|
||||||
|
semanticsLabel: 'Icon pizza',
|
||||||
|
placeholderBuilder: (BuildContext context) => Container(
|
||||||
|
padding: const EdgeInsets.all(30.0),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
// kiri
|
||||||
|
Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 38),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 38),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color.fromRGBO(241, 90, 41, 0.08),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(8.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// child: Text('s'),
|
||||||
|
child: FutureBuilder<Widget>(
|
||||||
|
future: checkFileExistence('https://devone.aplikasi.web.id/pettycash-media/icon/icon_$icon_category_id.svg'),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
return CircularProgressIndicator();
|
||||||
|
} else if (snapshot.hasError) {
|
||||||
|
return Icon(
|
||||||
|
Icons.error,
|
||||||
|
color: Colors.red,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return snapshot.data ??
|
||||||
|
Container();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// tengah
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: Constant.getActualYPhone(context: context, y: 20),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
icon_category_name,
|
||||||
|
style: Constant.body2_600(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.textBlack,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context,
|
||||||
|
y: 8,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
amount,
|
||||||
|
style: Constant.body1_600(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.pcBtnBackgroundColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// kanan
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
right: Constant.getActualYPhone(context: context, y: 8),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
// width: Constant.getActualXPhone(context: context, x: 32),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 19),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Constant.bgIconHistory,
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(6.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(2.0),
|
||||||
|
child: Text(
|
||||||
|
tipe,
|
||||||
|
style: Constant.body1_600(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.pcBtnBackgroundColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context,
|
||||||
|
y: 8,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
tglTransaksi,
|
||||||
|
style: Constant.body1_600(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600, color: Constant.textGreyv2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
177
app_petty_cash/lib/widget/homepage_row_transaksi.dart
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
import 'package:app_petty_cash/widget/sankbar_widget.dart';
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
|
import '../app/constant.dart';
|
||||||
|
|
||||||
|
class HomepageRowTransaksiWidget extends HookConsumerWidget {
|
||||||
|
final String icon_category_id;
|
||||||
|
final String icon_category_name;
|
||||||
|
final String amount;
|
||||||
|
final String tipe;
|
||||||
|
final String tglTransaksi;
|
||||||
|
|
||||||
|
const HomepageRowTransaksiWidget({
|
||||||
|
Key? key,
|
||||||
|
required this.icon_category_id,
|
||||||
|
required this.icon_category_name,
|
||||||
|
required this.amount,
|
||||||
|
required this.tipe,
|
||||||
|
required this.tglTransaksi,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
|
||||||
|
// check file exist
|
||||||
|
Future<Widget> checkFileExistence(String fileUrl) async {
|
||||||
|
try {
|
||||||
|
final dio = Dio();
|
||||||
|
final response = await dio.head(fileUrl);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
return SvgPicture.network(
|
||||||
|
fileUrl,
|
||||||
|
semanticsLabel: 'Icon pizza',
|
||||||
|
placeholderBuilder: (BuildContext context) => Container(
|
||||||
|
padding: const EdgeInsets.all(30.0),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return SvgPicture.network(
|
||||||
|
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg',
|
||||||
|
semanticsLabel: 'Icon pizza',
|
||||||
|
placeholderBuilder: (BuildContext context) => Container(
|
||||||
|
padding: const EdgeInsets.all(30.0),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// print('Error checking file existence: $e');
|
||||||
|
return SvgPicture.network(
|
||||||
|
'https://devone.aplikasi.web.id/pettycash-media/icon/icon_13.svg',
|
||||||
|
semanticsLabel: 'Icon pizza',
|
||||||
|
placeholderBuilder: (BuildContext context) => Container(
|
||||||
|
padding: const EdgeInsets.all(30.0),
|
||||||
|
child: const CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
// kiri
|
||||||
|
Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 38),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 38),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color.fromRGBO(241, 90, 41, 0.08),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(8.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// child: Text('s'),
|
||||||
|
child: FutureBuilder<Widget>(
|
||||||
|
future: checkFileExistence('https://devone.aplikasi.web.id/pettycash-media/icon/icon_$icon_category_id.svg'),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
return CircularProgressIndicator();
|
||||||
|
} else if (snapshot.hasError) {
|
||||||
|
return Icon(
|
||||||
|
Icons.error,
|
||||||
|
color: Colors.red,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return snapshot.data ??
|
||||||
|
Container();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// tengah
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: Constant.getActualYPhone(context: context, y: 20),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
icon_category_name,
|
||||||
|
style: Constant.body2_600(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.textBlack,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context,
|
||||||
|
y: 8,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
amount,
|
||||||
|
style: Constant.body1_600(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.pcBtnBackgroundColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// kanan
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
right: Constant.getActualYPhone(context: context, y: 8),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
// width: Constant.getActualXPhone(context: context, x: 32),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 19),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Constant.bgIconHistory,
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(6.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(2.0),
|
||||||
|
child: Text(
|
||||||
|
tipe,
|
||||||
|
style: Constant.body1_600(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.pcBtnBackgroundColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context,
|
||||||
|
y: 8,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
tglTransaksi,
|
||||||
|
style: Constant.body1_600(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600, color: Constant.textGreyv2),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
|
args:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: args
|
||||||
|
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.2"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -53,10 +61,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
|
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.17.1"
|
version: "1.18.0"
|
||||||
convert:
|
convert:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -190,6 +198,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
|
flutter_svg:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_svg
|
||||||
|
sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.9"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -224,14 +240,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.17.0"
|
version: "0.17.0"
|
||||||
js:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: js
|
|
||||||
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.6.7"
|
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -244,26 +252,26 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
|
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.15"
|
version: "0.12.16"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
|
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.0"
|
version: "0.5.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
|
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
version: "1.10.0"
|
||||||
open_file:
|
open_file:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -280,6 +288,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.3"
|
version: "1.8.3"
|
||||||
|
path_parsing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_parsing
|
||||||
|
sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -344,6 +360,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.3"
|
version: "0.1.3"
|
||||||
|
petitparser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: petitparser
|
||||||
|
sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.4.0"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -433,18 +457,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
|
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
version: "1.10.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
|
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.11.0"
|
version: "1.11.1"
|
||||||
state_notifier:
|
state_notifier:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -457,10 +481,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stream_channel
|
name: stream_channel
|
||||||
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
|
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.2"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -481,10 +505,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
|
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.1"
|
version: "0.6.1"
|
||||||
top_snackbar_flutter:
|
top_snackbar_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -565,6 +589,30 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.1"
|
version: "3.1.1"
|
||||||
|
vector_graphics:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics
|
||||||
|
sha256: "18f6690295af52d081f6808f2f7c69f0eed6d7e23a71539d75f4aeb8f0062172"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.9+2"
|
||||||
|
vector_graphics_codec:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics_codec
|
||||||
|
sha256: "531d20465c10dfac7f5cd90b60bbe4dd9921f1ec4ca54c83ebb176dbacb7bb2d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.9+2"
|
||||||
|
vector_graphics_compiler:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics_compiler
|
||||||
|
sha256: "03012b0a33775c5530576b70240308080e1d5050f0faf000118c20e6463bc0ad"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.9+2"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -573,6 +621,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.4"
|
||||||
|
web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web
|
||||||
|
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.0"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -589,6 +645,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
|
xml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xml
|
||||||
|
sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.3.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.0.6 <4.0.0"
|
dart: ">=3.2.0-194.0.dev <4.0.0"
|
||||||
flutter: ">=3.10.0"
|
flutter: ">=3.10.0"
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ dependencies:
|
|||||||
flutter_multi_formatter: ^2.12.4
|
flutter_multi_formatter: ^2.12.4
|
||||||
top_snackbar_flutter: ^3.1.0
|
top_snackbar_flutter: ^3.1.0
|
||||||
url_launcher: ^6.1.13
|
url_launcher: ^6.1.13
|
||||||
|
flutter_svg: ^2.0.9
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@@ -90,9 +91,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
|
||||||
|
|||||||