From 72c178382f62ea85029d5bedf3db88c8cc16752d Mon Sep 17 00:00:00 2001 From: Aamir Muhammad Date: Thu, 1 May 2025 21:22:52 +0300 Subject: [PATCH] time sheet changes --- assets/icons/itg/alert.svg | 3 + assets/icons/itg/calendar-remove.svg | 4 + assets/icons/itg/calendar.svg | 8 + assets/icons/itg/coming-soon.svg | 3 + assets/icons/itg/finger-print-remove.svg | 10 + assets/icons/itg/knight-shield.svg | 3 + assets/icons/itg/money-not-found.svg | 4 + assets/icons/itg/stethoscope.svg | 3 + assets/icons/itg/time-quarter-pass.svg | 15 + assets/icons/itg/time-quarter.svg | 7 + lib/api/dashboard_api_client.dart | 215 +++-- lib/api/worklist/worklist_api_client.dart | 882 ++++++++++-------- lib/classes/consts.dart | 8 +- lib/main.dart | 54 +- lib/models/itg/itg_summary_data.dart | 101 ++ lib/provider/dashboard_provider_model.dart | 15 +- lib/ui/login/verify_last_login_screen.dart | 206 ++-- lib/ui/work_list/itg_detail_screen.dart | 266 +++--- .../request_detail_fragment.dart | 151 +-- lib/ui/work_list/work_list_screen.dart | 373 ++++---- lib/widgets/otp_widget.dart | 22 +- pubspec.yaml | 3 +- 22 files changed, 1228 insertions(+), 1128 deletions(-) create mode 100644 assets/icons/itg/alert.svg create mode 100644 assets/icons/itg/calendar-remove.svg create mode 100644 assets/icons/itg/calendar.svg create mode 100644 assets/icons/itg/coming-soon.svg create mode 100644 assets/icons/itg/finger-print-remove.svg create mode 100644 assets/icons/itg/knight-shield.svg create mode 100644 assets/icons/itg/money-not-found.svg create mode 100644 assets/icons/itg/stethoscope.svg create mode 100644 assets/icons/itg/time-quarter-pass.svg create mode 100644 assets/icons/itg/time-quarter.svg create mode 100644 lib/models/itg/itg_summary_data.dart diff --git a/assets/icons/itg/alert.svg b/assets/icons/itg/alert.svg new file mode 100644 index 0000000..6f0f0ca --- /dev/null +++ b/assets/icons/itg/alert.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/itg/calendar-remove.svg b/assets/icons/itg/calendar-remove.svg new file mode 100644 index 0000000..965a40c --- /dev/null +++ b/assets/icons/itg/calendar-remove.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/itg/calendar.svg b/assets/icons/itg/calendar.svg new file mode 100644 index 0000000..2ac497c --- /dev/null +++ b/assets/icons/itg/calendar.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/itg/coming-soon.svg b/assets/icons/itg/coming-soon.svg new file mode 100644 index 0000000..52d5ffc --- /dev/null +++ b/assets/icons/itg/coming-soon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/itg/finger-print-remove.svg b/assets/icons/itg/finger-print-remove.svg new file mode 100644 index 0000000..bc6fe65 --- /dev/null +++ b/assets/icons/itg/finger-print-remove.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/icons/itg/knight-shield.svg b/assets/icons/itg/knight-shield.svg new file mode 100644 index 0000000..e0bf799 --- /dev/null +++ b/assets/icons/itg/knight-shield.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/itg/money-not-found.svg b/assets/icons/itg/money-not-found.svg new file mode 100644 index 0000000..01121a6 --- /dev/null +++ b/assets/icons/itg/money-not-found.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/itg/stethoscope.svg b/assets/icons/itg/stethoscope.svg new file mode 100644 index 0000000..31c4638 --- /dev/null +++ b/assets/icons/itg/stethoscope.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/itg/time-quarter-pass.svg b/assets/icons/itg/time-quarter-pass.svg new file mode 100644 index 0000000..5a8a758 --- /dev/null +++ b/assets/icons/itg/time-quarter-pass.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/icons/itg/time-quarter.svg b/assets/icons/itg/time-quarter.svg new file mode 100644 index 0000000..7eaf056 --- /dev/null +++ b/assets/icons/itg/time-quarter.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/lib/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart index ad6696a..145b039 100644 --- a/lib/api/dashboard_api_client.dart +++ b/lib/api/dashboard_api_client.dart @@ -13,6 +13,7 @@ import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/itg/itg_main_response.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; import 'package:platform_device_id/platform_device_id.dart'; + // import 'package:platform_device_id/platform_device_id.dart'; import 'package:uuid/uuid.dart'; @@ -27,40 +28,56 @@ class DashboardApiClient { String url = "${ApiConsts.erpRest}GET_Attendance_Tracking"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getAttendanceTrackingList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getAttendanceTrackingList; + }, + url, + postParams, + ); } Future getOpenNotifications() async { String url = "${ApiConsts.erpRest}GET_OPEN_NOTIFICATIONS"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future getCOCNotifications() async { String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks"; Map postParams = {"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future getItgFormsPendingTask() async { String url = "${ApiConsts.cocRest}ITGFormsPendingTasks"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future> getAccrualBalances(String effectiveDate, {String? empID}) async { @@ -68,20 +85,28 @@ class DashboardApiClient { Map postParams = {"P_EFFECTIVE_DATE": effectiveDate}; postParams.addAll(AppState().postParamsJson); if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID; - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getAccrualBalancesList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getAccrualBalancesList ?? []; + }, + url, + postParams, + ); } Future getOpenMissingSwipes() async { String url = "${ApiConsts.erpRest}GET_OPEN_MISSING_SWIPES"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } //Menus List @@ -89,10 +114,14 @@ class DashboardApiClient { String url = "${ApiConsts.erpRest}GET_MENU"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.listMenu ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.listMenu ?? []; + }, + url, + postParams, + ); } //GET_MENU_ENTRIES @@ -100,24 +129,40 @@ class DashboardApiClient { String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES"; Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future getEventActivity() async { String url = "${ApiConsts.erpRest}Get_EventActivity"; Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } //Mark Attendance - Future markAttendance({String lat = "0", String? long = "0", required int pointType, String nfcValue = "", bool isGpsRequired = false, String QRValue = "", String payrollCode = ""}) async { + Future markAttendance({ + String lat = "0", + String? long = "0", + required int pointType, + String nfcValue = "", + bool isGpsRequired = false, + String QRValue = "", + String payrollCode = "", + }) async { String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC"; var uuid = Uuid(); // Generate a v4 (random) id @@ -132,13 +177,17 @@ class DashboardApiClient { "NFCValue": nfcValue, "WifiValue": pointType == 3 ? "100" : "", "IsGpsRequired": isGpsRequired, - "PayrollCodeStr": AppState().postParamsObject?.payrollCodeStr.toString() ?? "" + "PayrollCodeStr": AppState().postParamsObject?.payrollCodeStr.toString() ?? "", }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } //Mark Fake Location @@ -157,10 +206,14 @@ class DashboardApiClient { "EmployeeID": AppState().memberInformationList!.eMPLOYEENUMBER, }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } //Check ITG Type @@ -170,15 +223,19 @@ class DashboardApiClient { Map postParams = { "EmployeeNumber": AppState().getUserName, "ItgEnableAt": "After Service Submission", //Mobile Id - "ItgServiceName": "Login" + "ItgServiceName": "Login", }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - MohemmItgResponseItem res = MohemmItgResponseItem.fromJson(jsonDecode(responseData.mohemmITGResponseItem ?? "")); - // var jsonDecodedData = jsonDecode(jsonDecode(responseData.mohemmITGResponseItem!)['result']['data']); - return res; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + MohemmItgResponseItem res = MohemmItgResponseItem.fromJson(jsonDecode(responseData.mohemmITGResponseItem ?? "")); + // var jsonDecodedData = jsonDecode(jsonDecode(responseData.mohemmITGResponseItem!)['result']['data']); + return res; + }, + url, + postParams, + ); } //Submit ITG @@ -190,13 +247,17 @@ class DashboardApiClient { "ItgComments": comment, "ItgNotificationMasterId": masterId, "ItgQuestionResponses": itgList, - "ItgSurveyId": serviceId + "ItgSurveyId": serviceId, }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgMainRes responseData = ItgMainRes.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgMainRes responseData = ItgMainRes.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future getAdvertisementDetail(String masterID) async { @@ -207,10 +268,14 @@ class DashboardApiClient { "ItgNotificationMasterId": masterID, //Mobile Id }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgMainRes responseData = ItgMainRes.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgMainRes responseData = ItgMainRes.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future setAdvertisementViewed(String masterID, int advertisementId, String? ackValue) async { @@ -224,9 +289,27 @@ class DashboardApiClient { // "ItgAdvertisement": {"ItgAdvertisementId": advertisementId, "ItgAcknowledgment": ackValue} //Mobile Id }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - // ItgMainRes responseData = ItgMainRes.fromJson(json); - return json; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + // ItgMainRes responseData = ItgMainRes.fromJson(json); + return json; + }, + url, + postParams, + ); } + + // Future getItgTimeCardDetails() async { + // String url = "${ApiConsts.cocRest}ITG_TimeCard_Get"; + // Map postParams = {}; + // postParams.addAll(AppState().postParamsJson); + // return await ApiClient().postJsonForObject( + // (json) { + // ItgTimeCardModel responseData = ItgTimeCardModel.fromJson(json); + // return responseData; + // }, + // url, + // postParams, + // ); + // } } diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index 9667961..51a47bb 100644 --- a/lib/api/worklist/worklist_api_client.dart +++ b/lib/api/worklist/worklist_api_client.dart @@ -45,8 +45,15 @@ class WorkListApiClient { factory WorkListApiClient() => _instance; - Future?> getWorkList(int pPageNum, String pItemType, String pNotificationType, - {String pSearchUser = "", String pSearchItemType = "", String pSentDate = "", String pSearchSubject = ""}) async { + Future?> getWorkList( + int pPageNum, + String pItemType, + String pNotificationType, { + String pSearchUser = "", + String pSearchItemType = "", + String pSentDate = "", + String pSearchSubject = "", + }) async { String url = "${ApiConsts.erpRest}GET_WORKLIST"; Map postParams = { "P_NOTIFICATION_TYPE": pNotificationType, @@ -56,171 +63,200 @@ class WorkListApiClient { "P_SEARCH_FROM_USER": pSearchUser, "P_SEARCH_ITEM_TYPE_DSP_NAME": pSearchItemType, "P_SEARCH_SENT_DATE": pSentDate, - "P_SEARCH_SUBJECT": pSearchSubject + "P_SEARCH_SUBJECT": pSearchSubject, }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel? responseData = GenericResponseModel.fromJson(json); - return responseData.getWorkList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getWorkList; + }, + url, + postParams, + ); } Future getITGTaskCountRequestType() async { String url = "${ApiConsts.cocRest}ITGGetTaskCountRequestType"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future getSubordinatesLeaves(String fromDate, String toDate) async { String url = "${ApiConsts.erpRest}GET_SUBORDINATES_LEAVES"; Map postParams = {"P_DATE_FROM": "/Date(1639861200000+0300)/", "P_DATE_TO": "/Date(1640120400000+0300)/"}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future> getAttachments(int pNotificationID) async { String url = "${ApiConsts.erpRest}GET_ATTACHMENTS"; Map postParams = {"P_NOTIFICATION_ID": pNotificationID}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getAttachementList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getAttachementList ?? []; + }, + url, + postParams, + ); } Future> getPRAttachments(String pOLineID) async { String url = "${ApiConsts.erpRest}GET_PR_ATTACHMENTS"; Map postParams = {"P_PO_LINE_ID": pOLineID}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getPRAttachmentList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPRAttachmentList ?? []; + }, + url, + postParams, + ); } Future> getRFCEmployeeeList(int pNotificationID) async { String url = "${ApiConsts.erpRest}GET_RFC_EMPLOYEE_LIST"; Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_PAGE_NUM": 1, "P_PAGE_LIMIT": 10}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getRFCEmployeeListList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getRFCEmployeeListList ?? []; + }, + url, + postParams, + ); } Future> getActionHistory(int pNotificationID) async { String url = "${ApiConsts.erpRest}GET_ACTION_HISTORY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getActionHistoryList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getActionHistoryList ?? []; + }, + url, + postParams, + ); } Future> getActionHistoryForPR(String pOLineID) async { String url = "${ApiConsts.erpRest}GET_PR_ACTION_HISTORY"; - Map postParams = { - "P_PO_LINE_ID": pOLineID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_PO_LINE_ID": pOLineID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getPRActionHistoryList?.reversed.toList() ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPRActionHistoryList?.reversed.toList() ?? []; + }, + url, + postParams, + ); } Future> getNotificationButtons(int pNotificationID) async { String url = "${ApiConsts.erpRest}GET_NOTIFICATION_BUTTONS"; Map postParams = {"P_NOTIFICATION_ID": pNotificationID}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getNotificationButtonsList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getNotificationButtonsList ?? []; + }, + url, + postParams, + ); } Future> notificationGetRespondAttributes(int pNotificationID) async { String url = "${ApiConsts.erpRest}NOTIFICATION_GET_RESPOND_ATTRIBUTES"; Map postParams = {"P_NOTIFICATION_ID": pNotificationID}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.notificationGetRespondAttributesList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.notificationGetRespondAttributesList ?? []; + }, + url, + postParams, + ); } Future getBasicDetNTFBody(int pNotificationID, int pTransactionID) async { String url = "${ApiConsts.erpRest}GET_BASIC_DET_NTF_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_TRANSACTION_ID": pTransactionID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_TRANSACTION_ID": pTransactionID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future getUserInformation(int pSelectedResopID, String selectedEmployeeNumber) async { String url = "${ApiConsts.erpRest}Get_UserInformation"; - Map postParams = { - "P_SELECTED_RESP_ID": pSelectedResopID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_SELECTED_RESP_ID": pSelectedResopID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); if (selectedEmployeeNumber != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber; - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.memberInformationList![0]; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.memberInformationList![0]; + }, + url, + postParams, + ); } Future> getStampMsNotificationBody(int pNotificationID, int pTransactionID) async { String url = "${ApiConsts.erpRest}GET_STAMP_MS_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_TRANSACTION_ID": pTransactionID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_TRANSACTION_ID": pTransactionID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getStampMsNotificationBodyList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getStampMsNotificationBodyList ?? []; + }, + url, + postParams, + ); } Future> getStampNsNotificationBody(int pNotificationID, int pTransactionID) async { String url = "${ApiConsts.erpRest}GET_STAMP_NS_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_TRANSACTION_ID": pTransactionID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_TRANSACTION_ID": pTransactionID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getStampNsNotificationBodyList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getStampNsNotificationBodyList ?? []; + }, + url, + postParams, + ); } // Future> getAbsenceNotificationBody(int pNotificationID, int pTransactionID) async { @@ -241,227 +277,227 @@ class WorkListApiClient { Future postNotificationActions(Map postParams) async { String url = "${ApiConsts.erpRest}NOTIFICATION_ACTIONS"; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future> getMoNotificationBody(int pNotificationID, int pTransactionID) async { String url = "${ApiConsts.erpRest}GET_MO_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_TRANSACTION_ID": pTransactionID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_TRANSACTION_ID": pTransactionID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getMoNotificationBodyList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getMoNotificationBodyList ?? []; + }, + url, + postParams, + ); } Future getPoNotificationBody(int pNotificationID, int pTransactionID) async { String url = "${ApiConsts.erpRest}GET_PO_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_TRANSACTION_ID": pTransactionID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_TRANSACTION_ID": pTransactionID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getPoNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPoNotificationBodyList; + }, + url, + postParams, + ); } Future getPRNotificationBody(int pNotificationID, int pTransactionID) async { String url = "${ApiConsts.erpRest}GET_PR_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_TRANSACTION_ID": pTransactionID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_TRANSACTION_ID": pTransactionID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getPrNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPrNotificationBodyList; + }, + url, + postParams, + ); } - Future getPaymentNotificationBody(int pNotificationID, int pTransactionID) async { + + Future getPaymentNotificationBody(int pNotificationID, int pTransactionID) async { String url = "${ApiConsts.erpRest}GET_PAY_REQ_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_TRANSACTION_ID": pTransactionID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_TRANSACTION_ID": pTransactionID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getPaymentNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPaymentNotificationBodyList; + }, + url, + postParams, + ); } - - Future> getMoItemHistory(int pItemID, int pOrgID) async { String url = "${ApiConsts.erpRest}GET_MO_ITEM_HISTORY"; - Map postParams = { - "P_ITEM_ID": pItemID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - "P_ORG_ID": pOrgID, - }; + Map postParams = {"P_ITEM_ID": pItemID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1, "P_ORG_ID": pOrgID}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getMoItemHistoryList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getMoItemHistoryList ?? []; + }, + url, + postParams, + ); } Future> getPoItemHistory(int pItemID) async { String url = "${ApiConsts.erpRest}GET_PO_ITEM_HISTORY"; - Map postParams = { - "P_ITEM_ID": pItemID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_ITEM_ID": pItemID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getPoItemHistoryList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPoItemHistoryList ?? []; + }, + url, + postParams, + ); } Future> getQuotationAnalysis(int pItemID, int pPoHeaderId) async { String url = "${ApiConsts.erpRest}GET_QUOTATION_ANALYSIS"; - Map postParams = { - "P_ITEM_ID": pItemID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - "P_PO_HEADER_ID": pPoHeaderId, - }; + Map postParams = {"P_ITEM_ID": pItemID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1, "P_PO_HEADER_ID": pPoHeaderId}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getQuotationAnalysisList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getQuotationAnalysisList ?? []; + }, + url, + postParams, + ); } Future getItemCreationNtfBody(int pNotificationID, int pTransactionID) async { String url = "${ApiConsts.erpRest}GET_ITEM_CREATION_NTF_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": pNotificationID, - "P_TRANSACTION_ID": pTransactionID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_TRANSACTION_ID": pTransactionID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getItemCreationNtfBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getItemCreationNtfBodyList; + }, + url, + postParams, + ); } Future getITGFormDetails(String requestType, taskId, itemId, String employeeNumber) async { String url = "${ApiConsts.cocRest}ITGGetFormDetials"; - Map postParams = { - "RequestType": requestType, - "TaskID": taskId, - "ItemIDStr": itemId, - "EmployeeNumber": employeeNumber, - }; + Map postParams = {"RequestType": requestType, "TaskID": taskId, "ItemIDStr": itemId, "EmployeeNumber": employeeNumber}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgRequest; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, + url, + postParams, + ); + } + + Future getITGTimeCardDetails(String requestType, String monthStr, String employeeNumber) async { + String url = "${ApiConsts.cocRest}ITG_TimeCard_Get"; + // String url = "https://webservices.hmg.com/Services/COCWS.svc/REST/ITG_TimeCard_Get"; + Map postParams = {"MonthStr": monthStr, "EmployeeNumber": employeeNumber}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.mohemmItgResponseItem; + }, + url, + postParams, + ); } Future?> getITGFormAttachments(String requestType, taskId, itemId, String employeeNumber) async { String url = "${ApiConsts.cocRest}ITGGetFormDetialsAttachment"; - Map postParams = { - "RequestType": requestType, - "TaskID": taskId, - "ItemIDStr": itemId, - "EmployeeNumber": employeeNumber, - }; + Map postParams = {"RequestType": requestType, "TaskID": taskId, "ItemIDStr": itemId, "EmployeeNumber": employeeNumber}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgFormAttachmentsList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgFormAttachmentsList; + }, + url, + postParams, + ); } Future rejectITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async { String url = "${ApiConsts.cocRest}ITGRejectRequest"; - Map postParams = { - "RequestType": requestType, - "TaskID": taskId, - "ItemIDStr": itemId, - "EmployeeNumber": employeeNumber, - "Comments": comments, - }; + Map postParams = {"RequestType": requestType, "TaskID": taskId, "ItemIDStr": itemId, "EmployeeNumber": employeeNumber, "Comments": comments}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgRequest; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, + url, + postParams, + ); } Future approveITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async { String url = "${ApiConsts.cocRest}ITGApproveRequest"; - Map postParams = { - "RequestType": requestType, - "TaskID": taskId, - "ItemIDStr": itemId, - "EmployeeNumber": employeeNumber, - "Comments": comments, - }; + Map postParams = {"RequestType": requestType, "TaskID": taskId, "ItemIDStr": itemId, "EmployeeNumber": employeeNumber, "Comments": comments}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgRequest; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, + url, + postParams, + ); } Future delegateITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGDelegateRequest"; - Map postParams = { - "RequestType": requestType, - "TaskID": taskId, - "ItemIDStr": itemId, - "EmployeeNumber": employeeNumber, - "NewUserEMPId": newUserEMPId, - "Comments": comments, - }; + Map postParams = {"RequestType": requestType, "TaskID": taskId, "ItemIDStr": itemId, "EmployeeNumber": employeeNumber, "NewUserEMPId": newUserEMPId, "Comments": comments}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgRequest; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, + url, + postParams, + ); } // ANSWER = 'Services/COCWS.svc/REST/ITGAnswer'; Future answerITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGAnswer"; - Map postParams = { - "RequestType": requestType, - "TaskID": taskId, - "ItemIDStr": itemId, - "EmployeeNumber": employeeNumber, - "Comments": comments, - }; + Map postParams = {"RequestType": requestType, "TaskID": taskId, "ItemIDStr": itemId, "EmployeeNumber": employeeNumber, "Comments": comments}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgRequest; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, + url, + postParams, + ); } Future requestActionITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments, String email) async { @@ -478,10 +514,14 @@ class WorkListApiClient { "IsQRCodeGenerate": true, }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgRequest; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, + url, + postParams, + ); } Future grantITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async { @@ -493,212 +533,228 @@ class WorkListApiClient { "EmployeeNumber": employeeNumber, "Comments": "", "AdditionalFields": null, - "NewUserEMPId": newUserEMPId + "NewUserEMPId": newUserEMPId, }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgRequest; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, + url, + postParams, + ); } Future informationITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGRequestInformation"; - Map postParams = { - "RequestType": requestType, - "TaskID": taskId, - "ItemIDStr": itemId, - "EmployeeNumber": employeeNumber, - "NewUserEMPId": newUserEMPId, - "Comments": comments, - }; + Map postParams = {"RequestType": requestType, "TaskID": taskId, "ItemIDStr": itemId, "EmployeeNumber": employeeNumber, "NewUserEMPId": newUserEMPId, "Comments": comments}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - ItgFormsModel responseData = ItgFormsModel.fromJson(json); - return responseData.itgRequest; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, + url, + postParams, + ); } //HR Detail Screen Requests Future?> GetEitNotificationBody(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_EIT_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getEITCollectionNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getEITCollectionNotificationBodyList; + }, + url, + postParams, + ); } Future?> GetCeiNotificationBody(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_CEI_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getCEICollectionNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getCEICollectionNotificationBodyList; + }, + url, + postParams, + ); } Future?> getPhonesNotificationBodyList(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_PHONES_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getPhonesNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPhonesNotificationBodyList; + }, + url, + postParams, + ); } Future?> getBasicDetNtfBodyList(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_BASIC_DET_NTF_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getBasicDetNtfBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getBasicDetNtfBodyList; + }, + url, + postParams, + ); } Future?> getAbsenceNotificationBody(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_ABSENCE_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getAbsenceCollectionNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getAbsenceCollectionNotificationBodyList; + }, + url, + postParams, + ); } Future getContactNotificationBodyList(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_CONTACT_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getContactNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getContactNotificationBodyList; + }, + url, + postParams, + ); } Future?> getAddressNotificationBodyList(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_ADDRESS_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getAddressNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getAddressNotificationBodyList; + }, + url, + postParams, + ); } Future?> getTerminationNotificationBodyList(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_TERM_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getTermNotificationBodyList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getTermNotificationBodyList; + }, + url, + postParams, + ); } Future?> getFavoriteReplacementWithoutImage() async { String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacementsWithoutImage"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.mohemmGetFavoriteReplacementsList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.mohemmGetFavoriteReplacementsList; + }, + url, + postParams, + ); } Future?> getFavoriteReplacementWithImage(String selectedFavLetter) async { String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacements"; Map postParams = {"ItgFilter": selectedFavLetter}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.mohemmGetFavoriteReplacementsList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.mohemmGetFavoriteReplacementsList; + }, + url, + postParams, + ); } Future?> getFavoriteReplacementWithImageNew(String selectedFavLetter) async { String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacements_Images"; Map postParams = {"ItgFilter": selectedFavLetter}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.mohemmGetFavoriteReplacementsList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.mohemmGetFavoriteReplacementsList; + }, + url, + postParams, + ); } Future changeFavoriteReplacements({required String email, required String employeName, required String image, required String userName, bool isFav = false}) async { String url = "${ApiConsts.erpRest}Mohemm_ChangeFavoriteReplacements"; - Map postParamsObj = { - "EMAIL_ADDRESS": email, - "EMPLOYEE_DISPLAY_NAME": employeName, - "EMPLOYEE_IMAGE": image, - "IsFavorite": isFav, - "USER_NAME": userName, - }; + Map postParamsObj = {"EMAIL_ADDRESS": email, "EMPLOYEE_DISPLAY_NAME": employeName, "EMPLOYEE_IMAGE": image, "IsFavorite": isFav, "USER_NAME": userName}; Map postParams = { "Mohemm_ChangeReplacementsInputList": [postParamsObj], }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future?> searchUserByInput({String userId = "", String userName = "", String email = ""}) async { String url = "${ApiConsts.erpRest}GET_REPLACEMENT_LIST"; - Map postParams = { - "P_SEARCH_USER_NAME": userId, - "P_SEARCH_EMPLOYEE_DISPLAY_NAME": userName, - "P_SEARCH_EMAIL_ADDRESS": email, - "P_PAGE_LIMIT": 50, - "P_PAGE_NUM": 1, - }; - postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.replacementList; - }, url, postParams); - } - - Future submitComment( - {String? comment, String? email, String? userId, int? notificationId, required String apiMode, int? approverIndex = null, List>? attributeData = const []}) async { + Map postParams = {"P_SEARCH_USER_NAME": userId, "P_SEARCH_EMPLOYEE_DISPLAY_NAME": userName, "P_SEARCH_EMAIL_ADDRESS": email, "P_PAGE_LIMIT": 50, "P_PAGE_NUM": 1}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.replacementList; + }, + url, + postParams, + ); + } + + Future submitComment({ + String? comment, + String? email, + String? userId, + int? notificationId, + required String apiMode, + int? approverIndex = null, + List>? attributeData = const [], + }) async { String url = "${ApiConsts.erpRest}NOTIFICATION_ACTIONS"; Map postParams = { "P_COMMENTS": comment, @@ -707,60 +763,72 @@ class WorkListApiClient { "P_FORWARD_TO_USER_NAME": userId, "P_NOTIFICATION_ID": notificationId, "P_APPROVER_INDEX": approverIndex, - "RespondAttributeList": attributeData + "RespondAttributeList": attributeData, }; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData; + }, + url, + postParams, + ); } Future> getUserItemTypes() async { String url = "${ApiConsts.erpRest}GET_USER_ITEM_TYPES"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getUserItemTypesList ?? []; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getUserItemTypesList ?? []; + }, + url, + postParams, + ); } Future updateUserItemTypes(List> itemList) async { String url = "${ApiConsts.erpRest}UPDATE_USER_ITEM_TYPES"; Map postParams = {"UpdateItemTypeList": itemList}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.updateUserItemTypesList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.updateUserItemTypesList; + }, + url, + postParams, + ); } Future getPRDetailsForPO(String poLineID) async { String url = "${ApiConsts.erpRest}GET_PR_INFORMATION"; - Map postParams = { - "P_PO_LINE_ID": poLineID, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; + Map postParams = {"P_PO_LINE_ID": poLineID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getPRInformationList; - }, url, postParams); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPRInformationList; + }, + url, + postParams, + ); } Future?> getPaymentDetailsNotification(int? notificationId) async { String url = "${ApiConsts.erpRest}GET_PAY_REQ_NOTIFICATION_BODY"; - Map postParams = { - "P_NOTIFICATION_ID": notificationId, - "P_PAGE_LIMIT": 100, - "P_PAGE_NUM": 1, - }; - postParams.addAll(AppState().postParamsJson); - return await ApiClient().postJsonForObject((json) { - GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.getAbsenceCollectionNotificationBodyList; - }, url, postParams); + Map postParams = {"P_NOTIFICATION_ID": notificationId, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject( + (json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getAbsenceCollectionNotificationBodyList; + }, + url, + postParams, + ); } } diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index c2772b8..0214199 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -6,15 +6,15 @@ class ApiConsts { // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.201.204.101:2024"; - // static String baseUrl = "https://webservices.hmg.com"; // PreProd + static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server // static String baseUrl = "https://mohemm.hmg.com"; // New Live server // - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.20.200.111:1010/"; - // static String baseUrl = "https://webservices.hmg.com"; // PreProd + // static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://mohemm.hmg.com"; // static String baseUrl = "https://hmgwebservices.com"; // Live server @@ -66,6 +66,8 @@ class ApiConsts { static String marathonGetMarathonersCount = marathonBaseUrl + "Participant/GetRemainingParticipants"; static String marathonGetTutorial = marathonBaseUrl + "tutorial/GetTutorialNotification"; + + //DummyCards for the UI static int tabletMinLength = 500; diff --git a/lib/main.dart b/lib/main.dart index 3eabd68..39f19e5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,18 +19,11 @@ import 'package:provider/provider.dart'; import 'package:provider/single_child_widget.dart'; import 'package:sizer/sizer.dart'; - // test uat account // username 199067 // pass h123456 -Logger logger = Logger( - // filter: null, // Use the default LogFilter (-> only log in debug mode) - printer: PrettyPrinter( - lineLength: 0, - ), // Use the PrettyPrinter to format and print log - // output: null, // U -); +Logger logger = Logger(printer: PrettyPrinter(lineLength: 0)); class MyHttpOverrides extends HttpOverrides { @override @@ -43,10 +36,7 @@ bool isTablet = false; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - SystemChrome.setPreferredOrientations([ - DeviceOrientation.portraitUp, - DeviceOrientation.portraitDown, - ]); + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); await EasyLocalization.ensureInitialized(); AppState().setPostParamsInitConfig(); HttpOverrides.global = MyHttpOverrides(); @@ -54,26 +44,15 @@ Future main() async { runApp( EasyLocalization( - supportedLocales: const [ - Locale('en', 'US'), - Locale('ar', 'SA'), - ], + supportedLocales: const [Locale('en', 'US'), Locale('ar', 'SA')], path: 'assets/langs', assetLoader: const CodegenLoader(), child: MultiProvider( providers: [ - ChangeNotifierProvider( - create: (_) => DashboardProviderModel(), - ), - ChangeNotifierProvider( - create: (_) => EITProviderModel(), - ), - ChangeNotifierProvider( - create: (_) => ChatProviderModel(), - ), - ChangeNotifierProvider( - create: (_) => MarathonProvider(), - ), + ChangeNotifierProvider(create: (_) => DashboardProviderModel()), + ChangeNotifierProvider(create: (_) => EITProviderModel()), + ChangeNotifierProvider(create: (_) => ChatProviderModel()), + ChangeNotifierProvider(create: (_) => MarathonProvider()), // ChangeNotifierProvider( // create: (_) => ChatCallProvider(), // ), @@ -96,30 +75,19 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return Sizer( - builder: ( - BuildContext context, - Orientation orientation, - DeviceType deviceType, - ) { + builder: (BuildContext context, Orientation orientation, DeviceType deviceType) { PostParamsModel? obj = AppState().postParamsObject; obj?.languageID = EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2; AppState().setPostParamsModel(obj!); List> delegates = context.localizationDelegates; // delegates.add(GlobalMaterialLocalizations.delegate); - delegates.add( - MonthYearPickerLocalizations.delegate, - ); + delegates.add(MonthYearPickerLocalizations.delegate); return MaterialApp( navigatorKey: AppRoutes.navigatorKey, builder: (BuildContext context, Widget? child) { - return MediaQuery( - data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), - child: child!, - ); + return MediaQuery(data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), child: child!); }, - theme: AppTheme.getTheme( - EasyLocalization.of(context)?.locale.languageCode == "ar", - ), + theme: AppTheme.getTheme(EasyLocalization.of(context)?.locale.languageCode == "ar"), debugShowCheckedModeBanner: false, localizationsDelegates: delegates, supportedLocales: context.supportedLocales, diff --git a/lib/models/itg/itg_summary_data.dart b/lib/models/itg/itg_summary_data.dart new file mode 100644 index 0000000..7371857 --- /dev/null +++ b/lib/models/itg/itg_summary_data.dart @@ -0,0 +1,101 @@ +import 'dart:convert'; + +class ItgTimeCardSummaryData { + String? returNStatus; + String? returNMsg; + List? summeries; + List>? details; + + ItgTimeCardSummaryData({this.returNStatus, this.returNMsg, this.summeries, this.details}); + + factory ItgTimeCardSummaryData.fromRawJson(String str) => ItgTimeCardSummaryData.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory ItgTimeCardSummaryData.fromJson(Map json) => ItgTimeCardSummaryData( + returNStatus: json["returN_STATUS"], + returNMsg: json["returN_MSG"], + summeries: json["summeries"] == null ? [] : List.from(json["summeries"]!.map((x) => Summery.fromJson(x))), + details: json["details"] == null ? [] : List>.from(json["details"]!.map((x) => Map.from(x).map((k, v) => MapEntry(k, v)))), + ); + + Map toJson() => { + "returN_STATUS": returNStatus, + "returN_MSG": returNMsg, + "summeries": summeries == null ? [] : List.from(summeries!.map((x) => x.toJson())), + "details": details == null ? [] : List.from(details!.map((x) => Map.from(x).map((k, v) => MapEntry(k, v)))), + }; +} + +class Summery { + int? missinGSwipesDays; + String? scheduleDHrs; + String? actuaLHrs; + String? excesSHrs; + String? timebacKHrs; + String? shortagEHrs; + String? latEInHrs; + String? earlYOutHrs; + double? uncovereDShortageHrs; + int? sicKLeaves; + int? publiCHolidays; + int? unauthorizeDLeaves; + int? unpaiDLeaves; + int? paiDLeaves; + + Summery({ + + this.missinGSwipesDays, + this.scheduleDHrs, + this.actuaLHrs, + this.excesSHrs, + this.timebacKHrs, + this.shortagEHrs, + this.latEInHrs, + this.earlYOutHrs, + this.uncovereDShortageHrs, + this.sicKLeaves, + this.publiCHolidays, + this.unauthorizeDLeaves, + this.unpaiDLeaves, + this.paiDLeaves, + }); + + factory Summery.fromRawJson(String str) => Summery.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory Summery.fromJson(Map json) => Summery( + missinGSwipesDays: json["missinG_SWIPES_DAYS"], + scheduleDHrs: json["scheduleD_HRS"], + actuaLHrs: json["actuaL_HRS"], + excesSHrs: json["excesS_HRS"], + timebacKHrs: json["timebacK_HRS"], + shortagEHrs: json["shortagE_HRS"], + latEInHrs: json["latE_IN_HRS"], + earlYOutHrs: json["earlY_OUT_HRS"], + uncovereDShortageHrs: json["uncovereD_SHORTAGE_HRS"]?.toDouble(), + sicKLeaves: json["sicK_LEAVES"], + publiCHolidays: json["publiC_HOLIDAYS"], + unauthorizeDLeaves: json["unauthorizeD_LEAVES"], + unpaiDLeaves: json["unpaiD_LEAVES"], + paiDLeaves: json["paiD_LEAVES"], + ); + + Map toJson() => { + "missinG_SWIPES_DAYS": missinGSwipesDays, + "scheduleD_HRS": scheduleDHrs, + "actuaL_HRS": actuaLHrs, + "excesS_HRS": excesSHrs, + "timebacK_HRS": timebacKHrs, + "shortagE_HRS": shortagEHrs, + "latE_IN_HRS": latEInHrs, + "earlY_OUT_HRS": earlYOutHrs, + "uncovereD_SHORTAGE_HRS": uncovereDShortageHrs, + "sicK_LEAVES": sicKLeaves, + "publiC_HOLIDAYS": publiCHolidays, + "unauthorizeD_LEAVES": unauthorizeDLeaves, + "unpaiD_LEAVES": unpaiDLeaves, + "paiD_LEAVES": paiDLeaves, + }; +} diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 9b57133..36a9f81 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -166,12 +166,13 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { Utils.hideLoading(context); showDialog( context: context, - builder: (cxt) => ConfirmDialog( - message: err, - onTap: () { - Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route route) => false); - }, - ), + builder: + (cxt) => ConfirmDialog( + message: err, + onTap: () { + Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route route) => false); + }, + ), ); }); } @@ -315,6 +316,8 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { return res; } + + void notify() { notifyListeners(); } diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index 9970206..faa25ac 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -68,17 +68,19 @@ class _VerifyLastLoginScreenState extends State { appBar: AppBar( backgroundColor: Colors.transparent, automaticallyImplyLeading: false, - title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) - ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { - showMDialog(context, child: const BusinessCardDialog()); - }) - : Container(), + title: + (mobileLoginInfoListModel?.businessCardPrivilege ?? false) + ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { + showMDialog(context, child: const BusinessCardDialog()); + }) + : Container(), actions: [ Center( - child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { - showMDialog(context, child: EmployeeDigitialIdDialog()); - })), - 21.width + child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { + showMDialog(context, child: EmployeeDigitialIdDialog()); + }), + ), + 21.width, ], ), body: Column( @@ -102,24 +104,14 @@ class _VerifyLastLoginScreenState extends State { margin: const EdgeInsets.only(top: 23, bottom: 23), alignment: Alignment.center, padding: const EdgeInsets.only(left: 17, right: 12), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - border: Border.all( - color: const Color(0xffefefef), - width: 1, - ), - ), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, border: Border.all(color: const Color(0xffefefef), width: 1)), child: Column( mainAxisSize: MainAxisSize.min, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, - children: [ - LocaleKeys.lastLoginDetails.tr().toText16(), - DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12(), - ], + children: [LocaleKeys.lastLoginDetails.tr().toText16(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12()], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -130,7 +122,7 @@ class _VerifyLastLoginScreenState extends State { const Expanded(child: SizedBox()), DateUtil.formatDateToTime(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!)).toText12(), ], - ) + ), ], ), ), @@ -141,15 +133,10 @@ class _VerifyLastLoginScreenState extends State { physics: const NeverScrollableScrollPhysics(), padding: const EdgeInsets.only(top: 9), shrinkWrap: true, - children: [ - if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3), - if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4), - getButton(2), - getButton(1), - ], - ) + children: [if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4), getButton(2), getButton(1)], + ), ], - ) + ), // else // Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ // Image.asset( @@ -187,12 +174,9 @@ class _VerifyLastLoginScreenState extends State { // ]), ], ).expanded, - DefaultButton( - LocaleKeys.useAnotherAccount.tr(), - () { - Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route route) => false, arguments: false); - }, - ).insideContainer, + DefaultButton(LocaleKeys.useAnotherAccount.tr(), () { + Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route route) => false, arguments: false); + }).insideContainer, ], ), ); @@ -222,14 +206,19 @@ class _VerifyLastLoginScreenState extends State { } Future loginWithFaceIDAndBiometrics() async { - IOSAuthMessages iosStrings = - const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'); + IOSAuthMessages iosStrings = const IOSAuthMessages( + cancelButton: 'cancel', + goToSettingsButton: 'settings', + goToSettingsDescription: 'Please set up your Touch ID.', + lockOut: 'Please reenable your Touch ID', + ); bool authenticated = false; try { - authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', - options: const AuthenticationOptions( - useErrorDialogs: true, stickyAuth: true, biometricOnly: true, - ),authMessages: [iosStrings,const AndroidAuthMessages(),]); + authenticated = await auth.authenticate( + localizedReason: 'Scan your fingerprint to authenticate', + options: const AuthenticationOptions(useErrorDialogs: true, stickyAuth: true, biometricOnly: true), + authMessages: [iosStrings, const AndroidAuthMessages()], + ); } on PlatformException catch (e) { print(e); Utils.hideLoading(context); @@ -239,46 +228,48 @@ class _VerifyLastLoginScreenState extends State { } Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { - bool isDisable = (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) || - _flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.strong)); + bool isDisable = + (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) || + _flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.strong)); return InkWell( - onTap: isDisable - ? null - : () async { - if (_flag == 0) { - setState(() { - // isMoreOption = true; - }); - } else { - if (_flag == 3 || _flag == 4) { - bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); - if (!authenticateWithFaceAndTouchID) { - return; - } else { - if (mobileLoginInfoListModel!.loginType == 3 || mobileLoginInfoListModel!.loginType == 4) { - // bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); - // if (!authenticateWithFaceAndTouchID) { - // return; - // } else { - // performApiCall(_title, _icon, _flag, isDirectLogin: true); - // } - performApiCall(_title, _icon, _flag, _flag, isDirectLogin: true); + onTap: + isDisable + ? null + : () async { + if (_flag == 0) { + setState(() { + // isMoreOption = true; + }); + } else { + if (_flag == 3 || _flag == 4) { + bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); + if (!authenticateWithFaceAndTouchID) { + return; } else { - isNeedVerifyWithFaceIDAndBiometrics = true; - selectedFlag = _flag; - setState(() { - return; - }); + if (mobileLoginInfoListModel!.loginType == 3 || mobileLoginInfoListModel!.loginType == 4) { + // bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); + // if (!authenticateWithFaceAndTouchID) { + // return; + // } else { + // performApiCall(_title, _icon, _flag, isDirectLogin: true); + // } + performApiCall(_title, _icon, _flag, _flag, isDirectLogin: true); + } else { + isNeedVerifyWithFaceIDAndBiometrics = true; + selectedFlag = _flag; + setState(() { + return; + }); + } } + } else { + if (isNeedVerifyWithFaceIDAndBiometrics) + performApiCall(_title, _icon, selectedFlag, _flag); + else + performApiCall(_title, _icon, _flag, _flag); } - } else { - if (isNeedVerifyWithFaceIDAndBiometrics) - performApiCall(_title, _icon, selectedFlag, _flag); - else - performApiCall(_title, _icon, _flag, _flag); } - } - }, + }, child: Container( padding: const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), decoration: BoxDecoration( @@ -289,15 +280,7 @@ class _VerifyLastLoginScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - SvgPicture.asset( - _icon, - height: 38, - width: 38, - color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null, - ), - _title.toText16(height: 20 / 16) - ], + children: [SvgPicture.asset(_icon, height: 38, width: 38, color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null), _title.toText16(height: 20 / 16)], ), ), ); @@ -341,8 +324,12 @@ class _VerifyLastLoginScreenState extends State { await LoginApiClient().checkMobileAppVersion(); await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!); if (!isDirectLogin) { - BasicMemberInformationModel? memberInformationModel = - await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName); + BasicMemberInformationModel? memberInformationModel = await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType( + 0, + AppState().memberLoginList?.pMOBILENUMBER, + sendVerificationFlat, + AppState().getUserName, + ); } if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "", null); if (!isDirectLogin) Utils.hideLoading(context); @@ -355,9 +342,7 @@ class _VerifyLastLoginScreenState extends State { Utils.showLoading(context); performDirectApiCall(_title, _icon, _flag, value, _pinPutController); }, - () => { - Navigator.pop(context), - }, + () => {Navigator.pop(context)}, onResendCode: () { performApiCall(_title, _icon, _flag, sendVerificationFlat, isDirectLogin: isDirectLogin); }, @@ -373,14 +358,15 @@ class _VerifyLastLoginScreenState extends State { try { GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(true, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName); GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW( - AppState().memberLoginList?.pEMAILADDRESS ?? "", - genericResponseModel?.pSESSIONID ?? 0, - genericResponseModel?.memberInformationList![0].eMPLOYEENAME ?? "", - _flag, - AppState().memberLoginList?.pMOBILENUMBER ?? "", - AppState().getUserName!, - AppState().getIsHuawei ? AppState().getHuaweiPushToken : mobileLoginInfoListModel!.deviceToken!, - Platform.isAndroid ? "android" : "ios"); + AppState().memberLoginList?.pEMAILADDRESS ?? "", + genericResponseModel?.pSESSIONID ?? 0, + genericResponseModel?.memberInformationList![0].eMPLOYEENAME ?? "", + _flag, + AppState().memberLoginList?.pMOBILENUMBER ?? "", + AppState().getUserName!, + AppState().getIsHuawei ? AppState().getHuaweiPushToken : mobileLoginInfoListModel!.deviceToken!, + Platform.isAndroid ? "android" : "ios", + ); AppState().setMemberInformationListModel = genericResponseModel!.memberInformationList?.first; AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? []; if (genericResponseModel.errorMessage != null) { @@ -407,15 +393,15 @@ class _VerifyLastLoginScreenState extends State { } } -// -// formatDate(date) { -// return date; -// return DateFormat('MMM dd, yyy, kk:mm').format(date); -// } -// -// showLoader(bool isTrue) { -// setState(() { -// // isLoading = isTrue; -// }); -// } + // + // formatDate(date) { + // return date; + // return DateFormat('MMM dd, yyy, kk:mm').format(date); + // } + // + // showLoader(bool isTrue) { + // setState(() { + // // isLoading = isTrue; + // }); + // } } diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index aaef95f..dec413f 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -12,6 +12,8 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; +import 'package:mohem_flutter_app/models/itg/itg_summary_data.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/allowed_actions_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/itg_forms_attachments_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart'; @@ -51,6 +53,7 @@ class _ItgDetailScreenState extends State { List itgFormAttachmentsList = []; late DashboardProviderModel providerData; + ItgTimeCardSummaryData? timeCardSummaryData; bool isAttachmentLoaded = false; @@ -73,12 +76,28 @@ class _ItgDetailScreenState extends State { Utils.showLoading(context); itgRequest = await WorkListApiClient().getITGFormDetails(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); allowedActionList = itgRequest?.allowedActions ?? []; + if (allowedActionList.isNotEmpty) { isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE"); isApproveAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Approve"); isRejectAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Reject"); isGenerateAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Generate"); } + + String rawDate = itgRequest!.fieldGoups![1].fields![1].value!; + String month = rawDate.split('/').first; + String year = rawDate.split('/').last; + String formattedString = "${getMonthName(month)}-$year"; + if (requestDetails!.requestType == "Timesheet Request") { + dynamic data = await WorkListApiClient().getITGTimeCardDetails("Timesheet Request", formattedString, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + if (data != null) { + var decodedDta = jsonDecode(data); + // var decodedDta = jsonDecode( + // "{\"returN_STATUS\":\"S\",\"returN_MSG\":\"null\",\"summeries\":[{\"employeE_NUMBER\":\"410123\",\"assignmenT_NUMBER\":\"410123\",\"employeE_NAME\":\"Samiullah Abdulqadir\",\"hirE_DATE\":\"2024-07-21T00:00:00\",\"actuaL_TERMINATION_DATE\":null,\"perioD_DAYS\":31,\"schedulE_DAYS\":20,\"ofF_DAYS\":9,\"noN_SCHEDULED_DAYS\":0,\"noT_ANALAYZED_DAYS\":0,\"attendeD_DAYS\":20,\"absenT_DAYS\":0,\"missinG_SWIPES_DAYS\":0,\"scheduleD_HRS\":\"120\",\"actuaL_HRS\":\"121.96\",\"excesS_HRS\":\"2.61\",\"comP_OFF_W_HRS\":\"0\",\"comP_OFF_H_HRS\":\"0\",\"comP_OFF_N_HRS\":\"0\",\"timebacK_HRS\":\"2.61\",\"shortagE_HRS\":\".65\",\"latE_IN_HRS\":\".1\",\"earlY_OUT_HRS\":\".65\",\"uncovereD_SHORTAGE_HRS\":0.65,\"halF_DAY_LEAVES\":0,\"sicK_LEAVES\":0,\"publiC_HOLIDAYS\":2,\"worK_FROM_HOME_DAYS\":0,\"businesS_TRIPS\":0,\"unauthorizeD_LEAVES\":0,\"unpaiD_LEAVES\":0,\"paiD_LEAVES\":0}],\"details\":[{\"schedulE_DATE\":\"2025-03-01T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-02T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"09:58\",\"shT_ACTUAL_END_DATETIME\":\"16:01\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:03\",\"excesS_HRS\":\"00:03\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-03T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:11\",\"shT_ACTUAL_END_DATETIME\":\"16:11\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-04T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:08\",\"shT_ACTUAL_END_DATETIME\":\"16:12\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:04\",\"excesS_HRS\":\"00:04\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-05T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:09\",\"shT_ACTUAL_END_DATETIME\":\"16:12\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:03\",\"excesS_HRS\":\"00:03\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-06T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"09:53\",\"shT_ACTUAL_END_DATETIME\":\"15:54\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:01\",\"excesS_HRS\":\"00:01\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-07T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-08T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-09T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:06\",\"shT_ACTUAL_END_DATETIME\":\"16:08\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:02\",\"excesS_HRS\":\"00:02\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-10T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"11:06\",\"shT_ACTUAL_END_DATETIME\":\"17:06\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:06\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"Y\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-11T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:09\",\"shT_ACTUAL_END_DATETIME\":\"16:12\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:03\",\"excesS_HRS\":\"00:03\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-12T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:37\",\"shT_ACTUAL_END_DATETIME\":\"16:38\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:01\",\"excesS_HRS\":\"00:01\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-13T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"09:53\",\"shT_ACTUAL_END_DATETIME\":\"16:08\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:15\",\"excesS_HRS\":\"00:15\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-14T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-15T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-16T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:52\",\"shT_ACTUAL_END_DATETIME\":\"16:54\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:02\",\"excesS_HRS\":\"00:02\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-17T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:49\",\"shT_ACTUAL_END_DATETIME\":\"17:00\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:11\",\"excesS_HRS\":\"00:11\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-18T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:40\",\"shT_ACTUAL_END_DATETIME\":\"16:59\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:19\",\"excesS_HRS\":\"00:19\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-19T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:46\",\"shT_ACTUAL_END_DATETIME\":\"17:03\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:17\",\"excesS_HRS\":\"00:17\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-20T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:52\",\"shT_ACTUAL_END_DATETIME\":\"16:55\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:03\",\"excesS_HRS\":\"00:03\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-21T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-22T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-23T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:54\",\"shT_ACTUAL_END_DATETIME\":\"17:13\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:19\",\"excesS_HRS\":\"00:19\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-24T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:40\",\"shT_ACTUAL_END_DATETIME\":\"16:51\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:11\",\"excesS_HRS\":\"00:11\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-25T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:49\",\"shT_ACTUAL_END_DATETIME\":\"17:04\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:15\",\"excesS_HRS\":\"00:15\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-26T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:55\",\"shT_ACTUAL_END_DATETIME\":\"17:23\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:28\",\"excesS_HRS\":\"00:28\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-27T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:56\",\"shT_ACTUAL_END_DATETIME\":\"16:17\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"05:21\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:39\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:39\",\"remarks\":null,\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"Y\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"Y\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-28T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-29T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-30T00:00:00\",\"shifT_NAME\":\"08:00 - 17:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"13:00 - 14:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\" From: 30-03-2025 To : 02-04-2025\\n\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-31T00:00:00\",\"shifT_NAME\":\"08:00 - 17:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"13:00 - 14:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\" From: 30-03-2025 To : 02-04-2025\\n\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"}]}", + // ); + timeCardSummaryData = ItgTimeCardSummaryData.fromJson(decodedDta); + } + } Utils.hideLoading(context); setState(() { controller.jumpToPage(0); @@ -90,7 +109,13 @@ class _ItgDetailScreenState extends State { } } - void getDataFromState() { + String getMonthName(String monthNumber) { + const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + int index = int.tryParse(monthNumber) ?? 0; + return (index >= 1 && index <= 12) ? monthNames[index - 1] : "Invalid Month"; + } + + void getDataFromState() async { if (requestDetails == null) { animationIndex = animationIndex + 1; requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; @@ -104,7 +129,6 @@ class _ItgDetailScreenState extends State { @override Widget build(BuildContext context) { getDataFromState(); - return Scaffold( appBar: AppBarWidget(context, title: LocaleKeys.details.tr()), backgroundColor: Colors.white, @@ -112,10 +136,7 @@ class _ItgDetailScreenState extends State { duration: const Duration(milliseconds: 500), switchInCurve: Curves.easeInToLinear, transitionBuilder: (Widget child, Animation animation) { - Animation custom = Tween( - begin: const Offset(1.0, 0.0), - end: Offset.zero, - ).animate(animation); + Animation custom = Tween(begin: const Offset(1.0, 0.0), end: Offset.zero).animate(animation); return ClipRect( child: SlideTransition( position: custom, @@ -132,27 +153,11 @@ class _ItgDetailScreenState extends State { Container( padding: const EdgeInsets.only(left: 21, right: 21, top: 16, bottom: 16), decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(25), - bottomRight: Radius.circular(25), - ), - gradient: LinearGradient( - transform: GradientRotation(.83), - begin: Alignment.topRight, - end: Alignment.bottomLeft, - colors: [ - MyColors.gradiantEndColor, - MyColors.gradiantStartColor, - ], - ), + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(25), bottomRight: Radius.circular(25)), + gradient: LinearGradient(transform: GradientRotation(.83), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor]), ), child: Row( - children: [ - myTab(LocaleKeys.requestDetails.tr(), 0), - myTab(LocaleKeys.approvalLevel.tr(), 1), - myTab(LocaleKeys.requesterDetails.tr(), 2), - myTab(LocaleKeys.attachments.tr(), 3), - ], + children: [myTab(LocaleKeys.requestDetails.tr(), 0), myTab(LocaleKeys.approvalLevel.tr(), 1), myTab(LocaleKeys.requesterDetails.tr(), 2), myTab(LocaleKeys.attachments.tr(), 3)], ), ), PageView( @@ -167,11 +172,9 @@ class _ItgDetailScreenState extends State { fields: itgRequest?.fieldGoups?[1].fields ?? [], fieldGoups: itgRequest?.fieldGoups ?? [], taskID: itgRequest?.fieldGoups?[0].fields?[0].value ?? "", + summaryData: timeCardSummaryData, ), - ApprovalLevelfragment( - wFHistory: itgRequest?.wFHistory ?? [], - voidCallback: reloadITG, - ), + ApprovalLevelfragment(wFHistory: itgRequest?.wFHistory ?? [], voidCallback: reloadITG), RequestDetailFragment(fields: itgRequest?.fieldGoups?[0].fields ?? []), isAttachmentLoaded ? itgFormAttachmentsList.isEmpty @@ -183,72 +186,29 @@ class _ItgDetailScreenState extends State { if (isApproveAvailable || isRejectAvailable || isCloseAvailable) Container( padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21), - decoration: const BoxDecoration( - color: Colors.white, - border: Border( - top: BorderSide( - color: MyColors.lightGreyEFColor, - width: 1.0, - ), - ), - ), + decoration: const BoxDecoration(color: Colors.white, border: Border(top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0))), child: Row( children: [ - if (isRejectAvailable) - DefaultButton( - LocaleKeys.reject.tr(), - () => performAction("REJECTED"), - colors: const [ - Color(0xffE47A7E), - Color(0xffDE6D71), - ], - ).expanded, + if (isRejectAvailable) DefaultButton(LocaleKeys.reject.tr(), () => performAction("REJECTED"), colors: const [Color(0xffE47A7E), Color(0xffDE6D71)]).expanded, if (isApproveAvailable && isRejectAvailable) 8.width, - if (isApproveAvailable) - DefaultButton( - LocaleKeys.approve.tr(), - () => performAction("APPROVED"), - colors: const [ - Color(0xff28C884), - Color(0xff1BB271), - ], - ).expanded, + if (isApproveAvailable) DefaultButton(LocaleKeys.approve.tr(), () => performAction("APPROVED"), colors: const [Color(0xff28C884), Color(0xff1BB271)]).expanded, if ((isApproveAvailable || isRejectAvailable) && isGenerateAvailable) 8.width, - if (isGenerateAvailable) - DefaultButton( - LocaleKeys.generate.tr(), - () => performAction("Generate"), - colors: const [ - Color(0xff28C884), - Color(0xff1BB271), - ], - ).expanded, - if (isCloseAvailable) - DefaultButton( - LocaleKeys.ok.tr(), - () => performAction("CLOSE"), - colors: const [ - Color(0xff32D892), - Color(0xff1AB170), - ], - ).expanded, + if (isGenerateAvailable) DefaultButton(LocaleKeys.generate.tr(), () => performAction("Generate"), colors: const [Color(0xff28C884), Color(0xff1BB271)]).expanded, + if (isCloseAvailable) DefaultButton(LocaleKeys.ok.tr(), () => performAction("CLOSE"), colors: const [Color(0xff32D892), Color(0xff1AB170)]).expanded, 8.width, Container( height: 43, width: 43, - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: MyColors.lightGreyE6Color, - ), + decoration: const BoxDecoration(shape: BoxShape.circle, color: MyColors.lightGreyE6Color), child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), ).onPress(() { setState(() { showFabOptions = true; }); - }) + }), ], ), - ) + ), ], ), IgnorePointer( @@ -293,21 +253,19 @@ class _ItgDetailScreenState extends State { ], ), ), - floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable && !isGenerateAvailable) - ? Container( - height: 43, - width: 43, - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: MyColors.lightGreyE6Color, - ), - child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), - ).onPress(() { - setState(() { - showFabOptions = true; - }); - }) - : null, + floatingActionButton: + (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable && !isGenerateAvailable) + ? Container( + height: 43, + width: 43, + decoration: const BoxDecoration(shape: BoxShape.circle, color: MyColors.lightGreyE6Color), + child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), + ).onPress(() { + setState(() { + showFabOptions = true; + }); + }) + : null, ); } @@ -385,29 +343,33 @@ class _ItgDetailScreenState extends State { void handleFabAction(AllowedActions action) { switch (action.action) { case "Delegate": - showMyBottomSheet(context, + showMyBottomSheet( + context, + callBackFunc: reloadITG, + child: DelegateSheet( + title: LocaleKeys.delegate.tr(), + apiMode: action.action!, + notificationID: null, + actionHistoryList: null, + wFHistory: itgRequest?.wFHistory ?? [], callBackFunc: reloadITG, - child: DelegateSheet( - title: LocaleKeys.delegate.tr(), - apiMode: action.action!, - notificationID: null, - actionHistoryList: null, - wFHistory: itgRequest?.wFHistory ?? [], - callBackFunc: reloadITG, - )); + ), + ); break; case "RequestInformation": - showMyBottomSheet(context, + showMyBottomSheet( + context, + callBackFunc: reloadITG, + child: DelegateSheet( + title: LocaleKeys.request_info.tr(), + apiMode: action.action!, + notificationID: null, + actionHistoryList: null, + wFHistory: itgRequest?.wFHistory ?? [], callBackFunc: reloadITG, - child: DelegateSheet( - title: LocaleKeys.request_info.tr(), - apiMode: action.action!, - notificationID: null, - actionHistoryList: null, - wFHistory: itgRequest?.wFHistory ?? [], - callBackFunc: reloadITG, - )); + ), + ); break; case "Doable": performAction("APPROVED"); @@ -438,18 +400,11 @@ class _ItgDetailScreenState extends State { children: [ title.toText11(color: isSelected ? Colors.white : Colors.white.withOpacity(.74), isCenter: true), 4.height, - Container( - height: 8, - width: 8, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: isSelected ? Colors.white : Colors.transparent, - ), - ).onPress(() { + Container(height: 8, width: 8, decoration: BoxDecoration(shape: BoxShape.circle, color: isSelected ? Colors.white : Colors.transparent)).onPress(() { setState(() { showFabOptions = true; }); - }) + }), ], ).onPress(() { controller.jumpToPage(index); @@ -469,23 +424,10 @@ class _ItgDetailScreenState extends State { padding: const EdgeInsets.all(12), decoration: const BoxDecoration( shape: BoxShape.circle, - gradient: LinearGradient( - transform: GradientRotation(.46), - begin: Alignment.topRight, - end: Alignment.bottomLeft, - colors: [ - MyColors.gradiantEndColor, - MyColors.gradiantStartColor, - ], - ), + gradient: LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor]), ), - child: isIconAsset - ? SvgPicture.asset(icon) - : Image.memory( - base64Decode(icon), - fit: BoxFit.cover, - ), - ) + child: isIconAsset ? SvgPicture.asset(icon) : Image.memory(base64Decode(icon), fit: BoxFit.cover), + ), ], ); } @@ -493,29 +435,37 @@ class _ItgDetailScreenState extends State { void performAction(String actionMode) { showDialog( context: context, - builder: (cxt) => ITGCommentsDialog( - message: LocaleKeys.writeComment.tr(), - actionMode: actionMode, - onTap: (note) { - if (actionMode == "APPROVED") { - performApproveAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); - } else if (actionMode == "Answer") { - performAnswerAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); - } else if (actionMode == "Generate") { - performGenerateQrAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); - } else { - performRejectAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); - } - }, - ), + builder: + (cxt) => ITGCommentsDialog( + message: LocaleKeys.writeComment.tr(), + actionMode: actionMode, + onTap: (note) { + if (actionMode == "APPROVED") { + performApproveAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + } else if (actionMode == "Answer") { + performAnswerAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + } else if (actionMode == "Generate") { + performGenerateQrAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + } else { + performRejectAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + } + }, + ), ); } void performGenerateQrAction(String requestType, taskId, itemId, String employeeNumber, String comments) async { try { Utils.showLoading(context); - ITGRequest? itgRequest = - await WorkListApiClient().requestActionITGRequest(requestType, taskId, itemId, employeeNumber, "", comments, AppState().memberInformationList?.eMPLOYEEEMAILADDRESS ?? ""); + ITGRequest? itgRequest = await WorkListApiClient().requestActionITGRequest( + requestType, + taskId, + itemId, + employeeNumber, + "", + comments, + AppState().memberInformationList?.eMPLOYEEEMAILADDRESS ?? "", + ); Utils.hideLoading(context); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); // Navigator.pop(context, "delegate_reload"); @@ -635,11 +585,7 @@ class _ItgDetailScreenState extends State { } Widget showLoadingAnimation() { - return Lottie.asset( - 'assets/lottie/loading.json', - repeat: true, - reverse: false, - ); + return Lottie.asset('assets/lottie/loading.json', repeat: true, reverse: false); } void getItgRequestAttachments() async { diff --git a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart index ba67ba4..f16d69c 100644 --- a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart +++ b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart @@ -1,150 +1 @@ -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/extensions/int_extensions.dart'; -import 'package:mohem_flutter_app/extensions/string_extensions.dart'; -import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; -import 'package:mohem_flutter_app/models/itg_forms_models/field_goups_model.dart'; -import 'package:mohem_flutter_app/models/itg_forms_models/fields_model.dart'; -import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; - -class RequestDetailFragment extends StatelessWidget { - List fields; - List? fieldGoups; - String taskID; - - RequestDetailFragment({Key? key, this.fields = const [], this.fieldGoups = const [], this.taskID = ""}) : super(key: key); - double itemHeight = 0; - double itemWidth = 0; - - @override - Widget build(BuildContext context) { - var size = MediaQuery.of(context).size; - itemHeight = (size.height - kToolbarHeight - 24) / 9; - itemWidth = size.width / 2; - List uiList = [detailView(fields)]; - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(21), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - width: double.infinity, - // height: double.infinity, - child: fields.isEmpty - ? LocaleKeys.noDataAvailable.tr().toText16().center - : ListView( - shrinkWrap: true, - children: uiList, - ), - ), - 12.height, - if (taskID.toLowerCase().contains("vida")) - Column( - children: [ - fieldGoups![2].title!.toText14(), - 6.height, - detailView(fieldGoups![2].fields!), - 12.height, - fieldGoups![3].title!.toText14(), - 6.height, - detailView(fieldGoups![3].fields!), - 12.height, - fieldGoups![4].title!.toText14(), - 6.height, - detailView(fieldGoups![4].fields!), - ], - ) - ], - ), - ), - ), - ), - ], - ); - } - - Widget detailView(List fieldsF) { - List fields = List.from(fieldsF); - - bool isOdd = false; - if (fields.length % 2 != 0) { - isOdd = true; - fields.add(new Fields()); - } - - int descriptionFormatIndex = fields.indexWhere((element) => element.title == "Description Format" || element.title == "Description Format"); // todo add arabic in future - Widget? descriptionFormatView; - if (descriptionFormatIndex >= 0) { - Fields descriptionFormat = fields[descriptionFormatIndex]; - fields.removeAt(descriptionFormatIndex); - - descriptionFormatView = ItemDetailViewGridItem( - 2, - descriptionFormat.title, - descriptionFormat.value == null ? (descriptionFormat.multipleValue?.join(", ") ?? "") : descriptionFormat.value ?? "", - type: descriptionFormat.type, - maxLine: 0, - ); - } - - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - GridView.builder( - itemCount: fields.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - if (fields[index].value == null) { - return ItemDetailViewGridItem( - index, - fields[index].title, - fields[index].multipleValue?.join(", ") ?? "", - isNeedToShowEmptyDivider: (fields.length == index + 1) - ? isOdd - ? true - : false - : false, - type: fields[index].type, - ); - } - return ItemDetailViewGridItem( - index, - fields[index].title, - fields[index].value ?? "", - isNeedToShowEmptyDivider: (fields.length == index + 1) - ? isOdd - ? true - : false - : false, - type: fields[index].type, - ); - }, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - childAspectRatio: (itemWidth / itemHeight), - ), - ), - if (descriptionFormatView != null) descriptionFormatView, - ], - ).objectContainerView(); - return ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) { - if (fields[index].value == null) { - return ItemDetailView(fields[index].title!, fields[index].multipleValue?.join(", ") ?? ""); - } - return ItemDetailView(fields[index].title!, fields[index].value ?? ""); - }, - separatorBuilder: (cxt, index) => 4.height, - itemCount: fields.length) - .objectContainerView(); - } -} +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/itg/itg_summary_data.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/field_goups_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/fields_model.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; class RequestDetailFragment extends StatelessWidget { List fields; List? fieldGoups; String taskID; ItgTimeCardSummaryData? summaryData; RequestDetailFragment({Key? key, this.fields = const [], this.fieldGoups = const [], this.taskID = "", this.summaryData}) : super(key: key); double itemHeight = 0; double itemWidth = 0; @override Widget build(BuildContext context) { var size = MediaQuery.of(context).size; itemHeight = (size.height - kToolbarHeight - 24) / 9; itemWidth = size.width / 2; List uiList = [detailView(fields)]; return Column( mainAxisSize: MainAxisSize.min, children: [ Expanded( child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(21), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( width: double.infinity, // height: double.infinity, child: fields.isEmpty ? LocaleKeys.noDataAvailable.tr().toText16().center : ListView(shrinkWrap: true, children: uiList), ), 12.height, if (taskID.toLowerCase().contains("vida")) Column( children: [ fieldGoups![2].title!.toText14(), 6.height, detailView(fieldGoups![2].fields!), 12.height, fieldGoups![3].title!.toText14(), 6.height, detailView(fieldGoups![3].fields!), 12.height, fieldGoups![4].title!.toText14(), 6.height, detailView(fieldGoups![4].fields!), ], ), if (summaryData != null && summaryData!.summeries != null && summaryData!.summeries!.isNotEmpty) buildStatsDashboard(summaryData: summaryData), ], ), ), ), ), ], ); } Widget leaveTypeHorizontalList() { return SizedBox( // height: 120, child: ListView( shrinkWrap: true, scrollDirection: Axis.vertical, physics: const NeverScrollableScrollPhysics(), padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), children: [ _buildLeaveTypeChip( title: 'Half-Day Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar-remove.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Unauthorised Leave', value: summaryData?.summeries?.first.unauthorizeDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/knight-shield.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip(title: 'Sick Leave', value: summaryData?.summeries?.first.sicKLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/stethoscope.svg"), const SizedBox(height: 12), _buildLeaveTypeChip(title: 'Paid Leave', value: summaryData?.summeries?.first.paiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar.svg"), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Unpaid Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/money-not-found.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Public Holidays', value: summaryData?.summeries?.first.publiCHolidays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), ], ), ); } Widget _buildLeaveTypeChip({required String title, required String value, required Color textColor, Color? valueColor, String? topIcon, String? bottomIcon, Widget? child}) { return Container( padding: const EdgeInsets.all(10), height: 110, decoration: BoxDecoration( color: const Color(0xFFEAF1F4), borderRadius: BorderRadius.circular(8), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 8, offset: const Offset(0, 4))], ), child: child ?? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (topIcon != null) ...[ Row(children: [Expanded(child: title.toText13(color: textColor)), SvgPicture.asset(topIcon, width: 24)]), const SizedBox(height: 21), ] else ...[ title.toText13(color: textColor), const SizedBox(height: 8), ], Row(children: [value.toText24(color: valueColor ?? textColor, isBold: true), const SizedBox(width: 10), if (bottomIcon != null) SvgPicture.asset(bottomIcon, width: 24)]), ], ), ); } Widget buildStatsDashboard({required ItgTimeCardSummaryData? summaryData}) { return Column( children: [ // First row with 2 boxes Row( children: [ buildStatBox( title: 'Missing Swipes', value: summaryData?.summeries?.first.missinGSwipesDays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), const SizedBox(width: 15), buildStatBox(title: 'Total Shortage', value: summaryData?.summeries?.first.shortagEHrs ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/time-quarter-pass.svg"), ], ), const SizedBox(height: 15), // Second row with 2 boxes Row( children: [ buildLateInEarlyOutBox( lateInValue: summaryData?.summeries?.first.latEInHrs ?? "0", earlyOutValue: summaryData?.summeries?.first.earlYOutHrs ?? "0", topIcon: "assets/icons/itg/coming-soon.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Uncovered Shortage', value: summaryData?.summeries?.first.uncovereDShortageHrs.toString() ?? "0", textColor: const Color(0xFF3B3D4A), valueColor: const Color(0xFFEB5757), topIcon: "assets/icons/itg/time-quarter.svg", bottomIcon: "assets/icons/itg/alert.svg", ), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox( title: 'Half-Day Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar-remove.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Unauthorised Leave', value: summaryData?.summeries?.first.unauthorizeDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/knight-shield.svg", ), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox(title: 'Sick Leave', value: summaryData?.summeries?.first.sicKLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/stethoscope.svg",), const SizedBox(width: 15), buildStatBox(title: 'Paid Leave', value: summaryData?.summeries?.first.paiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar.svg",), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox( title: 'Unpaid Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/money-not-found.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Public Holidays', value: summaryData?.summeries?.first.publiCHolidays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), ], ), const SizedBox(height: 15), ], ); } Widget buildStatBox({required String title, required String value, required Color textColor, Color? valueColor, String? topIcon, String? bottomIcon, Widget? child}) { return Expanded( child: Container( padding: const EdgeInsets.all(10), height: 110, decoration: BoxDecoration( color: const Color(0xFFEAF1F4), borderRadius: BorderRadius.circular(8), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 8, offset: const Offset(0, 4))], ), child: child ?? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (topIcon != null) ...[ Row(children: [Expanded(child: title.toText13(color: textColor)), SvgPicture.asset(topIcon, width: 24)]), const SizedBox(height: 40), ] else ...[ title.toText13(color: textColor), const SizedBox(height: 8), ], Row(children: [value.toText24(color: valueColor ?? textColor, isBold: true), const SizedBox(width: 10), if (bottomIcon != null) SvgPicture.asset(bottomIcon, width: 20)]), ], ), ), ); } Widget buildLateInEarlyOutBox({required String lateInValue, required String earlyOutValue, required String topIcon}) { return buildStatBox( title: 'Late In / Early Out', textColor: const Color(0xFFEB5757), topIcon: topIcon, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row(children: ["Late In / Early Out".toText13(color: const Color(0xFF3B3D4A)), const Expanded(child: SizedBox()), SvgPicture.asset(topIcon, width: 24)]), const SizedBox(height: 22), RichText( text: TextSpan( style: const TextStyle(fontSize: 13), children: [ const TextSpan(text: 'Late In : ', style: TextStyle(color: Color(0xFF767676), fontSize: 14)), TextSpan(text: lateInValue, style: const TextStyle(color: Color(0xFF3B3D4A), fontSize: 16, fontWeight: FontWeight.w700)), ], ), ), RichText( text: TextSpan( style: const TextStyle(fontSize: 13), children: [ const TextSpan(text: 'Early Out : ', style: TextStyle(color: Color(0xFF767676), fontSize: 14)), TextSpan(text: earlyOutValue, style: const TextStyle(color: Color(0xFF3B3D4A), fontSize: 16, fontWeight: FontWeight.w700)), ], ), ), ], ), value: '', ); } Widget detailView(List fieldsF) { List fields = List.from(fieldsF); bool isOdd = false; if (fields.length % 2 != 0) { isOdd = true; fields.add(new Fields()); } int descriptionFormatIndex = fields.indexWhere((element) => element.title == "Description Format" || element.title == "Description Format"); // todo add arabic in future Widget? descriptionFormatView; if (descriptionFormatIndex >= 0) { Fields descriptionFormat = fields[descriptionFormatIndex]; fields.removeAt(descriptionFormatIndex); descriptionFormatView = ItemDetailViewGridItem( 2, descriptionFormat.title, descriptionFormat.value == null ? (descriptionFormat.multipleValue?.join(", ") ?? "") : descriptionFormat.value ?? "", type: descriptionFormat.type, maxLine: 0, ); } return Column( mainAxisSize: MainAxisSize.min, children: [ GridView.builder( itemCount: fields.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (context, index) { if (fields[index].value == null) { return ItemDetailViewGridItem( index, fields[index].title, fields[index].multipleValue?.join(", ") ?? "", isNeedToShowEmptyDivider: (fields.length == index + 1) ? isOdd ? true : false : false, type: fields[index].type, ); } return ItemDetailViewGridItem( index, fields[index].title, fields[index].value ?? "", isNeedToShowEmptyDivider: (fields.length == index + 1) ? isOdd ? true : false : false, type: fields[index].type, ); }, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: (itemWidth / itemHeight)), ), if (descriptionFormatView != null) descriptionFormatView, ], ).objectContainerView(); return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (cxt, index) { if (fields[index].value == null) { return ItemDetailView(fields[index].title!, fields[index].multipleValue?.join(", ") ?? ""); } return ItemDetailView(fields[index].title!, fields[index].value ?? ""); }, separatorBuilder: (cxt, index) => 4.height, itemCount: fields.length, ).objectContainerView(); } } \ No newline at end of file diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 6f93909..7637cd1 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -36,52 +36,95 @@ class WorkListScreen extends StatefulWidget { class _WorkListScreenState extends State { List workListItemTypes = [ WorkListItemTypeModelData( - value: 0, - name: 'HR', - fullName: LocaleKeys.humanResource.tr(), - active: false, - color: [Color(0xff32D892), Color(0xff1AB170)], - icon: "assets/images/miss_swipe.svg", - key: 'HRSSA', - disable: false), + value: 0, + name: 'HR', + fullName: LocaleKeys.humanResource.tr(), + active: false, + color: [Color(0xff32D892), Color(0xff1AB170)], + icon: "assets/images/miss_swipe.svg", + key: 'HRSSA', + disable: false, + ), WorkListItemTypeModelData( - value: 0, name: 'MR', fullName: LocaleKeys.moveOrder.tr(), active: false, color: [Color(0xff58DCFA), Color(0xff3CB9D5)], icon: "assets/images/miss_swipe.svg", key: 'INVMOA', disable: false), + value: 0, + name: 'MR', + fullName: LocaleKeys.moveOrder.tr(), + active: false, + color: [Color(0xff58DCFA), Color(0xff3CB9D5)], + icon: "assets/images/miss_swipe.svg", + key: 'INVMOA', + disable: false, + ), WorkListItemTypeModelData( - value: 0, - name: 'PR', - fullName: LocaleKeys.purchaseRequisition.tr(), - active: false, - color: [Color(0xff48EACF), Color(0xff3DCAB3)], - icon: "assets/images/miss_swipe.svg", - key: 'REQAPPRV', - disable: false), + value: 0, + name: 'PR', + fullName: LocaleKeys.purchaseRequisition.tr(), + active: false, + color: [Color(0xff48EACF), Color(0xff3DCAB3)], + icon: "assets/images/miss_swipe.svg", + key: 'REQAPPRV', + disable: false, + ), WorkListItemTypeModelData( - value: 0, - name: 'PO', - fullName: LocaleKeys.purchaseOrder.tr(), - active: false, - color: [Color(0xff5099E3), Color(0xff3670AA)], - icon: "assets/images/miss_swipe.svg", - key: 'POAPPRV', - disable: false), + value: 0, + name: 'PO', + fullName: LocaleKeys.purchaseOrder.tr(), + active: false, + color: [Color(0xff5099E3), Color(0xff3670AA)], + icon: "assets/images/miss_swipe.svg", + key: 'POAPPRV', + disable: false, + ), WorkListItemTypeModelData( - value: 0, name: 'ITG', fullName: LocaleKeys.ITGForms.tr(), active: false, color: [Color(0xffEB8C90), Color(0xffDE6C70)], icon: "assets/images/miss_swipe.svg", key: 'ITG', disable: false), + value: 0, + name: 'ITG', + fullName: LocaleKeys.ITGForms.tr(), + active: false, + color: [Color(0xffEB8C90), Color(0xffDE6C70)], + icon: "assets/images/miss_swipe.svg", + key: 'ITG', + disable: false, + ), WorkListItemTypeModelData( - value: 0, - name: 'IC', - fullName: LocaleKeys.itemCreation.tr(), - active: false, - color: [Color(0xff32D892), Color(0xff1AB170)], - icon: "assets/images/miss_swipe.svg", - key: 'INVITEM', - disable: false), + value: 0, + name: 'IC', + fullName: LocaleKeys.itemCreation.tr(), + active: false, + color: [Color(0xff32D892), Color(0xff1AB170)], + icon: "assets/images/miss_swipe.svg", + key: 'INVITEM', + disable: false, + ), WorkListItemTypeModelData( - value: 0, name: 'STAMP', fullName: LocaleKeys.stamp.tr(), active: false, color: [Color(0xff32D892), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'STAMP', disable: false), + value: 0, + name: 'STAMP', + fullName: LocaleKeys.stamp.tr(), + active: false, + color: [Color(0xff32D892), Color(0xff1AB170)], + icon: "assets/images/miss_swipe.svg", + key: 'STAMP', + disable: false, + ), WorkListItemTypeModelData( - value: 0, name: 'COC', fullName: LocaleKeys.itemCreation.tr(), active: false, color: [Color(0xff787299), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'COC', disable: true), + value: 0, + name: 'COC', + fullName: LocaleKeys.itemCreation.tr(), + active: false, + color: [Color(0xff787299), Color(0xff1AB170)], + icon: "assets/images/miss_swipe.svg", + key: 'COC', + disable: true, + ), WorkListItemTypeModelData( - value: 0, name: 'Payment Req', fullName: LocaleKeys.paymentRequest.tr(), active: false, color: [Color(0xff42d7bf), Color(0xff42d7bf)], icon: "assets/images/PR.svg", key: 'PAY_REQ', disable: false) - + value: 0, + name: 'Payment Req', + fullName: LocaleKeys.paymentRequest.tr(), + active: false, + color: [Color(0xff42d7bf), Color(0xff42d7bf)], + icon: "assets/images/PR.svg", + key: 'PAY_REQ', + disable: false, + ), ]; int? workListItemIndex; @@ -171,6 +214,7 @@ class _WorkListScreenState extends State { }); requestAllList = requestAllList + (itgFormsModel?.requestType![i].requestDetails ?? []); } + AppState().setRequestAllList = requestAllList; itgFormsModel?.requestType!.insert(0, RequestType(requestDetails: requestAllList, requestTypeCode: "all", requestTypeName: "All")); if ((itgFormsModel?.requestType?.length ?? 0) > 0) { @@ -199,10 +243,7 @@ class _WorkListScreenState extends State { _refreshController.refreshCompleted(); Utils.showLoading(context); pageNumber = 1; - List dataOnRefresh = await Future.wait([ - providerData.fetchWorkListCounter(context, showLoading: false), - getWorkList(showLoading: false, isCallingFromRefresh: true), - ]); + List dataOnRefresh = await Future.wait([providerData.fetchWorkListCounter(context, showLoading: false), getWorkList(showLoading: false, isCallingFromRefresh: true)]); calculateCounter(); Utils.hideLoading(context); setState(() {}); @@ -232,131 +273,137 @@ class _WorkListScreenState extends State { return Scaffold( backgroundColor: Colors.white, appBar: AppBarWidget(context, title: LocaleKeys.workList.tr(), showWorkListSettingButton: true), - body: workListItemIndex == null - ? Utils.getNoDataWidget(context) - : SizedBox( - width: double.infinity, - height: double.infinity, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 40, - child: ListView.separated( - controller: _controller, - itemBuilder: (context, index) { - return Container( - padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8), - alignment: Alignment.center, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(6), color: workListItemIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor), - child: ("${workListItemTypes[index].name} ${workListItemTypes[index].value > 0 ? "(${workListItemTypes[index].value})" : ""}") - .toText12(color: workListItemIndex == index ? MyColors.white : MyColors.black), - ).onPress(() { - if (pNotificationType != 1) { - pNotificationType = 1; - } - if (workListItemIndex != index && !workListItemTypes[index].disable) { - workListItemIndex = index; - pageNumber = 1; - if (workListItemTypes[index].value == 0) { - workList = []; - itgRequestTypeIndex = null; - } else { - workList = null; + body: + workListItemIndex == null + ? Utils.getNoDataWidget(context) + : SizedBox( + width: double.infinity, + height: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 40, + child: ListView.separated( + controller: _controller, + itemBuilder: (context, index) { + return Container( + padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8), + alignment: Alignment.center, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(6), color: workListItemIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor), + child: ("${workListItemTypes[index].name} ${workListItemTypes[index].value > 0 ? "(${workListItemTypes[index].value})" : ""}").toText12( + color: workListItemIndex == index ? MyColors.white : MyColors.black, + ), + ).onPress(() { + if (pNotificationType != 1) { + pNotificationType = 1; } - setState(() {}); - if (workListItemTypes[index].value > 0) { - getWorkList(); + if (workListItemIndex != index && !workListItemTypes[index].disable) { + workListItemIndex = index; + pageNumber = 1; + if (workListItemTypes[index].value == 0) { + workList = []; + itgRequestTypeIndex = null; + } else { + workList = null; + } + setState(() {}); + if (workListItemTypes[index].value > 0) { + getWorkList(); + } } - } - }); - }, - separatorBuilder: (context, index) => 8.width, - shrinkWrap: true, - itemCount: workListItemTypes.length, - scrollDirection: Axis.horizontal, - padding: const EdgeInsets.only(left: 21, right: 21), + }); + }, + separatorBuilder: (context, index) => 8.width, + shrinkWrap: true, + itemCount: workListItemTypes.length, + scrollDirection: Axis.horizontal, + padding: const EdgeInsets.only(left: 21, right: 21), + ), + ).paddingOnly(top: 21, bottom: 21), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + workListItemTypes[workListItemIndex!].fullName.toSectionHeading().paddingOnly(left: 21, right: 21), + LocaleKeys.advancedSearch + .tr() + .toText14(isUnderLine: true, color: MyColors.textMixColor) + .onPress(() { + openBottomSheet(context); + }) + .paddingOnly(left: 21, right: 21), + ], ), - ).paddingOnly(top: 21, bottom: 21), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - workListItemTypes[workListItemIndex!].fullName.toSectionHeading().paddingOnly(left: 21, right: 21), - LocaleKeys.advancedSearch.tr().toText14(isUnderLine: true, color: MyColors.textMixColor).onPress(() { - openBottomSheet(context); - }).paddingOnly(left: 21, right: 21) - ], - ), - SmartRefresher( + SmartRefresher( enablePullDown: true, enablePullUp: false, - header: const MaterialClassicHeader( - color: MyColors.gradiantEndColor, - ), + header: const MaterialClassicHeader(color: MyColors.gradiantEndColor), controller: _refreshController, onRefresh: _onRefresh, scrollController: _scrollController, child: SingleChildScrollView( physics: const BouncingScrollPhysics(), - child: itgRequestTypeIndex != null - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // todo this is commented for temporary purpose, have issue when selecting any itg category and click any item showing wrong details - // SizedBox( - // height: 40, - // child: ListView.separated( - // itemBuilder: (context, index) { - // RequestType type = itgFormsModel!.requestType![index]; - // return Container( - // padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8), - // alignment: Alignment.center, - // decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: itgRequestTypeIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor), - // child: ("${type.requestTypeName}").toText12(color: itgRequestTypeIndex == index ? MyColors.white : MyColors.black), - // ).onPress(() { - // if (itgRequestTypeIndex != index) { - // itgRequestTypeIndex = index; - // setState(() {}); - // } - // }); - // }, - // separatorBuilder: (context, index) => 8.width, - // shrinkWrap: true, - // itemCount: itgFormsModel?.requestType?.length ?? 0, - // scrollDirection: Axis.horizontal, - // padding: const EdgeInsets.only(left: 21, right: 21), - // ), - // ).paddingOnly(top: 16, bottom: 16), - ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - return itgRowItem(workListItemTypes[workListItemIndex!], itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails![index], index); - }, - separatorBuilder: (context, index) => 12.height, - itemCount: itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails?.length ?? 0, - padding: const EdgeInsets.all(21), - ), - ], - ) - : workList != null + child: + itgRequestTypeIndex != null + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // todo this is commented for temporary purpose, have issue when selecting any itg category and click any item showing wrong details + // SizedBox( + // height: 40, + // child: ListView.separated( + // itemBuilder: (context, index) { + // RequestType type = itgFormsModel!.requestType![index]; + // return Container( + // padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8), + // alignment: Alignment.center, + // decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: itgRequestTypeIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor), + // child: ("${type.requestTypeName}").toText12(color: itgRequestTypeIndex == index ? MyColors.white : MyColors.black), + // ).onPress(() { + // if (itgRequestTypeIndex != index) { + // itgRequestTypeIndex = index; + // setState(() {}); + // } + // }); + // }, + // separatorBuilder: (context, index) => 8.width, + // shrinkWrap: true, + // itemCount: itgFormsModel?.requestType?.length ?? 0, + // scrollDirection: Axis.horizontal, + // padding: const EdgeInsets.only(left: 21, right: 21), + // ), + // ).paddingOnly(top: 16, bottom: 16), + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return itgRowItem(workListItemTypes[workListItemIndex!], itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails![index], index); + }, + separatorBuilder: (context, index) => 12.height, + itemCount: itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails?.length ?? 0, + padding: const EdgeInsets.all(21), + ), + ], + ) + : workList != null ? ((workList!).isEmpty ? Utils.getNoDataWidget(context).paddingOnly(top: 100) : ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - return rowItem(workListItemTypes[workListItemIndex!], workList![index], index); - }, - separatorBuilder: (context, index) => 12.height, - itemCount: workList?.length ?? 0, - padding: const EdgeInsets.all(21), - )) + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return rowItem(workListItemTypes[workListItemIndex!], workList![index], index); + }, + separatorBuilder: (context, index) => 12.height, + itemCount: workList?.length ?? 0, + padding: const EdgeInsets.all(21), + )) : const SizedBox(), - )).expanded, - ], + ), + ).expanded, + ], + ), ), - ), ); } @@ -388,13 +435,7 @@ class _WorkListScreenState extends State { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], + boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))], ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -509,13 +550,7 @@ class _WorkListScreenState extends State { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], + boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))], ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -555,10 +590,6 @@ class _WorkListScreenState extends State { } void _animateToIndex(int index, double width) { - _controller.animateTo( - index * width, - duration: const Duration(seconds: 1), - curve: Curves.fastOutSlowIn, - ); + _controller.animateTo(index * width, duration: const Duration(seconds: 1), curve: Curves.fastOutSlowIn); } } diff --git a/lib/widgets/otp_widget.dart b/lib/widgets/otp_widget.dart index 7994b1e..7196a22 100644 --- a/lib/widgets/otp_widget.dart +++ b/lib/widgets/otp_widget.dart @@ -49,23 +49,23 @@ class OTPWidget extends StatefulWidget { const OTPWidget({ Key? key, - this.maxLength: 4, + this.maxLength = 4, this.controller, - this.pinBoxWidth: 70.0, - this.pinBoxHeight: 70.0, + this.pinBoxWidth = 70.0, + this.pinBoxHeight = 70.0, this.pinTextStyle, this.onDone, - this.defaultBorderColor: Colors.black, - this.textBorderColor: Colors.black, + this.defaultBorderColor = Colors.black, + this.textBorderColor = Colors.black, this.pinTextAnimatedSwitcherTransition, - this.pinTextAnimatedSwitcherDuration: const Duration(), - this.hasError: false, - this.errorBorderColor: Colors.red, + this.pinTextAnimatedSwitcherDuration = const Duration(), + this.hasError = false, + this.errorBorderColor = Colors.red, this.onTextChanged, - this.autoFocus: false, + this.autoFocus = false, this.focusNode, - this.textDirection: TextDirection.ltr, - this.keyboardType: TextInputType.number, + this.textDirection = TextDirection.ltr, + this.keyboardType =TextInputType.number, this.pinBoxOuterPadding = const EdgeInsets.symmetric(horizontal: 4.0), this.pinBoxColor = Colors.white, this.pinBoxBorderWidth = 2.0, diff --git a/pubspec.yaml b/pubspec.yaml index 13708ea..27f23f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 3.7.98+3 environment: - sdk: ">=2.16.0 <3.7.0" + sdk: ^3.7.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -164,6 +164,7 @@ flutter: - assets/ - assets/langs/ - assets/icons/ + - assets/icons/itg/ - assets/lottie/ - assets/audio/ - assets/json/