From 368d109d9ffcc82390ee2b3a1137de57417a6a40 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 6 Oct 2024 09:48:56 +0300 Subject: [PATCH 01/39] absence days fix --- lib/models/leave_balance/calculate_absence_duration_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/leave_balance/calculate_absence_duration_model.dart b/lib/models/leave_balance/calculate_absence_duration_model.dart index cf32a0e..df6a5d2 100644 --- a/lib/models/leave_balance/calculate_absence_duration_model.dart +++ b/lib/models/leave_balance/calculate_absence_duration_model.dart @@ -1,5 +1,5 @@ class CalculateAbsenceDuration { - double? pABSENCEDAYS; + num? pABSENCEDAYS; double? pABSENCEHOURS; String? pRETURNMSG; String? pRETURNSTATUS; From 11881b0ba1a8792b6a7e270b20c44d0641ba7ac2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 16 Oct 2024 18:07:00 +0300 Subject: [PATCH 02/39] hotfix for payment request WL --- assets/langs/ar-SA.json | 17 +- assets/langs/en-US.json | 17 +- lib/generated/codegen_loader.g.dart | 25 +- lib/generated/locale_keys.g.dart | 14 + lib/ui/work_list/itg_detail_screen.dart | 1 + .../worklist_fragments/info_fragments.dart | 656 ++++++++++-------- 6 files changed, 429 insertions(+), 301 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index c59641b..6370baf 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -544,5 +544,20 @@ "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", - "open": "يفتح" + "open": "يفتح", + "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", + "prepareEmpNum":"إعداد رقم الموظف", + "supplierInfo" : "معلومات المورد", + "supplierAcNo": "رقم حساب المورد", + "supplierAcName": "اسم حساب المورد", + "supplierIBAN" : "رقم IBAN للمورد", + "supplierCRNo" :"رقم السجل التجاري", + "suppliedAcNo" : "رقم الحساب المقدم", + "patientRefundInvoice" : "فاتورة استرداد الأموال للمريض", + "patientNumber" : "رقم المريض", + "patientName" : "اسم المريض", + "invoiceDate" : "تاريخ الفاتورة", + "refundInvoice" :"فاتورة الاسترجاع", + "hospitalClinic" : "عيادة المستشفى" + } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 275864f..61bba1d 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -563,5 +563,20 @@ "open": "open", "addAtLeastOneAttachment": "Please add at least one attachment.", "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", - "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit." + "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", + "requesterOperatingUnit":"Requester Operating Unit", + "prepareEmpNum":"Prepare Employee Num", + "supplierInfo" : "Supplier Information", + "supplierAcNo": "Supplier Account No", + "supplierAcName":"Supplier Account Name", + "supplierIBAN" : "Supplier IBAN", + "supplierCRNo" : "CR Number", + "suppliedAcNo" : "Supplied Account No.", + "patientRefundInvoice" : "Patient Refund Invoice", + "patientNumber" : "Patient Number", + "patientName" : "Patient Name", + "invoiceDate" : "Invoice Date", + "refundInvoice" :"Refund Invoice", + "hospitalClinic" : "Hospital Clinic" + } \ No newline at end of file diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 4a0d665..357d6eb 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -575,7 +575,10 @@ class CodegenLoader extends AssetLoader { "pOAmount":"مبلغ الطلب", "versionStatus":"حالة الإصدار", "supplierNo":"رقم المورد", - "general":"عام" + "general":"عام", + "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", + "prepareEmpNum":"إعداد رقم الموظف", + }; static const Map en_US = { "mohemm": "Mohemm", @@ -1157,7 +1160,25 @@ class CodegenLoader extends AssetLoader { "pOAmount":"PO Amount", "versionStatus":"Version Status", "supplierNo":"Supplier No", - "general":"General" + "general":"General", + "prepareEmpNum":"Prepare Employee Num", + "requesterOperatingUnit":"Requester Operating Unit", + "supplierInfo" : "Supplier Information", + "supplierNum": "Supplier Number", + "supplierAcNo": "Supplier Account Number", + "supplierAcName" : 'Supplier Account Name', + "supplierIBAN" : 'Supplier IBAN', + "supplierCRNo" : 'CR Number', + "suppliedAcNo" : 'Supplied Account No.', + "patientRefundInvoice" : 'Patient Refund Invoice', + "patientNumber" : 'Patient Number', + "patientName" : 'Patient Name', + "invoiceDate" : 'Invoice Date', + "refundInvoice" : 'Refund Invoice', + "hospitalClinic" : 'Hospital Clinic', + + + }; static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 0ec89e4..9faea5a 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -575,5 +575,19 @@ abstract class LocaleKeys { static const versionStatus ='versionStatus'; static const supplierNo ='supplierNo'; static const general ="general"; + static const supplierInfo = 'supplierInfo'; + static const supplierAcNo = 'supplierAcNo'; + static const supplierAcName = 'supplierAcName'; + static const supplierIBAN = 'Supplier IBAN'; + static const supplierCRNo = 'CR Number'; + static const suppliedAcNo = 'Supplied Account No.'; + static const patientRefundInvoice = "patientRefundInvoice"; + static const patientNumber = 'Patient Number'; + static const patientName = 'Patient Name'; + static const invoiceDate = 'Invoice Date'; + static const refundInvoice = 'Refund Invoice'; + static const hospitalClinic = 'Hospital Clinic'; + static const requesterOperatingUnit ='requesterOperatingUnit'; + static const prepareEmpNum ='prepareEmpNum'; } diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index 2381b70..8cb7944 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -95,6 +95,7 @@ class _ItgDetailScreenState extends State { requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1; getItgData(); + Utils.hideLoading(context); getItgRequestAttachments(); } } diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 1351126..76f2ace 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -29,11 +29,11 @@ class InfoFragment extends StatelessWidget { List? getStampNsNotifications; List itemCreationHeader; List? - getEitCollectionNotificationBodyList; + getEitCollectionNotificationBodyList; List? getPhonesNotificationBodyList; List? getBasicDetNtfBodyList; List? - getAbsenceCollectionNotificationBodyList; + getAbsenceCollectionNotificationBodyList; GetContactNotificationBodyList? getContactNotificationBodyList; GetPrNotificationBodyList? getPrNotificationBodyList; List? getAddressNotificationBodyList = []; @@ -42,19 +42,19 @@ class InfoFragment extends StatelessWidget { InfoFragment( {this.workListData, - this.poHeaderList = const [], - this.itemCreationHeader = const [], - this.getStampMsNotifications, - this.getStampNsNotifications, - this.getEitCollectionNotificationBodyList, - this.getPhonesNotificationBodyList, - this.getBasicDetNtfBodyList, - this.getAbsenceCollectionNotificationBodyList, - this.getContactNotificationBodyList, - this.getPrNotificationBodyList, - this.getAddressNotificationBodyList, - this.getTerminationNotificationBodyList, - this.getPaymentNotificationBodyList}); + this.poHeaderList = const [], + this.itemCreationHeader = const [], + this.getStampMsNotifications, + this.getStampNsNotifications, + this.getEitCollectionNotificationBodyList, + this.getPhonesNotificationBodyList, + this.getBasicDetNtfBodyList, + this.getAbsenceCollectionNotificationBodyList, + this.getContactNotificationBodyList, + this.getPrNotificationBodyList, + this.getAddressNotificationBodyList, + this.getTerminationNotificationBodyList, + this.getPaymentNotificationBodyList}); double itemHeight = 0; double itemWidth = 0; @@ -120,7 +120,7 @@ class InfoFragment extends StatelessWidget { getAbsenceCollectionNotificationBodyList ?? []), if (getContactNotificationBodyList != null) getContactNotificationBodyListWidget(getContactNotificationBodyList ?? - GetContactNotificationBodyList()) + GetContactNotificationBodyList()) .objectContainerView(), if (getAddressNotificationBodyList?.isNotEmpty ?? false) getAddressNotificationBodyListWidget(getAddressNotificationBodyList!), @@ -129,7 +129,7 @@ class InfoFragment extends StatelessWidget { getTerminationNotificationBodyList!), if (getPaymentNotificationBodyList != null) getPaymentNotificationBodyListWidget(getPaymentNotificationBodyList ?? - GetPaymentNotificationBodyList()) + GetPaymentNotificationBodyList()) .objectContainerView(), ]; return Container( @@ -138,9 +138,9 @@ class InfoFragment extends StatelessWidget { child: uiList.isEmpty ? LocaleKeys.noDataAvailable.tr().toText16().center : ListView( - padding: const EdgeInsets.all(21), - children: uiList, - ), + padding: const EdgeInsets.all(21), + children: uiList, + ), ); } @@ -149,93 +149,93 @@ class InfoFragment extends StatelessWidget { shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (BuildContext cxt, int index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Column( + children: [ + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.description.tr(), + workListData!.fROMUSER ?? ""), + ItemDetailViewCol( + LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), + ItemDetailViewCol( + LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), + ItemDetailViewCol(LocaleKeys.id.tr(), + workListData!.nOTIFICATIONID?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.supplier.tr(), + poHeaderList[index].vENDORNAME ?? ""), + ItemDetailViewCol(LocaleKeys.site.tr(), + poHeaderList[index].vENDORSITECODE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.buyer.tr(), + poHeaderList[index].bUYER ?? ""), + ItemDetailViewCol(LocaleKeys.preparer.tr(), + poHeaderList[index].pREPARER ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.creationDate.tr(), + poHeaderList[index].cREATIONDATE ?? ""), + ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), + poHeaderList[index].sHIPTOLOCATIONNAME ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), + poHeaderList[index].qUOTATIONNUMBER ?? ""), + ItemDetailViewCol(LocaleKeys.quotationDate.tr(), + poHeaderList[index].qUOTATIONDATE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.paymentTerms.tr(), + poHeaderList[index].pAYMENTTERMS ?? ""), + ItemDetailViewCol(LocaleKeys.currency.tr(), + poHeaderList[index].cURRENCYNAME ?? ""), + isItLast: true, + ), + ], + ).objectContainerView(title: LocaleKeys.infoDetail.tr()), + 12.height, + Column( children: [ - Column( - children: [ - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.description.tr(), - workListData!.fROMUSER ?? ""), - ItemDetailViewCol( - LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol( - LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), - ItemDetailViewCol( - LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol( - LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), - ItemDetailViewCol(LocaleKeys.id.tr(), - workListData!.nOTIFICATIONID?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.supplier.tr(), - poHeaderList[index].vENDORNAME ?? ""), - ItemDetailViewCol(LocaleKeys.site.tr(), - poHeaderList[index].vENDORSITECODE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.buyer.tr(), - poHeaderList[index].bUYER ?? ""), - ItemDetailViewCol(LocaleKeys.preparer.tr(), - poHeaderList[index].pREPARER ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.creationDate.tr(), - poHeaderList[index].cREATIONDATE ?? ""), - ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), - poHeaderList[index].sHIPTOLOCATIONNAME ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), - poHeaderList[index].qUOTATIONNUMBER ?? ""), - ItemDetailViewCol(LocaleKeys.quotationDate.tr(), - poHeaderList[index].qUOTATIONDATE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.paymentTerms.tr(), - poHeaderList[index].pAYMENTTERMS ?? ""), - ItemDetailViewCol(LocaleKeys.currency.tr(), - poHeaderList[index].cURRENCYNAME ?? ""), - isItLast: true, - ), - ], - ).objectContainerView(title: LocaleKeys.infoDetail.tr()), - 12.height, - Column( - children: [ - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.grossAmount.tr(), - poHeaderList[index].gROSSAMOUNT?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.discountAmount.tr(), - poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.customDuty.tr(), - poHeaderList[index].cUSTOMDUTY?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.shipHandle.tr(), - poHeaderList[index].sHIPHANDLE?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.otherCharges.tr(), - poHeaderList[index].oTHERCHARGES?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(), - poHeaderList[index].lOCCURTOTPOAMT.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.totalPOAmountInWords.tr(), - poHeaderList[index].tOTPOAMTWORD ?? ""), - Container(), - isItLast: true, - ), - ], - ).objectContainerView(title: LocaleKeys.amount_detail.tr()), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.grossAmount.tr(), + poHeaderList[index].gROSSAMOUNT?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.discountAmount.tr(), + poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.customDuty.tr(), + poHeaderList[index].cUSTOMDUTY?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.shipHandle.tr(), + poHeaderList[index].sHIPHANDLE?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.otherCharges.tr(), + poHeaderList[index].oTHERCHARGES?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(), + poHeaderList[index].lOCCURTOTPOAMT.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.totalPOAmountInWords.tr(), + poHeaderList[index].tOTPOAMTWORD ?? ""), + Container(), + isItLast: true, + ), ], - ), + ).objectContainerView(title: LocaleKeys.amount_detail.tr()), + ], + ), separatorBuilder: (BuildContext cxt, int index) => 4.height, itemCount: poHeaderList.length); } @@ -256,55 +256,55 @@ class InfoFragment extends StatelessWidget { shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (BuildContext cxt, int index) => Column( - mainAxisSize: MainAxisSize.min, - children: [ - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), - list[index].eMPLOYEENUMBER.toString()), - ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), - list[index].aSSIGNMENTNUMBER.toString()), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeName.tr(), - list[index].eMPLOYEENAME.toString()), - ItemDetailViewCol( - LocaleKeys.scheduleDate.tr(), - DateUtil.formatDateToDate( - DateUtil.convertStringToDate( - list[index].sCHEDULEDATE.toString()), - false)), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.shiftType.tr(), - list[index].sHTTYPEDESC.toString()), - ItemDetailViewCol( - LocaleKeys.shift.tr(), list[index].sHTNAME.toString()), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.breakText.tr(), - list[index].bREAKNAME.toString()), - ItemDetailViewCol(LocaleKeys.actualSwipeStart.tr(), - list[index].sHTACTUALSTARTTIME.toString()), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.actualSwipeEnd.tr(), - list[index].sHTACTUALENDTIME.toString()), - ItemDetailViewCol(LocaleKeys.approvedSwipeStart.tr(), - list[index].aPPROVEDSTARTTIME.toString()), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.approvedSwipeStartReason.tr(), - list[index].aPPROVEDSTARTREASON.toString()), - ItemDetailViewCol(LocaleKeys.approvedSwipeEnd.tr(), ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.approvedSwipeEndReason.tr(), - list[index].aPPROVEDENDREASONDESC.toString()), - Container(), - isItLast: true, - ), - ], - ).objectContainerView(), + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), + list[index].eMPLOYEENUMBER.toString()), + ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), + list[index].aSSIGNMENTNUMBER.toString()), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.employeeName.tr(), + list[index].eMPLOYEENAME.toString()), + ItemDetailViewCol( + LocaleKeys.scheduleDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( + list[index].sCHEDULEDATE.toString()), + false)), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.shiftType.tr(), + list[index].sHTTYPEDESC.toString()), + ItemDetailViewCol( + LocaleKeys.shift.tr(), list[index].sHTNAME.toString()), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.breakText.tr(), + list[index].bREAKNAME.toString()), + ItemDetailViewCol(LocaleKeys.actualSwipeStart.tr(), + list[index].sHTACTUALSTARTTIME.toString()), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.actualSwipeEnd.tr(), + list[index].sHTACTUALENDTIME.toString()), + ItemDetailViewCol(LocaleKeys.approvedSwipeStart.tr(), + list[index].aPPROVEDSTARTTIME.toString()), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.approvedSwipeStartReason.tr(), + list[index].aPPROVEDSTARTREASON.toString()), + ItemDetailViewCol(LocaleKeys.approvedSwipeEnd.tr(), ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.approvedSwipeEndReason.tr(), + list[index].aPPROVEDENDREASONDESC.toString()), + Container(), + isItLast: true, + ), + ], + ).objectContainerView(), separatorBuilder: (BuildContext cxt, int index) => 1.height.paddingOnly(top: 8, bottom: 8), itemCount: list.length); @@ -316,27 +316,27 @@ class InfoFragment extends StatelessWidget { shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (BuildContext cxt, int index) => Column( - mainAxisSize: MainAxisSize.min, - children: [ - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), - list[index].eMPLOYEENUMBER.toString()), - ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), - list[index].aSSIGNMENTNUMBER.toString()), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeName.tr(), - list[index].eMPLOYEENAME.toString()), - ItemDetailViewCol( - LocaleKeys.scheduleDate.tr(), - DateUtil.formatDateToDate( - DateUtil.convertStringToDate( - list[index].sCHEDULEDATE.toString()), - false)), - isItLast: true, - ), - ], - ).objectContainerView(), + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), + list[index].eMPLOYEENUMBER.toString()), + ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), + list[index].aSSIGNMENTNUMBER.toString()), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.employeeName.tr(), + list[index].eMPLOYEENAME.toString()), + ItemDetailViewCol( + LocaleKeys.scheduleDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( + list[index].sCHEDULEDATE.toString()), + false)), + isItLast: true, + ), + ], + ).objectContainerView(), separatorBuilder: (BuildContext cxt, int index) => 1.height.paddingOnly(top: 8, bottom: 8), itemCount: list.length); @@ -347,48 +347,48 @@ class InfoFragment extends StatelessWidget { shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (BuildContext cxt, int index) => Column( - mainAxisSize: MainAxisSize.min, - children: [ - ItemDetailGrid( - ItemDetailViewCol( - LocaleKeys.operatingUnit.tr(), - itemCreationHeader[index].oPERATINGUNIT?.toString() ?? - ""), - ItemDetailViewCol(LocaleKeys.category.tr(), - itemCreationHeader[index].cATEGORY?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.requester.tr(), - itemCreationHeader[index].rEQUESTER?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.analyzedBy.tr(), - itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.approvedDate.tr(), - itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.itemType.tr(), - itemCreationHeader[index].iTEMTYPE?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.relatedTo.tr(), - itemCreationHeader[index].rELATEDTO?.toString() ?? ""), - ItemDetailViewCol( - LocaleKeys.requestDate.tr(), - DateUtil.formatDateToDate( - DateUtil.convertStringToDate( - itemCreationHeader[index].rEQUESTDATE.toString()), - false)), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.analyzedDate.tr(), - itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""), - ItemDetailViewCol( - LocaleKeys.urgent.tr(), - itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? - ""), - ), - ], - ).objectContainerView(), + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.operatingUnit.tr(), + itemCreationHeader[index].oPERATINGUNIT?.toString() ?? + ""), + ItemDetailViewCol(LocaleKeys.category.tr(), + itemCreationHeader[index].cATEGORY?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.requester.tr(), + itemCreationHeader[index].rEQUESTER?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.analyzedBy.tr(), + itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.approvedDate.tr(), + itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.itemType.tr(), + itemCreationHeader[index].iTEMTYPE?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.relatedTo.tr(), + itemCreationHeader[index].rELATEDTO?.toString() ?? ""), + ItemDetailViewCol( + LocaleKeys.requestDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( + itemCreationHeader[index].rEQUESTDATE.toString()), + false)), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.analyzedDate.tr(), + itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""), + ItemDetailViewCol( + LocaleKeys.urgent.tr(), + itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? + ""), + ), + ], + ).objectContainerView(), separatorBuilder: (BuildContext cxt, int index) => 18.height, itemCount: itemCreationHeader.length); } @@ -401,7 +401,7 @@ class InfoFragment extends StatelessWidget { physics: const NeverScrollableScrollPhysics(), itemBuilder: (BuildContext cxt, int index) { List dataList = - list.isEmpty ? [] : (list[index].collectionNotification ?? []); + list.isEmpty ? [] : (list[index].collectionNotification ?? []); dataList = dataList .where((CollectionNotificationEit o) => o.displayFlag == "Y") .toList(); @@ -416,15 +416,15 @@ class InfoFragment extends StatelessWidget { physics: const NeverScrollableScrollPhysics(), itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem( - index, - dataList[index].segmentPrompt, - dataList[index].segmentValueDsp, - isNeedToShowEmptyDivider: (dataList.length == index + 1) - ? isOdd + index, + dataList[index].segmentPrompt, + dataList[index].segmentValueDsp, + isNeedToShowEmptyDivider: (dataList.length == index + 1) + ? isOdd ? true : false - : false, - ), + : false, + ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, childAspectRatio: (itemWidth / itemHeight), @@ -453,8 +453,8 @@ class InfoFragment extends StatelessWidget { list[index].proposedPhoneNumber ?? "", isNeedToShowEmptyDivider: (list.length == index + 1) ? isOdd - ? true - : false + ? true + : false : false, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( @@ -490,8 +490,8 @@ class InfoFragment extends StatelessWidget { list[index].segmentValueDsp, isNeedToShowEmptyDivider: (list.length == index + 1) ? isOdd - ? true - : false + ? true + : false : false, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( @@ -518,7 +518,7 @@ class InfoFragment extends StatelessWidget { physics: const NeverScrollableScrollPhysics(), itemBuilder: (BuildContext cxt, int index) { List dataList = - list.isEmpty ? [] : (list[index].collectionNotification ?? []); + list.isEmpty ? [] : (list[index].collectionNotification ?? []); dataList = dataList .where((CollectionNotificationAbsence o) => o.dISPLAYFLAG == "Y") .toList(); @@ -534,31 +534,31 @@ class InfoFragment extends StatelessWidget { physics: const NeverScrollableScrollPhysics(), itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem( - index, - dataList[index].sEGMENTPROMPT, - dataList[index].sEGMENTVALUEDSP, - isNeedToShowEmptyDivider: (dataList.length == index + 1) - ? isOdd + index, + dataList[index].sEGMENTPROMPT, + dataList[index].sEGMENTVALUEDSP, + isNeedToShowEmptyDivider: (dataList.length == index + 1) + ? isOdd ? true : false - : false, - ), + : false, + ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, childAspectRatio: (itemWidth / itemHeight), ), ).objectContainerView(); return ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (BuildContext cxt, int index) => - dataList[index].dISPLAYFLAG == "Y" - ? ItemDetailViewCol(dataList[index].sEGMENTPROMPT!, - dataList[index].sEGMENTVALUEDSP!) - : Container(), - separatorBuilder: (BuildContext cxt, int index) => - dataList[index].dISPLAYFLAG == "Y" ? 4.height : 0.height, - itemCount: dataList.length) + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (BuildContext cxt, int index) => + dataList[index].dISPLAYFLAG == "Y" + ? ItemDetailViewCol(dataList[index].sEGMENTPROMPT!, + dataList[index].sEGMENTVALUEDSP!) + : Container(), + separatorBuilder: (BuildContext cxt, int index) => + dataList[index].dISPLAYFLAG == "Y" ? 4.height : 0.height, + itemCount: dataList.length) .objectContainerView(); }, separatorBuilder: (BuildContext cxt, int index) => 12.height, @@ -572,9 +572,9 @@ class InfoFragment extends StatelessWidget { children: [ getPrNotificationBodyList.pINFORMATION != null ? getPrNotificationBodyList.pINFORMATION - .toString() - .toText14(color: MyColors.textMixColor) - .objectContainerView() + .toString() + .toText14(color: MyColors.textMixColor) + .objectContainerView() : Container(), 12.height, Column( @@ -625,11 +625,11 @@ class InfoFragment extends StatelessWidget { getAddressNotificationBodyList[index].sEGMENTPROMPT, getAddressNotificationBodyList[index].sEGMENTVALUEDSP, isNeedToShowEmptyDivider: - (getAddressNotificationBodyList.length == index + 1) - ? isOdd - ? true - : false - : false, + (getAddressNotificationBodyList.length == index + 1) + ? isOdd + ? true + : false + : false, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, @@ -658,11 +658,11 @@ class InfoFragment extends StatelessWidget { getterminationNotificationBodyList[index].sEGMENTPROMPT, getterminationNotificationBodyList[index].sEGMENTVALUEDSP, isNeedToShowEmptyDivider: - (getterminationNotificationBodyList.length == index + 1) - ? isOdd - ? true - : false - : false, + (getterminationNotificationBodyList.length == index + 1) + ? isOdd + ? true + : false + : false, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, @@ -702,11 +702,11 @@ class InfoFragment extends StatelessWidget { data.contactNotificationBody![index].segmentPrompt, data.contactNotificationBody![index].segmentValueDsp, isNeedToShowEmptyDivider: - (data.contactNotificationBody!.length == index + 1) - ? isOdd - ? true - : false - : false, + (data.contactNotificationBody!.length == index + 1) + ? isOdd + ? true + : false + : false, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, @@ -730,7 +730,7 @@ class InfoFragment extends StatelessWidget { GetPaymentNotificationBodyList? data) { return Column( children: [ - 12.height, + 12.height, if (data!.paymentDetailsList!.isNotEmpty) Column( children: [ @@ -739,54 +739,61 @@ class InfoFragment extends StatelessWidget { ItemDetailViewCol( LocaleKeys.requestNumber.tr(), data.paymentDetailsList![0].requestNumber ?? ""), ItemDetailViewCol( LocaleKeys.requesterEmpNum.tr(), - data.paymentDetailsList![0].requesterEmployeeName ?? ""), + data.paymentDetailsList![0].requesterEmployeeNumber ?? ""), ), ItemDetailGrid( ItemDetailViewCol( LocaleKeys.requestDate.tr(), - DateUtil.formatDateToDate( - DateUtil.convertStringToDate(data.paymentDetailsList![0].requestDate!), false) ?? ""), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate(data.paymentDetailsList![0].requestDate!), false) ?? ""), ItemDetailViewCol( LocaleKeys.requesterEmpName.tr(), data.paymentDetailsList![0].requesterEmployeeName ?? ""), ), ItemDetailGrid( - ItemDetailViewCol( LocaleKeys.prepareEmpName.tr(), - data.paymentDetailsList![0].prepareEmployeeName ?? ""), + ItemDetailViewCol( LocaleKeys.prepareEmpNum.tr(), + data.paymentDetailsList![0].prepareEmployeeNumber ?? ""), ItemDetailViewCol( LocaleKeys.requesterPositionName.tr(), data.paymentDetailsList![0].requesterPositionName ?? ""), ), ItemDetailGrid( - ItemDetailViewCol( LocaleKeys.preparePositionName.tr(), - data.paymentDetailsList![0].preparePositionName ?? ""), + ItemDetailViewCol( LocaleKeys.prepareEmpName.tr(), + data.paymentDetailsList![0].prepareEmployeeName ?? ""), ItemDetailViewCol( LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""), ), + ItemDetailGrid( + ItemDetailViewCol( LocaleKeys.preparePositionName.tr(), + data.paymentDetailsList![0].preparePositionName ?? ""), + ItemDetailViewCol( LocaleKeys.requesterOperatingUnit.tr(), + data.paymentDetailsList![0].requesterOperatingUnits ?? "") + ), + ], ).objectContainerView(), if (data!.paymentDetailsList!.isNotEmpty) - Column( - children: [ - LocaleKeys.general.tr().toText14(color: MyColors.textMixColor), - ItemDetailGrid( - ItemDetailViewCol( - LocaleKeys.payingORGName.tr(), data.paymentDetailsList![0].payingOrganizationName ?? ""), - ItemDetailViewCol(LocaleKeys.requestAmount.tr(), - data.paymentDetailsList![0].requestAmount ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.paymentMethodName.tr(), - data.paymentDetailsList![0].paymentMethodName ?? ""), - ItemDetailViewCol( - LocaleKeys.currency.tr(), data.paymentDetailsList![0].currency ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.typeofPayment.tr(), - data.paymentDetailsList![0].typeOfPayment ?? ""), - ItemDetailViewCol( - LocaleKeys.paymentDetails.tr(), data.paymentDetailsList![0].paymentDetails ?? ""), - ), + Column( + children: [ + LocaleKeys.general.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.payingORGName.tr(), data.paymentDetailsList![0].payingOrganizationName ?? ""), + ItemDetailViewCol(LocaleKeys.requestAmount.tr(), + data.paymentDetailsList![0].requestAmount ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.paymentMethodName.tr(), + data.paymentDetailsList![0].paymentMethodName ?? ""), + ItemDetailViewCol( + LocaleKeys.currency.tr(), data.paymentDetailsList![0].currency ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.typeofPayment.tr(), + data.paymentDetailsList![0].typeOfPayment ?? ""), + ItemDetailViewCol( + LocaleKeys.paymentDetails.tr(), data.paymentDetailsList![0].paymentDetails ?? ""), + ), - ], - ).objectContainerView(), + ], + ).objectContainerView(), if (data!.beneficieryList!.isNotEmpty) Column( @@ -839,10 +846,65 @@ class InfoFragment extends StatelessWidget { ItemDetailGrid( ItemDetailViewCol(LocaleKeys.supplierNo.tr(), data.purchaseOrdersList![0].supplierNumber?? ""), - Container(), + Container(), ), ], ).objectContainerView(), + + if (data!.supplierInformationList!.isNotEmpty && data.supplierInformationList![0].supplierNumber !="") + Column( + children: [ + LocaleKeys.supplierInfo.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.supplierNo.tr(), data.supplierInformationList![0].supplierNumber ?? ""), + ItemDetailViewCol(LocaleKeys.supplierName.tr(), + data.supplierInformationList![0].supplierName.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.supplierAcNo.tr(), + data.supplierInformationList![0].supplierBankAccountNumber ?? ""), + ItemDetailViewCol( + LocaleKeys.supplierAcName.tr(), data.supplierInformationList![0].supplierBankAccountName ?? + "" ), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.supplierCRNo.tr(), + data.supplierInformationList![0].crNumber?? ""), + ItemDetailViewCol( LocaleKeys.supplierIBAN.tr(), data.supplierInformationList![0].supplierBankIban ?? + "" ), + ), + + ], + ).objectContainerView(), + // + if (data!.refundInvoiceList!.isNotEmpty && data.refundInvoiceList![0].patientNumber !="" ) + Column( + children: [ + LocaleKeys.patientRefundInvoice.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.patientNumber.tr(), data.refundInvoiceList![0].patientNumber?? ""), + ItemDetailViewCol(LocaleKeys.hospitalClinic.tr(), + data.refundInvoiceList![0].hospitalClinic.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.patientName.tr(), + data.refundInvoiceList![0].patientName ?? ""), + ItemDetailViewCol( + LocaleKeys.amount.tr(), data.refundInvoiceList![0].amount.toString() ?? + "" ), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.invoiceDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( data.refundInvoiceList![0].invoicedDate), false)?? ""), + ItemDetailViewCol( LocaleKeys.refundInvoice.tr(), data.refundInvoiceList![0].invoiceNumber ?? + "" ), + ), + + ], + ).objectContainerView(), ], ); } From b06fb6345ad6979fc459b7ed56a698d869f6d692 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 12 Nov 2024 16:30:34 +0300 Subject: [PATCH 03/39] actions & attachment api response overlapping other request responses. fixed. --- lib/generated_plugin_registrant.dart | 4 +- lib/ui/work_list/worklist_detail_screen.dart | 297 +++++++------------ 2 files changed, 104 insertions(+), 197 deletions(-) diff --git a/lib/generated_plugin_registrant.dart b/lib/generated_plugin_registrant.dart index b59eec2..213926c 100644 --- a/lib/generated_plugin_registrant.dart +++ b/lib/generated_plugin_registrant.dart @@ -13,7 +13,7 @@ import 'package:firebase_core_web/firebase_core_web.dart'; import 'package:firebase_messaging_web/firebase_messaging_web.dart'; import 'package:fluttertoast/fluttertoast_web.dart'; import 'package:geolocator_web/geolocator_web.dart'; -import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; +// import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; import 'package:image_picker_for_web/image_picker_for_web.dart'; import 'package:just_audio_web/just_audio_web.dart'; // import 'package:record_web/record_web.dart'; @@ -32,7 +32,7 @@ void registerPlugins(Registrar registrar) { FirebaseMessagingWeb.registerWith(registrar); FluttertoastWebPlugin.registerWith(registrar); GeolocatorPlugin.registerWith(registrar); - GoogleMapsPlugin.registerWith(registrar); + // GoogleMapsPlugin.registerWith(registrar); ImagePickerPlugin.registerWith(registrar); JustAudioPlugin.registerWith(registrar); //RecordPluginWeb.registerWith(registrar); diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 06e7501..ee595d1 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -23,6 +23,7 @@ import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_mod import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart'; +import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart'; import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart'; import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart'; @@ -45,7 +46,6 @@ import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dart'; import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; -import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart'; class WorkListDetailScreen extends StatefulWidget { WorkListDetailScreen({Key? key}) : super(key: key); @@ -70,19 +70,16 @@ class _WorkListDetailScreenState extends State { List getStampMsNotifications = []; List getStampNsNotifications = []; List getMoNotificationBodyList = []; - List getNotificationRespondAttributes = - []; + List getNotificationRespondAttributes = []; NotificationGetRespondAttributesList? notificationNoteInput; List getRFCEmployeeList = []; //HR Details Screen Requests - List? - getEitCollectionNotificationBodyList = []; + List? getEitCollectionNotificationBodyList = []; List? getPhonesNotificationBodyList = []; List? getBasicDetNtfBodyList = []; - List? - getAbsenceCollectionNotificationBodyList = []; + List? getAbsenceCollectionNotificationBodyList = []; GetContactNotificationBodyList? getContactNotificationBodyList; List? getAddressNotificationBodyList = []; List? getTerminationNotificationBodyList = []; @@ -133,8 +130,7 @@ class _WorkListDetailScreenState extends State { getContactNotificationBodyList = null; getAddressNotificationBodyList!.clear(); getPaymentNotificationBodyList = null; - if (workListData!.iTEMTYPE == "HRSSA" || - workListData!.iTEMTYPE == "STAMP") { + if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { getUserInformation(); } @@ -191,8 +187,7 @@ class _WorkListDetailScreenState extends State { void getDataFromState() { if (workListData == null) { - workListData = AppState().workList![AppState() - .workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; + workListData = AppState().workList![AppState().workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; getData(); } } @@ -225,8 +220,7 @@ class _WorkListDetailScreenState extends State { Column( children: [ Container( - padding: const EdgeInsets.only( - left: 21, right: 21, top: 16, bottom: 16), + padding: const EdgeInsets.only(left: 21, right: 21, top: 16, bottom: 16), decoration: const BoxDecoration( borderRadius: BorderRadius.only( bottomLeft: Radius.circular(25), @@ -245,19 +239,13 @@ class _WorkListDetailScreenState extends State { child: Row( children: [ myTab(LocaleKeys.info.tr(), 0), - (workListData!.iTEMTYPE == "HRSSA" || - workListData!.iTEMTYPE == "STAMP") - ? myTab(LocaleKeys.details.tr(), 1) - : myTab(LocaleKeys.request.tr(), 1), + (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") ? myTab(LocaleKeys.details.tr(), 1) : myTab(LocaleKeys.request.tr(), 1), myTab(LocaleKeys.actions.tr(), 2), myTab(LocaleKeys.attachments.tr(), 3), ], ), ), - if ((workListData?.sUBJECT ?? "").isNotEmpty) - workListData!.sUBJECT! - .toText14() - .paddingOnly(top: 20, right: 21, left: 21), + if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21), PageView( controller: controller, onPageChanged: (int pageIndex) { @@ -269,38 +257,26 @@ class _WorkListDetailScreenState extends State { InfoFragment( poHeaderList: getPoNotificationBody?.pOHeader ?? [], workListData: workListData, - itemCreationHeader: - getItemCreationNtfBody?.itemCreationHeader ?? [], + itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [], getStampMsNotifications: getStampMsNotifications, getStampNsNotifications: getStampNsNotifications, - getEitCollectionNotificationBodyList: - getEitCollectionNotificationBodyList, - getPhonesNotificationBodyList: - getPhonesNotificationBodyList, + getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, + getPhonesNotificationBodyList: getPhonesNotificationBodyList, getBasicDetNtfBodyList: getBasicDetNtfBodyList, - getAddressNotificationBodyList: - getAddressNotificationBodyList, - getAbsenceCollectionNotificationBodyList: - getAbsenceCollectionNotificationBodyList, - getContactNotificationBodyList: - getContactNotificationBodyList, + getAddressNotificationBodyList: getAddressNotificationBodyList, + getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList, + getContactNotificationBodyList: getContactNotificationBodyList, getPrNotificationBodyList: getPrNotificationBody, - getTerminationNotificationBodyList: - getTerminationNotificationBodyList, - getPaymentNotificationBodyList: - getPaymentNotificationBodyList, + getTerminationNotificationBodyList: getTerminationNotificationBodyList, + getPaymentNotificationBodyList: getPaymentNotificationBodyList, ), - (workListData!.iTEMTYPE == "HRSSA" || - workListData!.iTEMTYPE == "STAMP" || workListData!.iTEMTYPE == "PAY_REQ") - ? DetailFragment( - workListData, memberInformationListModel) + (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP" || workListData!.iTEMTYPE == "PAY_REQ") + ? DetailFragment(workListData, memberInformationListModel) : RequestFragment( moNotificationBodyList: getMoNotificationBodyList, poLinesList: getPoNotificationBody?.pOLines ?? [], - itemCreationLines: - getItemCreationNtfBody?.itemCreationLines ?? [], + itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [], prLinesList: getPrNotificationBody?.pRLines ?? [], - ), isActionHistoryLoaded ? actionHistoryList.isEmpty @@ -320,13 +296,11 @@ class _WorkListDetailScreenState extends State { ).expanded, if (isApproveAvailable || isRejectAvailable || isCloseAvailable) Container( - padding: const EdgeInsets.only( - top: 14, bottom: 14, left: 21, right: 21), + 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), + top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0), ), ), child: Row( @@ -335,29 +309,20 @@ class _WorkListDetailScreenState extends State { DefaultButton( LocaleKeys.reject.tr(), () => performAction(rejectAction), - colors: const [ - Color(0xffE47A7E), - Color(0xffDE6D71) - ], + colors: const [Color(0xffE47A7E), Color(0xffDE6D71)], ).expanded, if (isApproveAvailable && isRejectAvailable) 8.width, if (isApproveAvailable) DefaultButton( LocaleKeys.approve.tr(), () => performAction(approveAction), - colors: const [ - Color(0xff28C884), - Color(0xff1BB271) - ], + colors: const [Color(0xff28C884), Color(0xff1BB271)], ).expanded, if (isCloseAvailable) DefaultButton( LocaleKeys.ok.tr(), () => performAction("CLOSE"), - colors: const [ - Color(0xff32D892), - Color(0xff1AB170) - ], + colors: const [Color(0xff32D892), Color(0xff1AB170)], ).expanded, 8.width, Container( @@ -367,11 +332,7 @@ class _WorkListDetailScreenState extends State { shape: BoxShape.circle, color: MyColors.lightGreyE6Color, ), - child: Icon( - showFabOptions - ? Icons.more_vert_rounded - : Icons.more_horiz_rounded, - color: MyColors.darkIconColor), + child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), ).onPress(() { setState(() { showFabOptions = true; @@ -388,8 +349,7 @@ class _WorkListDetailScreenState extends State { opacity: showFabOptions ? 1 : 0, duration: const Duration(milliseconds: 250), child: Container( - padding: const EdgeInsets.only( - left: 21, right: 21, bottom: 75 - 12), + padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75 - 12), width: double.infinity, height: double.infinity, color: Colors.white.withOpacity(.67), @@ -398,19 +358,15 @@ class _WorkListDetailScreenState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg") - .onPress(() { - if (AppState().workList!.length - 1 > - AppState().workListIndex!) { + myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() { + if (AppState().workList!.length - 1 > AppState().workListIndex!) { animationIndex = animationIndex + 1; - AppState().setWorkListIndex = - AppState().workListIndex! + 1; + AppState().setWorkListIndex = AppState().workListIndex! + 1; workListData = null; showFabOptions = false; tabIndex = 0; getDataFromState(); - } else if (AppState().workList!.length - 1 == - AppState().workListIndex!) { + } else if (AppState().workList!.length - 1 == AppState().workListIndex!) { Navigator.pop(context); } }), @@ -428,31 +384,25 @@ class _WorkListDetailScreenState extends State { ], ), ), - floatingActionButton: - (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable) - ? 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) + ? 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, ); } - List viewApiButtonsList( - List notificationButtonsList) { + List viewApiButtonsList(List notificationButtonsList) { List fabs = []; for (int i = 0; i < notificationButtonsList.length; i++) { if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || @@ -466,9 +416,7 @@ class _WorkListDetailScreenState extends State { notificationButtonsList[i].bUTTONLABEL!, getActionImage(notificationButtonsList[i].bUTTONACTION!), isIconAsset: true, - ) - .paddingOnly(bottom: 12) - .onPress(() => handleFabAction(notificationButtonsList[i]))); + ).paddingOnly(bottom: 12).onPress(() => handleFabAction(notificationButtonsList[i]))); } return fabs; } @@ -547,8 +495,7 @@ class _WorkListDetailScreenState extends State { )); break; case "ANSWER_INFO": - performAction(notificationButton.bUTTONACTION!, - title: notificationButton.bUTTONLABEL); + performAction(notificationButton.bUTTONACTION!, title: notificationButton.bUTTONLABEL); break; case "RFC": getRFCEmployeeListFunc(); @@ -568,31 +515,21 @@ class _WorkListDetailScreenState extends State { callBackFunc: reloadWorkList, child: UpdateContinueSheet( workListData: workListData, - getEitCollectionNotificationBodyList: - getEitCollectionNotificationBodyList, - dynamicParams: DynamicListViewParams( - workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, - isUpdate: true, - collectionNotificationList: - getEitCollectionNotificationBodyList![0] - .collectionNotification)), + getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, + dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, + isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), ); break; case "CONTINUE_ACTION": showMyBottomSheet( context, - type:"CONTINUE_ACTION", + type: "CONTINUE_ACTION", callBackFunc: reloadWorkList, child: UpdateContinueSheet( workListData: workListData, - getEitCollectionNotificationBodyList: - getEitCollectionNotificationBodyList, - dynamicParams: DynamicListViewParams( - workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, - isUpdate: true, - collectionNotificationList: - getEitCollectionNotificationBodyList![0] - .collectionNotification)), + getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, + dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, + isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), ); break; case "APPROVE_AND_FORWARD": @@ -604,8 +541,7 @@ class _WorkListDetailScreenState extends State { notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList, callBackFunc: reloadWorkList, - getNotificationRespondAttributes: - getNotificationRespondAttributes, + getNotificationRespondAttributes: getNotificationRespondAttributes, )); break; case "FORWARD": @@ -617,8 +553,7 @@ class _WorkListDetailScreenState extends State { notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList, callBackFunc: reloadWorkList, - getNotificationRespondAttributes: - getNotificationRespondAttributes, + getNotificationRespondAttributes: getNotificationRespondAttributes, )); break; case "DEL": @@ -639,8 +574,7 @@ class _WorkListDetailScreenState extends State { void getRFCEmployeeListFunc() async { try { Utils.showLoading(context); - getRFCEmployeeList = await WorkListApiClient() - .getRFCEmployeeeList(workListData!.nOTIFICATIONID!); + getRFCEmployeeList = await WorkListApiClient().getRFCEmployeeeList(workListData!.nOTIFICATIONID!); Utils.hideLoading(context); actionHistoryList.last.sEQUENCE = getRFCEmployeeList[0].sEQ; showMyBottomSheet(context, @@ -660,8 +594,7 @@ class _WorkListDetailScreenState extends State { } } - Future performNetworkCall(BuildContext context, - {String? email, String? userId}) async { + Future performNetworkCall(BuildContext context, {String? email, String? userId}) async { showDialog( context: context, builder: (BuildContext cxt) => ConfirmDialog( @@ -671,12 +604,7 @@ class _WorkListDetailScreenState extends State { Navigator.pop(cxt); Utils.showLoading(context); try { - await WorkListApiClient().submitComment( - comment: "", - email: email, - userId: userId, - notificationId: workListData!.nOTIFICATIONID, - apiMode: "REJECT"); + await WorkListApiClient().submitComment(comment: "", email: email, userId: userId, notificationId: workListData!.nOTIFICATIONID, apiMode: "REJECT"); Utils.hideLoading(context); Navigator.pop(context, "delegate_reload"); } catch (ex) { @@ -694,9 +622,7 @@ class _WorkListDetailScreenState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ - title.toText12( - color: isSelected ? Colors.white : Colors.white.withOpacity(.74), - isCenter: true), + title.toText12(color: isSelected ? Colors.white : Colors.white.withOpacity(.74), isCenter: true), 4.height, Container( height: 8, @@ -764,10 +690,7 @@ class _WorkListDetailScreenState extends State { for (var element in getNotificationRespondAttributes!) { responseAttribute.add({ "ATTRIBUTE_NAME": element!.attributeName, - if (element!.attributeType == "number") - "ATTRIBUTE_NUMBER_VALUE": note - else if (element!.attributeType == "VARCHAR2") - "ATTRIBUTE_TEXT_VALUE": note + if (element!.attributeType == "number") "ATTRIBUTE_NUMBER_VALUE": note else if (element!.attributeType == "VARCHAR2") "ATTRIBUTE_TEXT_VALUE": note }); } @@ -780,11 +703,15 @@ class _WorkListDetailScreenState extends State { "RespondAttributeList": responseAttribute, }; - if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE" || actionMode == "ANSWER_INFO" || actionMode == "RFC" || actionMode == "TRY_APPROVE_AGAIN" || actionMode == "SEND_BACK_TO_PREPARER") { - + if (actionMode == "APPROVED" || + actionMode == "APPROVE" || + actionMode == "CLOSE" || + actionMode == "ANSWER_INFO" || + actionMode == "RFC" || + actionMode == "TRY_APPROVE_AGAIN" || + actionMode == "SEND_BACK_TO_PREPARER") { performNotificationAction(payload); - } else if (note.isNotEmpty && - (actionMode != "APPROVED" || actionMode != "APPROVE")) { + } else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) { performNotificationAction(payload); } else { Utils.showToast(LocaleKeys.pleaseEnterComments.tr()); @@ -797,8 +724,7 @@ class _WorkListDetailScreenState extends State { void performNotificationAction(Map payload) async { try { Utils.showLoading(context); - GenericResponseModel model = - await WorkListApiClient().postNotificationActions(payload); + GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload); Utils.hideLoading(context); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); animationIndex = animationIndex + 1; @@ -839,8 +765,7 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getEitCollectionNotificationBodyList!.clear(); - getEitCollectionNotificationBodyList = await WorkListApiClient() - .GetEitNotificationBody(workListData!.nOTIFICATIONID); + getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -858,8 +783,7 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; memberInformationListModel = null; - memberInformationListModel = await WorkListApiClient() - .getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); + memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -877,8 +801,7 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getPhonesNotificationBodyList!.clear(); - getPhonesNotificationBodyList = await WorkListApiClient() - .getPhonesNotificationBodyList(workListData!.nOTIFICATIONID); + getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -896,8 +819,7 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getBasicDetNtfBodyList!.clear(); - getBasicDetNtfBodyList = await WorkListApiClient() - .getBasicDetNtfBodyList(workListData!.nOTIFICATIONID); + getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -915,8 +837,7 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getAbsenceCollectionNotificationBodyList!.clear(); - getAbsenceCollectionNotificationBodyList = await WorkListApiClient() - .getAbsenceNotificationBody(workListData!.nOTIFICATIONID); + getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -933,8 +854,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getContactNotificationBodyList = await WorkListApiClient() - .getContactNotificationBodyList(workListData!.nOTIFICATIONID); + getContactNotificationBodyList = await WorkListApiClient().getContactNotificationBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -951,8 +871,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getAddressNotificationBodyList = await WorkListApiClient() - .getAddressNotificationBodyList(workListData!.nOTIFICATIONID); + getAddressNotificationBodyList = await WorkListApiClient().getAddressNotificationBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -968,8 +887,7 @@ class _WorkListDetailScreenState extends State { void getTerminationNotificationBody() async { try { if (apiCallCount == 0) apiCallCount++; - getTerminationNotificationBodyList = await WorkListApiClient() - .getTerminationNotificationBodyList(workListData!.nOTIFICATIONID); + getTerminationNotificationBodyList = await WorkListApiClient().getTerminationNotificationBodyList(workListData!.nOTIFICATIONID); Utils.hideLoading(context); apiCallCount--; if (apiCallCount == 0) { @@ -987,11 +905,9 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; if (workListData!.rEQUESTTYPE == "STAMP_MS") { - getStampMsNotifications = await WorkListApiClient() - .getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999); + getStampMsNotifications = await WorkListApiClient().getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999); } else { - getStampNsNotifications = await WorkListApiClient() - .getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999); + getStampNsNotifications = await WorkListApiClient().getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999); } apiCallCount--; if (apiCallCount == 0) { @@ -1009,8 +925,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getMoNotificationBodyList = await WorkListApiClient() - .getMoNotificationBody(workListData!.nOTIFICATIONID!, -999); + getMoNotificationBodyList = await WorkListApiClient().getMoNotificationBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -1027,8 +942,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getItemCreationNtfBody = await WorkListApiClient() - .getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999); + getItemCreationNtfBody = await WorkListApiClient().getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -1045,8 +959,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getPoNotificationBody = await WorkListApiClient() - .getPoNotificationBody(workListData!.nOTIFICATIONID!, -999); + getPoNotificationBody = await WorkListApiClient().getPoNotificationBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -1063,8 +976,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getPrNotificationBody = await WorkListApiClient() - .getPRNotificationBody(workListData!.nOTIFICATIONID!, -999); + getPrNotificationBody = await WorkListApiClient().getPRNotificationBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -1081,8 +993,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getPaymentNotificationBodyList = await WorkListApiClient() - .getPaymentNotificationBody(workListData!.nOTIFICATIONID!, -999); + getPaymentNotificationBodyList = await WorkListApiClient().getPaymentNotificationBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -1100,8 +1011,7 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getNotificationRespondAttributes.clear(); - getNotificationRespondAttributes = await WorkListApiClient() - .notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); + getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); if (getNotificationRespondAttributes.isNotEmpty) { notificationNoteInput = getNotificationRespondAttributes.first; } @@ -1122,25 +1032,18 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; notificationButtonsList.clear(); - notificationButtonsList = await WorkListApiClient() - .getNotificationButtons(workListData!.nOTIFICATIONID!); + notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!); if (notificationButtonsList.isNotEmpty) { - isCloseAvailable = notificationButtonsList.any( - (GetNotificationButtonsList element) => - element.bUTTONACTION == "CLOSE"); - isApproveAvailable = - notificationButtonsList.any((GetNotificationButtonsList element) { - if (element.bUTTONACTION == "APPROVED" || - element.bUTTONACTION == "APPROVE") { + isCloseAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "CLOSE"); + isApproveAvailable = notificationButtonsList.any((GetNotificationButtonsList element) { + if (element.bUTTONACTION == "APPROVED" || element.bUTTONACTION == "APPROVE") { approveAction = element.bUTTONACTION!; return true; } return false; }); - isRejectAvailable = - notificationButtonsList.any((GetNotificationButtonsList element) { - if (element.bUTTONACTION == "REJECTED" || - element.bUTTONACTION == "REJECT") { + isRejectAvailable = notificationButtonsList.any((GetNotificationButtonsList element) { + if (element.bUTTONACTION == "REJECTED" || element.bUTTONACTION == "REJECT") { rejectAction = element.bUTTONACTION!; return true; } @@ -1163,8 +1066,10 @@ class _WorkListDetailScreenState extends State { try { isActionHistoryLoaded = false; actionHistoryList.clear(); - actionHistoryList = await WorkListApiClient() - .getActionHistory(workListData!.nOTIFICATIONID!); + List _actionHistoryList = await WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!); + if (!isActionHistoryLoaded) { + actionHistoryList = _actionHistoryList; + } setState(() { isActionHistoryLoaded = true; }); @@ -1177,8 +1082,10 @@ class _WorkListDetailScreenState extends State { try { isAttachmentLoaded = false; getAttachmentList.clear(); - getAttachmentList = await WorkListApiClient() - .getAttachments(workListData!.nOTIFICATIONID!); + List _getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); + if (!isAttachmentLoaded) { + getAttachmentList = _getAttachmentList; + } setState(() { isAttachmentLoaded = true; }); From 5ecb4845a134f2c16f2cbe9e7676ecc76500e632 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 25 Nov 2024 10:23:28 +0300 Subject: [PATCH 04/39] po item history chart and scrollable list view added. --- assets/langs/ar-SA.json | 35 +- assets/langs/en-US.json | 35 +- lib/classes/consts.dart | 4 +- lib/generated/codegen_loader.g.dart | 2327 ++++++++++----------- lib/generated/locale_keys.g.dart | 84 +- lib/ui/work_list/item_history_screen.dart | 241 ++- pubspec.yaml | 1 + 7 files changed, 1458 insertions(+), 1269 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 6370baf..12c1eb7 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -528,7 +528,7 @@ "noWinner": "حزين! لم يفز أحد اليوم.", "myTeam": "فريقي", "youCanPlayDemo": "لكن يمكنك لعب العرض", - "group" : "مجموعة", + "group": "مجموعة", "searchGroup": "مجموعة البحث", "connectHmgWifi": "قم بتوصيل HMG WIFI", "connectedHmgWifi": "اتصال HMG WIFI", @@ -545,19 +545,26 @@ "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "open": "يفتح", - "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", - "prepareEmpNum":"إعداد رقم الموظف", - "supplierInfo" : "معلومات المورد", + "requesterOperatingUnit": "وحدة تشغيل مقدم الطلب", + "prepareEmpNum": "إعداد رقم الموظف", + "supplierInfo": "معلومات المورد", "supplierAcNo": "رقم حساب المورد", "supplierAcName": "اسم حساب المورد", - "supplierIBAN" : "رقم IBAN للمورد", - "supplierCRNo" :"رقم السجل التجاري", - "suppliedAcNo" : "رقم الحساب المقدم", - "patientRefundInvoice" : "فاتورة استرداد الأموال للمريض", - "patientNumber" : "رقم المريض", - "patientName" : "اسم المريض", - "invoiceDate" : "تاريخ الفاتورة", - "refundInvoice" :"فاتورة الاسترجاع", - "hospitalClinic" : "عيادة المستشفى" - + "supplierIBAN": "رقم IBAN للمورد", + "supplierCRNo": "رقم السجل التجاري", + "suppliedAcNo": "رقم الحساب المقدم", + "patientRefundInvoice": "فاتورة استرداد الأموال للمريض", + "patientNumber": "رقم المريض", + "patientName": "اسم المريض", + "invoiceDate": "تاريخ الفاتورة", + "refundInvoice": "فاتورة الاسترجاع", + "hospitalClinic": "عيادة المستشفى", + "graphicalAnalysis": "التحليل الرسومي", + "itemHistoryAnalysis": "تحليل تاريخ العنصر", + "pOno": "امر شراء #", + "oprUnit": "وحدة التشغيل", + "qtyOrdered": "الكمية المطلوبة", + "qtyReceived": "الكمية المستلمة", + "bonusQty": "كمية المكافأة", + "balQty": "كمية التوازن" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 61bba1d..21e53de 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -564,19 +564,26 @@ "addAtLeastOneAttachment": "Please add at least one attachment.", "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", - "requesterOperatingUnit":"Requester Operating Unit", - "prepareEmpNum":"Prepare Employee Num", - "supplierInfo" : "Supplier Information", + "requesterOperatingUnit": "Requester Operating Unit", + "prepareEmpNum": "Prepare Employee Num", + "supplierInfo": "Supplier Information", "supplierAcNo": "Supplier Account No", - "supplierAcName":"Supplier Account Name", - "supplierIBAN" : "Supplier IBAN", - "supplierCRNo" : "CR Number", - "suppliedAcNo" : "Supplied Account No.", - "patientRefundInvoice" : "Patient Refund Invoice", - "patientNumber" : "Patient Number", - "patientName" : "Patient Name", - "invoiceDate" : "Invoice Date", - "refundInvoice" :"Refund Invoice", - "hospitalClinic" : "Hospital Clinic" - + "supplierAcName": "Supplier Account Name", + "supplierIBAN": "Supplier IBAN", + "supplierCRNo": "CR Number", + "suppliedAcNo": "Supplied Account No.", + "patientRefundInvoice": "Patient Refund Invoice", + "patientNumber": "Patient Number", + "patientName": "Patient Name", + "invoiceDate": "Invoice Date", + "refundInvoice": "Refund Invoice", + "hospitalClinic": "Hospital Clinic", + "graphicalAnalysis": "Graphical Analysis", + "itemHistoryAnalysis": "Item History Analysis", + "pOno": "P.O #", + "oprUnit": "Opr. Unit", + "qtyOrdered": "Qty. Ordered", + "qtyReceived": "Qty. Received", + "bonusQty": "Bonus Qty.", + "balQty": "Bal. Qty." } \ No newline at end of file diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 170762c..7103dfd 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // 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://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 diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 357d6eb..aa3ed5c 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -1,1184 +1,1177 @@ // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart -// ignore_for_file: prefer_single_quotes +// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters import 'dart:ui'; import 'package:easy_localization/easy_localization.dart' show AssetLoader; -class CodegenLoader extends AssetLoader { +class CodegenLoader extends AssetLoader{ const CodegenLoader(); @override - Future> load(String fullPath, Locale locale) { + Future?> load(String path, Locale locale) { return Future.value(mapLocales[locale.toString()]); } - static const Map ar_SA = { - "mohemm": "Mohemm", - "english": "English", - "arabic": "عربي", - "login": "تسجيل الدخول", - "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", - "username": "اسم المستخدم", - "password": "كلمة المرور", - "welcomeBack": "مرحبا بعودتك", - "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", - "lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:", - "verificationType": "نوع التحقق:", - "pleaseVerify": "ارجوك تحقق", - "pleaseVerifyForBio": "الرجاء التحقق من تسجيل الدخول باستخدام أحد هذه الخيارات", - "verifyThroughFace": "تحقق من خلال الوجه", - "verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع", - "verifyThroughSMS": "تحقق من خلال الرسائل القصيرة", - "verifyThroughWhatsapp": "تحقق من خلال Whatsapp", - "useAnotherAccount": "استخدم حسابا آخر", - "pleaseEnterTheVerificationCodeSentTo": "الرجاء إدخال رمز التحقق المرسل إلى ", - "theVerificationCodeWillExpireIn": "ستنتهي صلاحية رمز التحقق في ", - "goodMorning": "صباح الخير", - "markAttendance": "علامة الحضور", - "timeLeftToday": "الوقت المتبقي اليوم", - "checkIn": "تحقق في", - "workList": "قائمة العمل", - "leaveBalance": "رصيد الاجازات", - "missingSwipes": "تسجيل بصمة حضور", - "ticketBalance": "رصيد التذكرة", - "other": "آخر", - "services": "خدمات", - "viewAllServices": "عرض جميع الخدمات", - "monthlyAttendance": "الحضور الشهري", - "vacationRule": "قاعدة الاجازات", - "vacationType": "نوع الاجازة", - "startDateT": "تاريخ البدء", - "endDateT": "تاريخ الانتهاء", - "workFromHome": "العمل من المنزل", - "ticketRequest": "طلب تذكرة", - "viewAllOffers": "مشاهدة جميع العروض", - "offers": "عروض & ", - "discounts": "الخصومات", - "newString": "جديد", - "setTheNewPassword": "قم بتعيين كلمة المرور الجديدة", - "typeYourNewPasswordBelow": "اكتب كلمة المرور الجديدة أدناه", - "typeYourNewActiveDirectoryPasswordBelow": "اكتب كلمة مرور الدليل النشط الجديدة أدناه", - "confirmPassword": "تأكيد كلمة المرور", - "update": "تحديث", - "title": "عنوان", - "home": "الرئيسية", - "mySalary": "راتبي", - "createRequest": "إنشاء طلب", - "forgotPassword": "هل نسيت كلمة السر", - "employeeId": "هوية الموظف", - "loginCodeWillSentToMobileNumber": "الرجاء إدخال معرف الموظف الخاص بك ، وسيتم إرسال رمز تسجيل الدخول إلى رقم هاتفك المحمول", - "changePassword": "تغيير كلمة المرور", - "ok": "موافق", - "confirm": "تؤكد", - "passwordChangedSuccessfully": "تم تغيير الرقم السري بنجاح", - "itemsForSale": "سلع للبيع", - "attendanceDetails": "تفاصيل الحضور", - "order": "الطلبات", - "earlyOut": "الخروج مبكرا", - "shortage": "ساعات التقصير", - "excess": "فائض", - "lateIn": "القدوم المتاخر", - "approvedCheckOut": "اعتماد وقت الخروج", - "approvedCheckIn": "اعتماد وقت الدخول", - "actualCheckOut": "وقت الخروج", - "actualCheckIn": "وقت الدخول", - "present": "حضور", - "pres": "حضور", - "shiftTime": "وقت التناوب", - "absent": "غياب", - "attendance": "الحضور", - "scheduleDays": "ايام العمل", - "offDays": "ايام الراحه", - "nonAnalyzed": "لايوجد تحليل", - "shortageHour": "ساعات التقصير", - "stats": "الحاله", - "completed": "تم اكمال", - "msg": "Hello {} in the {} world ", - "msg_named": "{} are written in the {lang} language", - "clickMe": "Click me", - "doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة", - "atLeastOneLowercase": "حرف صغير واحد على الأقل", - "atLeastOneUppercase": "حرف كبير واحد على الأقل", - "atLeastOneNumeric": "رقم واحد على الأقل", - "minimum8Characters": "8 أحرف على الأقل", - "doNotAddRepeatingLetters": "لا تقم بإضافة أحرف متكررة", - "itShouldContainSpecialCharacter": "يجب لا يحتوي على أحرف خاصة", - "confirmPasswordMustMatch": "يجب أن يتطابق تأكيد كلمة المرور", - "sms": "رسالة قصيرة", - "fingerPrint": "بصمة", - "face": "التعرف على الوجه", - "whatsapp": "واتس اب", - "reject": "يرفض", - "approve": "يوافق", - "cancel": "إلغاء", - "requestedItems": "العناصر المطلوبة", - "request": "طلب", - "myRequest": "طلبي", - "actions": "أجراءات", - "delegate": "مندوب", - "request_info": "اطلب معلومات", - "attachments": "المرفقات", - "info": "معلومات", - "employeeNumber": "رقم الموظف", - "assignmentNumber": "رقم الواجب", - "employeeName": "اسم الموظف", - "scheduleDate": "تاريخ الجدول الزمني", - "shiftType": "نوع التحول", - "shift": "يحول", - "breakText": "استراحة", - "actualSwipeStart": "بدء التمرير الفعلي", - "actualSwipeEnd": "التمرير الفعلي للنهاية", - "approvedSwipeStart": "وافق انتقاد البدء", - "approvedSwipeStartReason": "تمت الموافقة على سبب بدء التمرير السريع", - "approvedSwipeEnd": "تمت الموافقة على تمرير النهاية", - "approvedSwipeEndReason": "الموافقة على سبب إنهاء التمرير", - "from": "من", - "to": "ل", - "sent": "أرسلت", - "closed": "مغلق", - "id": "هوية شخصية", - "responder": "المستجيب", - "jobTitle": "عنوان وظيفي", - "grade": "درجة", - "jobCategory": "تصنيف الوظيفة", - "category": "فئة", - "employeeEmailAddress": "عنوان البريد الإلكتروني للموظف", - "payrollBranch": "فرع الرواتب", - "yourChangeHasBeenSavedSuccessfully": "تم حفظ التغيير الخاص بك بنجاح", - "code": "شفرة", - "unit": "وحدة", - "quantity": "كمية", - "dateRequired": "التاريخ مطلوب", - "lineStatus": "حالة الخط", - "statusDate": "تاريخ الحالة", - "transactionType": "نوع المعاملة", - "operatingUnit": "وحدة التشغيل", - "organizationCode": "كود المنظمة", - "organization": "منظمة", - "fromSubInventory": "من الجرد الفرعي", - "fromLocator": "من محدد المواقع", - "toSubInventory": "إلى الجرد الفرعي", - "toLocator": "إلى محدد المواقع", - "shipToLocator": "شحن إلى محدد المواقع", - "itemHistory": "تاريخ العنصر", - "mfg": "مبدع", - "lineType": "نوع الخط", - "price": "السعر", - "lineAmount": "مبلغ الخط", - "lineDiscount": "خصم الخط٪", - "needByDate": "القادمة إلى الأمام", - "promisedDate": "التسجيل وعد", - "deliverToLocation": "تسليم إلى الموقع", - "requisitionNumber": "رقم الطلب", - "requester": "مقدم الطلب", - "quotationAnalysis": "تحليل الاقتباس", - "subject": "موضوعات", - "description": "وصف", - "supplier": "المورد", - "site": "موقع", - "buyer": "مشتر", - "preparer": "معد", - "creationDate": "تاريخ الإنشاء", - "shipToLocation": "الشحن الى الموقع", - "quotationNumber": "رقم الإقتباس", - "quotationDate": "تاريخ الاقتباس", - "paymentTerms": "شروط الدفع", - "currency": "عملة", - "grossAmount": "المبلغ الإجمالي", - "discountAmount": "مقدار الخصم", - "customDuty": "الرسوم الجمركية", - "shipHandle": "مقبض السفينة", - "otherCharges": "رسوم أخرى", - "totalPOAmountWithVAT": "إجمالي مبلغ الشراء مع ضريبة القيمة المضافة", - "totalPOAmountInWords": "إجمالي مبلغ أمر الشراء بالكلمات", - "requestNumber": "رقم الطلب", - "uom": "UOM", - "operatingCode": "كود التشغيل", - "poNumber": "PO عدد", - "revision": "مراجعة", - "quantityOrdered": "الكمية المطلوبة", - "quantityReceived": "الكمية المستلمة", - "bonusQuantity": "كمية المكافأة", - "purchasePrice": "سعر الشراء", - "discountPer": "خصم ٪", - "balanceQuantity": "كمية التوازن", - "netPrice": "السعر الصافي", - "closureStatus": "حالة الإغلاق", - "quotationNetPrice": "صافي سعر الاقتباس", - "quotationUOM": "اقتباس UOM", - "quotationQty": "اقتباس الكمية", - "itemCode": "رمز الصنف", - "vendorName": "اسم البائع", - "quotationMFGPartNumber": "رقم الجزء MFG الاقتباس", - "quotationDeliveryDate": "تاريخ تسليم عرض الأسعار", - "quotationBonusQuantity": "كمية مكافأة الاقتباس", - "quotationLineTotal": "مجموع خط الاقتباس", - "rfqUOM": "RFQ UOM", - "rfqQty": "RFQ الكمية", - "rfqNumber": "رقم RFQ", - "human": "بشري", - "resources": "موارد", - "details": "تفاصيل", - "noDataAvailable": "لا تتوافر بيانات", - "productName": "اسم المنتج", - "productDescription": "وصف المنتج", - "unitPrice": "سعر الوحده", - "manufacturerName": "اسم المصنع", - "manufacturerPartName": "اسم جزء الشركة المصنعة", - "supplierName": "اسم المورد", - "supplierContact": "الاتصال بالمورد", - "chargeToPatient": "المسؤول عن المريض", - "justification": "التبرير", - "itemDescription": "وصف السلعة", - "groupCode": "كود المجموعة", - "primaryUOM": "UOM الابتدائية", - "subgroupDescription": "وصف المجموعة الفرعية", - "subgroupCode": "رمز المجموعة الفرعية", - "groupDescription": "وصف المجموعة", - "templateName": "اسم القالب", - "itemCreationStatus": "حالة إنشاء العنصر", - "standardizationApprovalStatus": "حالة الموافقة على التقييس", - "standardizationApprovalRejectionReason": "سبب رفض الموافقة على التقييس", - "analyzedBy": "تحليل بواسطة", - "approvedDate": "تاريخ الموافقة", - "itemType": "نوع العنصر", - "relatedTo": "متعلق ب", - "requestDate": "تاريخ الطلب", - "analyzedDate": "تاريخ التحليل", - "urgent": "العاجلة", - "requestDetails": "طلب تفاصيل", - "approvalLevel": "مستوى الموافقة", - "requesterDetails": "تفاصيل مقدم الطلب", - "myAttendance": "حضوري", - "workOnBreak": "التعويض عن العمل اثناءالاستراحه", - "next": "التالي", - "apply": "يتقدم", - "mobile": "التليفون المحمول", - "completingYear": "نحن نقدر لك لاستكمال خدمة", - "year": "سنة", - "month": "شهر", - "day": "يوم", - "address": "العنوان", - "phoneNumber": "رقم الجوال", - "businessGroup": "مجموعة العمل", - "Payroll": "الراتب", - "civilIdentityNumber": "رقم الهويه", - "dateOfBirth": "تاريخ الميلاد", - "maritalStatus ": "الحالة الاجتماعية", - "fullName": "الأسم الكامل", - "remove": "حذف", - "submit": "ارسال", - "areYouSureYouWantToSubmit": "هل أنت متأكد أنك تريد أن تقدم؟", - "comments": "تعليقات", - "writeComment": "أكتب تعليقا", - "approversList": "قائمة الموافقين", - "yourRequestHasBeenSubmittedForApprovals": "تم تقديم طلبك للموافقات", - "monthlyPaySlip": "قسيمة الراتب الشهرية", - "particular": "خاص", - "earnings": "أرباح", - "deductions": "الخصومات", - "paymentMethodName": "اسم طريقة الدفع", - "bankName": "اسم البنك", - "branchCode": "رمز الفرع", - "accountNo": "رقم الحساب", - "summaryOfInformation": "ملخص المعلومات", - "totalPayAmount": "المبلغ الإجمالي للدفع", - "paymentInformation": "معلومات الدفع", - "performance": "تقييم الاداء", - "performanceEvaluation": "تقييم الأداء في", - "performanceEvaluationIn": "تقييم أدائك في", - "valuationIn": "تقييم الأداء في", - "amount": "مقدار", - "correctCurrentDatails": "تعديل او اكمال التفاصيل الحالية", - "selectType": " حدد نوع التغيير الذي تريد القيام به", - "enterNewInfo": " أدخل معلومات جديدة بسبب تغيير حقيقي في التفاصيل الحالية (على سبيل المثال بسبب تغيير في الحالة الاجتماعية", - "endDate": "تاريخ الانتهاء", - "removeThisMember": "هل انت متأكد تريد ازالة هذا العضو؟", - "wantUpdateThisMember ": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", - "addNewFamilyMember": "اضافة عضو جديد", - "addRow": "اضافة صف جديد", - "pleaseSelect": "الرجاء اختيار", - "delete": "حذف", - "edit": "تعديل", - "add": "اضافه", - "myProfile": "معلوماتي", - "mowadhafhi": "موظفي", - "searchAnnouncements": "بحث الاعلانات", - "announcements": "اعلانات", - "swipeRequest": "طلب تسجيل حضور", - "serviceType": "نوع الخدمه", - "departmentName": "اسم القسم", - "selectDepartment": "اختر القسم", - "relatedSection": "قسم ذو صله", - "selectSection": "اختيار القسم", - "relatedTopic": "عنوان ذو صله", - "selectTopic": "اختر العنوان", - "supportingDocument": "ارفاق مستند", - "mowadhafhiRequest": "طلب موظفي", - "ticketReference": "مرجع التذكره", - "section": "القسم", - "topic": "العنوان", - "actionBy": "الرد بواسطة", - "pending": "معلق", - "pendingTransactions": "المعاملات المعلقه", - "selectRequestType": "الرجاء اختيار نوع الطلب", - "dateFrom": "من تاريخ", - "dateTo": "الى تاريخ", - "requestName": "اسم الطلب", - "createdFor": "انشاء لأجل", - "requestCreatedSuccessfully": "تم انشاء الطلب بنجاح", - "search": "بحث", - "wantToReject": "هل انت متأكد تريد الرفض", - "requestType": "نوع الطلب", - "employeeDigitalID": "هويةالموظف الرقمية", - "businessCard": "بطاقة العمل", - "viewBusinessCard": "عرض بطاقة العمل", - "logout": "تسجيل خروج", - "checkOut": "وقت الخروج", - "regular": "منتظم", - "mark": "علامة", - "selectMethodOfAttendance": "اختر طريقة تسجيل الحضور", - "comeNearHMGWifi": "HMG wifi من فضلك اقترب من", - "deliverNotificationToMeRegardless": "تسليم الإخطارات إلي بغض النظر عن أي قواعد عامة", - "close": "أغلق", - "respond": "يرد", - "vacationRuleAdded": "تمت إضافة قاعدة الإجازة", - "selectTypeT": "اختر صنف", - "notification": "تنبيه", - "selectNotification": "حدد إعلام", - "ifAllSelectedYouWillSkip": "* إذا تم تحديد الكل ، فستنتقل إلى الخطوة 3", - "applyForVacationRule": "التقدم بطلب للحصول على قانون الإجازة", - "step1": "الخطوة 1", - "step2": "الخطوة 2", - "step3": "الخطوه 3", - "message": "رسالة", - "writeAMessage": "اكتب رسالة", - "notificationReassign": "إعادة تعيين الإخطار", - "selectEmployee": "حدد الموظف", - "searchEmployeeForReplacement": "ابحث عن موظف بديل", - "searchForEmployee": "ابحث عن موظف", - "pleaseSpecifyEndTime": "الرجاء تحديد وقت الانتهاء", - "pleaseSelectNotificationReassign": "يرجى تحديد إعادة تعيين الإخطار", - "pleaseSelectEmployeeForReplacement": "الرجاء تحديد موظف للاستبدال", - "pleaseSelectAction": "الرجاء تحديد الإجراء", - "pleaseSelectDate": "الرجاء تحديد التاريخ", - "todayAttendance": "حضور اليوم", - "viewAttendance": "عرض الحضور", - "teamMembers": "اعضاءالفريق", - "profileDetails": "الملف الشخصي", - "noResultsFound": "لايوجد نتائج", - "searchBy": "بحث بواسطة", - "myTeamMembers": "اعضاء فريقي", - "save": "حفظ", - "TurnNotificationsFor": "تفعيل الاشعارات", - "worklistSettings": "اعدادات الاشعارات", - "absenceType": "نوع الغياب", - "absenceCategory": "فئة الغياب", - "days": "أيام", - "hours": "ساعات", - "approvalStatus": "حالة القبول", - "absenceStatus": "حالة الغياب", - "subordinateLeave": "إجازة التابعيين", - "numberDays": "عدد الأيام", - "poweredBy": "مشغل بواسطة", - "cloudSolutions": "حلول السحابة", - "selectTemplate": "حدد قالب", - "myPostedAds": "إعلاناتي المنشورة", - "browseCategories": "تصفح الفئات", - "searchItems": "عناصر البحث", - "offerAndDiscounts": "العروض والخصومات", - "offerValid": "العرض صالح", - "offerExpired": "انتهى العرض", - "whatAreYouOffering": "ما الذي تعرضه؟", - "selectCategory": "اختر الفئة", - "inProgress": "في تَقَدم", - "locked": "مقفل", - "addDetails": "أضف التفاصيل", - "reviewAndSell": "مراجعة وبيع", - "itemTitle": "عنوان البند", - "itemCondition": "حالة السلعة", - "used": "تستخدم", - "region": "منطقة", - "selectRegion": "اختر المنطقة", - "itemPrice": "سعر السلعة", - "itemPhotos": "صور البند", - "itemInfo": "معلومات العنصر", - "uploadAttachment": "تحميل المرفق", - "selectFromGalleryOrOpenCamera": "اختر من المعرض أو فتح الكاميرا", - "openCamera": "فتح\nالكاميرا", - "uploadFromGallery": "تحميل من\nملفات الجهاز", - "name": "الأسم", - "email": "ايميل", - "noHistoryAvailable": "لايوجد سجل بيانات سابقة ", - "purchaseRequisition": "طلب شراء", - "moveOrder": "طلب تغيير", - "humanResource": "الموارد البشريه", - "purchaseOrder": "امر شراء", - "ITGForms": "ITG نماذج", - "itemCreation": "أنشاء عنصر", - "stamp": "ختم", - "addFavoriteList": "هل تريد اضافة {name} لقائمة المفضله", - "feedbackUserExperience": "هذا للحصول على تعليقات حول تجربة المستخدم", - "rateUI": "كيف تريد أن تقيم", - "rateUI2": "ما مدى رضائك عن هذا التطبيق", - "submitSurvey": "ارسال الاستبيان", - "typeHere": "اكتب هنا", - "infoDetail": "تفاصيل المعلومات", - "amount_detail": "تفاصيل المبلغ", - "currentBalance": "الرصيد الحالي", - "currentLeaveBalance": "رصيد الاجازات الحالي", - "calculatedDays": "الايام المحسوبه", - "totalDays": "مجموع الأيام", - "usedBalance": "المستخدم", - "infants": "رضيع", - "child": "طفل", - "adult": "بالغ", - "updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", - "fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد", - "pleaseEnterComments": "الرجاء إدخال التعليقات", - "skip": "يتخطى", - "typeCurrentPasswordBelow": "اكتب كلمة المرور الحاليه", - "currentPassword": "كلمة المرور الحاليه", - "concurrentReports": "التقارير المتزامنه", - "EnterNewAddressMoved": "أدخل عنوان جديد إذا كنت قد انتقلت", - "CorrectAddress": "تصحيح أو تعديل هذا العنوان", - "SelectChangeWantToMake": " حدد نوع التغيير الذي تريد القيام به.", - "profile": { - "reset_password": {"label": "Reset Password", "username": "Username", "password": "password"}, - "profileCompletionPer": "استكمال الملف الشخصي", - "completeProfile": "الملف الشخصي الكامل", - "personalInformation": "معلومات شخصية", - "basicDetails": "تفاصيل أساسية", - "address": "العنوان", - "contactDetails": "بيانات التواصل", - "familyDetails": "تفاصيل عائلية", - "effectiveDate": "تاريخ النفاذ", - "country": "دولة" - }, - "clicked": { - "zero": "You clicked {} times!", - "one": "You clicked {} time!", - "two": "You clicked {} times!", - "few": "You clicked {} times!", - "many": "You clicked {} times!", - "other": "You clicked {} times!" + static const Map ar_SA = { + "mohemm": "Mohemm", + "english": "English", + "arabic": "عربي", + "login": "تسجيل الدخول", + "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", + "username": "اسم المستخدم", + "password": "كلمة المرور", + "welcomeBack": "مرحبا بعودتك", + "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", + "lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:", + "verificationType": "نوع التحقق:", + "pleaseVerify": "ارجوك تحقق", + "pleaseVerifyForBio": "الرجاء التحقق من تسجيل الدخول باستخدام أحد هذه الخيارات", + "verifyThroughFace": "تحقق من خلال الوجه", + "verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع", + "verifyThroughSMS": "تحقق من خلال الرسائل القصيرة", + "verifyThroughWhatsapp": "تحقق من خلال Whatsapp", + "useAnotherAccount": "استخدم حسابا آخر", + "pleaseEnterTheVerificationCodeSentTo": "الرجاء إدخال رمز التحقق المرسل إلى ", + "theVerificationCodeWillExpireIn": "ستنتهي صلاحية رمز التحقق في ", + "goodMorning": "صباح الخير", + "markAttendance": "علامة الحضور", + "timeLeftToday": "الوقت المتبقي اليوم", + "checkIn": "تحقق في", + "workList": "قائمة العمل", + "leaveBalance": "رصيد الاجازات", + "missingSwipes": "تسجيل بصمة حضور", + "ticketBalance": "رصيد التذكرة", + "other": "آخر", + "services": "خدمات", + "viewAllServices": "عرض جميع الخدمات", + "monthlyAttendance": "الحضور الشهري", + "vacationRule": "قاعدة الاجازات", + "vacationType": "نوع الاجازة", + "startDateT": "تاريخ البدء", + "endDateT": "تاريخ الانتهاء", + "workFromHome": "العمل من المنزل", + "ticketRequest": "طلب تذكرة", + "viewAllOffers": "مشاهدة جميع العروض", + "offers": "عروض & ", + "discounts": "الخصومات", + "newString": "جديد", + "setTheNewPassword": "قم بتعيين كلمة المرور الجديدة", + "typeYourNewPasswordBelow": "اكتب كلمة المرور الجديدة أدناه", + "typeYourNewActiveDirectoryPasswordBelow": "اكتب كلمة مرور الدليل النشط الجديدة أدناه", + "confirmPassword": "تأكيد كلمة المرور", + "update": "تحديث", + "title": "عنوان", + "home": "الرئيسية", + "mySalary": "راتبي", + "createRequest": "إنشاء طلب", + "forgotPassword": "هل نسيت كلمة السر", + "employeeId": "هوية الموظف", + "loginCodeWillSentToMobileNumber": "الرجاء إدخال معرف الموظف الخاص بك ، وسيتم إرسال رمز تسجيل الدخول إلى رقم هاتفك المحمول", + "changePassword": "تغيير كلمة المرور", + "ok": "موافق", + "confirm": "تؤكد", + "passwordChangedSuccessfully": "تم تغيير الرقم السري بنجاح", + "itemsForSale": "سلع للبيع", + "attendanceDetails": "تفاصيل الحضور", + "order": "الطلبات", + "earlyOut": "الخروج مبكرا", + "shortage": "ساعات التقصير", + "excess": "فائض", + "lateIn": "القدوم المتاخر", + "approvedCheckOut": "اعتماد وقت الخروج", + "approvedCheckIn": "اعتماد وقت الدخول", + "actualCheckOut": "وقت الخروج", + "actualCheckIn": "وقت الدخول", + "present": "حضور", + "pres": "حضور", + "shiftTime": "وقت التناوب", + "absent": "غياب", + "attendance": "الحضور", + "scheduleDays": "ايام العمل", + "offDays": "ايام الراحه", + "nonAnalyzed": "لايوجد تحليل", + "shortageHour": "ساعات التقصير", + "stats": "الحاله", + "completed": "تم اكمال", + "msg": "Hello {} in the {} world ", + "msg_named": "{} are written in the {lang} language", + "clickMe": "Click me", + "doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة", + "atLeastOneLowercase": "حرف صغير واحد على الأقل", + "atLeastOneUppercase": "حرف كبير واحد على الأقل", + "atLeastOneNumeric": "رقم واحد على الأقل", + "minimum8Characters": "8 أحرف على الأقل", + "doNotAddRepeatingLetters": "لا تقم بإضافة أحرف متكررة", + "itShouldContainSpecialCharacter": "يجب لا يحتوي على أحرف خاصة", + "confirmPasswordMustMatch": "يجب أن يتطابق تأكيد كلمة المرور", + "sms": "رسالة قصيرة", + "fingerPrint": "بصمة", + "face": "التعرف على الوجه", + "whatsapp": "واتس اب", + "reject": "يرفض", + "approve": "يوافق", + "cancel": "إلغاء", + "generate": "يولد", + "requestedItems": "العناصر المطلوبة", + "request": "طلب", + "myRequest": "طلبي", + "actions": "أجراءات", + "delegate": "مندوب", + "request_info": "اطلب معلومات", + "attachments": "المرفقات", + "info": "معلومات", + "employeeNumber": "رقم الموظف", + "assignmentNumber": "رقم الواجب", + "employeeName": "اسم الموظف", + "scheduleDate": "تاريخ الجدول الزمني", + "shiftType": "نوع التحول", + "shift": "يحول", + "breakText": "استراحة", + "actualSwipeStart": "بدء التمرير الفعلي", + "actualSwipeEnd": "التمرير الفعلي للنهاية", + "approvedSwipeStart": "وافق انتقاد البدء", + "approvedSwipeStartReason": "تمت الموافقة على سبب بدء التمرير السريع", + "approvedSwipeEnd": "تمت الموافقة على تمرير النهاية", + "approvedSwipeEndReason": "الموافقة على سبب إنهاء التمرير", + "from": "من", + "to": "ل", + "sent": "أرسلت", + "closed": "مغلق", + "id": "هوية شخصية", + "responder": "المستجيب", + "jobTitle": "عنوان وظيفي", + "grade": "درجة", + "jobCategory": "تصنيف الوظيفة", + "category": "فئة", + "employeeEmailAddress": "عنوان البريد الإلكتروني للموظف", + "payrollBranch": "فرع الرواتب", + "yourChangeHasBeenSavedSuccessfully": "تم حفظ التغيير الخاص بك بنجاح", + "code": "شفرة", + "unit": "وحدة", + "quantity": "كمية", + "dateRequired": "التاريخ مطلوب", + "lineStatus": "حالة الخط", + "statusDate": "تاريخ الحالة", + "transactionType": "نوع المعاملة", + "operatingUnit": "وحدة التشغيل", + "organizationCode": "كود المنظمة", + "organization": "منظمة", + "fromSubInventory": "من الجرد الفرعي", + "fromLocator": "من محدد المواقع", + "toSubInventory": "إلى الجرد الفرعي", + "toLocator": "إلى محدد المواقع", + "shipToLocator": "شحن إلى محدد المواقع", + "itemHistory": "تاريخ العنصر", + "mfg": "مبدع", + "lineType": "نوع الخط", + "price": "السعر", + "lineAmount": "مبلغ الخط", + "lineDiscount": "خصم الخط٪", + "needByDate": "القادمة إلى الأمام", + "promisedDate": "التسجيل وعد", + "deliverToLocation": "تسليم إلى الموقع", + "requisitionNumber": "رقم الطلب", + "requester": "مقدم الطلب", + "quotationAnalysis": "تحليل الاقتباس", + "subject": "موضوعات", + "description": "وصف", + "supplier": "المورد", + "site": "موقع", + "buyer": "مشتر", + "preparer": "معد", + "creationDate": "تاريخ الإنشاء", + "shipToLocation": "الشحن الى الموقع", + "quotationNumber": "رقم الإقتباس", + "quotationDate": "تاريخ الاقتباس", + "paymentTerms": "شروط الدفع", + "currency": "عملة", + "grossAmount": "المبلغ الإجمالي", + "discountAmount": "مقدار الخصم", + "customDuty": "الرسوم الجمركية", + "shipHandle": "مقبض السفينة", + "otherCharges": "رسوم أخرى", + "totalPOAmountWithVAT": "إجمالي مبلغ الشراء مع ضريبة القيمة المضافة", + "totalPOAmountInWords": "إجمالي مبلغ أمر الشراء بالكلمات", + "requestNumber": "رقم الطلب", + "uom": "UOM", + "operatingCode": "كود التشغيل", + "poNumber": "PO عدد", + "revision": "مراجعة", + "quantityOrdered": "الكمية المطلوبة", + "quantityReceived": "الكمية المستلمة", + "bonusQuantity": "كمية المكافأة", + "purchasePrice": "سعر الشراء", + "discountPer": "خصم ٪", + "balanceQuantity": "كمية التوازن", + "netPrice": "السعر الصافي", + "closureStatus": "حالة الإغلاق", + "quotationNetPrice": "صافي سعر الاقتباس", + "quotationUOM": "اقتباس UOM", + "quotationQty": "اقتباس الكمية", + "itemCode": "رمز الصنف", + "vendorName": "اسم البائع", + "quotationMFGPartNumber": "رقم الجزء MFG الاقتباس", + "quotationDeliveryDate": "تاريخ تسليم عرض الأسعار", + "quotationBonusQuantity": "كمية مكافأة الاقتباس", + "quotationLineTotal": "مجموع خط الاقتباس", + "rfqUOM": "RFQ UOM", + "rfqQty": "RFQ الكمية", + "rfqNumber": "رقم RFQ", + "human": "بشري", + "resources": "موارد", + "details": "تفاصيل", + "noDataAvailable": "لا تتوافر بيانات", + "productName": "اسم المنتج", + "productDescription": "وصف المنتج", + "unitPrice": "سعر الوحده", + "manufacturerName": "اسم المصنع", + "manufacturerPartName": "اسم جزء الشركة المصنعة", + "supplierName": "اسم المورد", + "supplierContact": "الاتصال بالمورد", + "chargeToPatient": "المسؤول عن المريض", + "justification": "التبرير", + "itemDescription": "وصف السلعة", + "groupCode": "كود المجموعة", + "primaryUOM": "UOM الابتدائية", + "subgroupDescription": "وصف المجموعة الفرعية", + "subgroupCode": "رمز المجموعة الفرعية", + "groupDescription": "وصف المجموعة", + "templateName": "اسم القالب", + "itemCreationStatus": "حالة إنشاء العنصر", + "standardizationApprovalStatus": "حالة الموافقة على التقييس", + "standardizationApprovalRejectionReason": "سبب رفض الموافقة على التقييس", + "analyzedBy": "تحليل بواسطة", + "approvedDate": "تاريخ الموافقة", + "itemType": "نوع العنصر", + "relatedTo": "متعلق ب", + "requestDate": "تاريخ الطلب", + "analyzedDate": "تاريخ التحليل", + "urgent": "العاجلة", + "requestDetails": "طلب تفاصيل", + "approvalLevel": "مستوى الموافقة", + "requesterDetails": "تفاصيل مقدم الطلب", + "myAttendance": "حضوري", + "workOnBreak": "التعويض عن العمل اثناءالاستراحه", + "next": "التالي", + "apply": "يتقدم", + "mobile": "التليفون المحمول", + "completingYear": "نحن نقدر لك لاستكمال خدمة", + "year": "سنة", + "month": "شهر", + "day": "يوم", + "address": "العنوان", + "phoneNumber": "رقم الجوال", + "businessGroup": "مجموعة العمل", + "Payroll": "الراتب", + "civilIdentityNumber": "رقم الهويه", + "dateOfBirth": "تاريخ الميلاد", + "maritalStatus ": "الحالة الاجتماعية", + "fullName": "الأسم الكامل", + "remove": "حذف", + "submit": "ارسال", + "areYouSureYouWantToSubmit": "هل أنت متأكد أنك تريد أن تقدم؟", + "comments": "تعليقات", + "writeComment": "أكتب تعليقا", + "approversList": "قائمة الموافقين", + "yourRequestHasBeenSubmittedForApprovals": "تم تقديم طلبك للموافقات", + "monthlyPaySlip": "قسيمة الراتب الشهرية", + "particular": "خاص", + "earnings": "أرباح", + "deductions": "الخصومات", + "paymentMethodName": "اسم طريقة الدفع", + "bankName": "اسم البنك", + "branchCode": "رمز الفرع", + "accountNo": "رقم الحساب", + "summaryOfInformation": "ملخص المعلومات", + "totalPayAmount": "المبلغ الإجمالي للدفع", + "paymentInformation": "معلومات الدفع", + "performance": "تقييم الاداء", + "performanceEvaluation": "تقييم الأداء في", + "performanceEvaluationIn": "تقييم أدائك في", + "valuationIn": "تقييم الأداء في", + "amount": "مقدار", + "correctCurrentDatails": "تعديل او اكمال التفاصيل الحالية", + "selectType": " حدد نوع التغيير الذي تريد القيام به", + "enterNewInfo": " أدخل معلومات جديدة بسبب تغيير حقيقي في التفاصيل الحالية (على سبيل المثال بسبب تغيير في الحالة الاجتماعية", + "endDate": "تاريخ الانتهاء", + "removeThisMember": "هل انت متأكد تريد ازالة هذا العضو؟", + "wantUpdateThisMember ": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", + "addNewFamilyMember": "اضافة عضو جديد", + "addRow": "اضافة صف جديد", + "pleaseSelect": "الرجاء اختيار", + "delete": "حذف", + "edit": "تعديل", + "add": "اضافه", + "myProfile": "معلوماتي", + "mowadhafhi": "موظفي", + "searchAnnouncements": "بحث الاعلانات", + "announcements": "اعلانات", + "swipeRequest": "طلب تسجيل حضور", + "serviceType": "نوع الخدمه", + "departmentName": "اسم القسم", + "selectDepartment": "اختر القسم", + "relatedSection": "قسم ذو صله", + "selectSection": "اختيار القسم", + "relatedTopic": "عنوان ذو صله", + "selectTopic": "اختر العنوان", + "supportingDocument": "ارفاق مستند", + "mowadhafhiRequest": "طلب موظفي", + "ticketReference": "مرجع التذكره", + "section": "القسم", + "topic": "العنوان", + "actionBy": "الرد بواسطة", + "pending": "معلق", + "pendingTransactions": "المعاملات المعلقه", + "selectRequestType": "الرجاء اختيار نوع الطلب", + "dateFrom": "من تاريخ", + "dateTo": "الى تاريخ", + "requestName": "اسم الطلب", + "createdFor": "انشاء لأجل", + "requestCreatedSuccessfully": "تم انشاء الطلب بنجاح", + "search": "بحث", + "wantToReject": "هل انت متأكد تريد الرفض", + "requestType": "نوع الطلب", + "employeeDigitalID": "هويةالموظف الرقمية", + "businessCard": "بطاقة العمل", + "viewBusinessCard": "عرض بطاقة العمل", + "logout": "تسجيل خروج", + "checkOut": "وقت الخروج", + "regular": "منتظم", + "mark": "علامة", + "selectMethodOfAttendance": "اختر طريقة تسجيل الحضور", + "comeNearHMGWifi": "HMG wifi من فضلك اقترب من", + "deliverNotificationToMeRegardless": "تسليم الإخطارات إلي بغض النظر عن أي قواعد عامة", + "close": "أغلق", + "respond": "يرد", + "vacationRuleAdded": "تمت إضافة قاعدة الإجازة", + "selectTypeT": "اختر صنف", + "notification": "تنبيه", + "selectNotification": "حدد إعلام", + "ifAllSelectedYouWillSkip": "* إذا تم تحديد الكل ، فستنتقل إلى الخطوة 3", + "applyForVacationRule": "التقدم بطلب للحصول على قانون الإجازة", + "step1": "الخطوة 1", + "step2": "الخطوة 2", + "step3": "الخطوه 3", + "message": "رسالة", + "writeAMessage": "اكتب رسالة", + "notificationReassign": "إعادة تعيين الإخطار", + "selectEmployee": "حدد الموظف", + "searchEmployeeForReplacement": "ابحث عن موظف بديل", + "searchForEmployee": "ابحث عن موظف", + "pleaseSpecifyEndTime": "الرجاء تحديد وقت الانتهاء", + "pleaseSelectNotificationReassign": "يرجى تحديد إعادة تعيين الإخطار", + "pleaseSelectEmployeeForReplacement": "الرجاء تحديد موظف للاستبدال", + "pleaseSelectAction": "الرجاء تحديد الإجراء", + "pleaseSelectDate": "الرجاء تحديد التاريخ", + "todayAttendance": "حضور اليوم", + "viewAttendance": "عرض الحضور", + "teamMembers": "اعضاءالفريق", + "profileDetails": "الملف الشخصي", + "noResultsFound": "لايوجد نتائج", + "searchBy": "بحث بواسطة", + "myTeamMembers": "اعضاء فريقي", + "save": "حفظ", + "TurnNotificationsFor": "تفعيل الاشعارات", + "worklistSettings": "اعدادات الاشعارات", + "absenceType": "نوع الغياب", + "absenceCategory": "فئة الغياب", + "days": "أيام", + "hours": "ساعات", + "approvalStatus": "حالة القبول", + "absenceStatus": "حالة الغياب", + "subordinateLeave": "إجازة التابعيين", + "numberDays": "عدد الأيام", + "poweredBy": "مشغل بواسطة", + "cloudSolutions": "حلول السحابة", + "selectTemplate": "حدد قالب", + "myPostedAds": "إعلاناتي المنشورة", + "browseCategories": "تصفح الفئات", + "searchItems": "عناصر البحث", + "offerAndDiscounts": "العروض والخصومات", + "offerValid": "العرض صالح", + "offerExpired": "انتهى العرض", + "whatAreYouOffering": "ما الذي تعرضه؟", + "selectCategory": "اختر الفئة", + "inProgress": "في تَقَدم", + "locked": "مقفل", + "addDetails": "أضف التفاصيل", + "reviewAndSell": "مراجعة وبيع", + "itemTitle": "عنوان البند", + "itemCondition": "حالة السلعة", + "used": "تستخدم", + "region": "منطقة", + "selectRegion": "اختر المنطقة", + "itemPrice": "سعر السلعة", + "itemPhotos": "صور البند", + "itemInfo": "معلومات العنصر", + "uploadAttachment": "تحميل المرفق", + "selectFromGalleryOrOpenCamera": "اختر من المعرض أو فتح الكاميرا", + "openCamera": "فتح\nالكاميرا", + "uploadFromGallery": "تحميل من\nملفات الجهاز", + "name": "الأسم", + "email": "ايميل", + "noHistoryAvailable": "لايوجد سجل بيانات سابقة ", + "purchaseRequisition": "طلب شراء", + "moveOrder": "طلب تغيير", + "humanResource": "الموارد البشريه", + "purchaseOrder": "امر شراء", + "ITGForms": "ITG نماذج", + "itemCreation": "أنشاء عنصر", + "stamp": "ختم", + "addFavoriteList": "هل تريد اضافة {name} لقائمة المفضله", + "feedbackUserExperience": "هذا للحصول على تعليقات حول تجربة المستخدم", + "rateUI": "كيف تريد أن تقيم", + "rateUI2": "ما مدى رضائك عن هذا التطبيق", + "submitSurvey": "ارسال الاستبيان", + "typeHere": "اكتب هنا", + "infoDetail": "تفاصيل المعلومات", + "amount_detail": "تفاصيل المبلغ", + "currentBalance": "الرصيد الحالي", + "currentLeaveBalance": "رصيد الاجازات الحالي", + "calculatedDays": "الايام المحسوبه", + "totalDays": "مجموع الأيام", + "usedBalance": "المستخدم", + "infants": "رضيع", + "child": "طفل", + "adult": "بالغ", + "updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", + "fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد", + "pleaseEnterComments": "الرجاء إدخال التعليقات", + "skip": "يتخطى", + "typeCurrentPasswordBelow": "اكتب كلمة المرور الحاليه", + "currentPassword": "كلمة المرور الحاليه", + "concurrentReports": "التقارير المتزامنه", + "EnterNewAddressMoved": "أدخل عنوان جديد إذا كنت قد انتقلت", + "CorrectAddress": "تصحيح أو تعديل هذا العنوان", + "SelectChangeWantToMake": " حدد نوع التغيير الذي تريد القيام به.", + "profile": { + "reset_password": { + "label": "Reset Password", + "username": "Username", + "password": "password" }, - "gender": { - "male": "Hi man ;) ", - "female": "Hello girl :)", - "with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"} + "profileCompletionPer": "استكمال الملف الشخصي", + "completeProfile": "الملف الشخصي الكامل", + "personalInformation": "معلومات شخصية", + "basicDetails": "تفاصيل أساسية", + "address": "العنوان", + "contactDetails": "بيانات التواصل", + "familyDetails": "تفاصيل عائلية", + "effectiveDate": "تاريخ النفاذ", + "country": "دولة" + }, + "clicked": { + "zero": "You clicked {} times!", + "one": "You clicked {} time!", + "two": "You clicked {} times!", + "few": "You clicked {} times!", + "many": "You clicked {} times!", + "other": "You clicked {} times!" + }, + "gender": { + "male": "Hi man ;) ", + "female": "Hello girl :)", + "with_arg": { + "male": "Hi man ;) {}", + "female": "Hello girl :) {}" + } + }, + "reset_locale": "إعادة ضبط اللغة", + "chat": "دردشة", + "mychats": "دردشاتي", + "advancedSearch": "بحث متقدم", + "openNot": "التبليغات المفتوحة", + "fyi": "تبليغات للعلم", + "toDo": "تبليغات الأعمال", + "all": "كل التبليغات", + "meNot": "تبليغات صادرة مني", + "view": "عرض", + "fromUserName": "من", + "sentDate": "تاريخ الإرسال", + "itemTypeDisplayName": "اسم العرض", + "none": "بدون", + "createNewChat": "إنشاء محادثة جديدة", + "brainMarathon": "ماراثون الدماغ", + "contestTopicAbout": "سيكون موضوع المسابقة حول:", + "gameDate": "تاريخ اللعبة:", + "gameTime": "وقت اللعب:", + "joinMarathon": "انضم إلى ماراثون", + "joinDemoMarathon": "انضم إلى الماراثون التجريبي", + "demo": "تجريبي", + "minutes": "الدقائق", + "seconds": "ثواني", + "note": "ملحوظة:", + "demoMarathonNoteP1": "يمكنك لعب ماراثون العرض لتتعلم كيف يعمل. يمكنك الانضمام إلى ماراثون", + "demoMarathonNoteP2": "خمس دقائق", + "demoMarathonNoteP3": "قبل الوقت الفعلي.", + "sponsoredBy": "برعاية:", + "question": "سؤال", + "marathoners": "الماراثون", + "marathoner": "ماراثونر", + "prize": "جائزة:", + "winnerSelection": "اختيار الفائز", + "qualifiers": "تصفيات", + "qualifier": "المؤهل", + "getReadyForContest": "استعد للمسابقة القادمة:", + "winnerSelectedRandomly": "سيتم اختيار الفائز عشوائياً من بين التصفيات.", + "fingersCrossed": "تشابك الاصابع!!!", + "congrats": "مبروك !!!", + "allQuestionsCorrect": "لقد أجبت على جميع الأسئلة بشكل صحيح.", + "otp": "OTP", + "verification": "تَحَقّق", + "resend": "إعادة إرسال", + "codeExpire": "انتهت صلاحية رمز التحقق", + "typeheretoreply": "اكتب هنا للرد", + "favorite": "مفضلتي", + "searchfromchat": "البحث من الدردشة", + "yourAnswerCorrect": "إجابتك صحيحة", + "youMissedTheQuestion": "نفد منك الوقت. أنت خارج اللعبة. لكن يمكنك الاستمرار وكمشاهد.", + "wrongAnswer": "إجابتك غير صحيحة. أنت خارج اللعبة. لكن يمكنك الاستمرار وكمشاهد.", + "oops": "أوه!!!", + "winner": "الفائز", + "youWantToLeaveMarathon": "هل أنت متأكد أنك تريد العودة؟ سوف تخرج من المسابقة.", + "ourSponsor": "راعينا:", + "startingIn": "يبدأ في", + "youAreOutOfContest": "أنت خارج المسابقة.", + "winners": "الفائزين!!!", + "expireAfter": "تنتهي بعد", + "oneWeek": "أسبوع 1", + "twoWeek": "2 أسبوع", + "noUpcoming": "لا يوجد قادم", + "fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية", + "noWinner": "حزين! لم يفز أحد اليوم.", + "myTeam": "فريقي", + "youCanPlayDemo": "لكن يمكنك لعب العرض", + "group": "مجموعة", + "searchGroup": "مجموعة البحث", + "connectHmgWifi": "قم بتوصيل HMG WIFI", + "connectedHmgWifi": "اتصال HMG WIFI", + "itgForms": "نماذج (ITG)", + "resetAdPassword": "إعادة تعيين كلمة مرور AD", + "myDocuments": "مستنداتي", + "requiredDocuments": "المستندات المطلوبة", + "optionalDocuments": "المستندات الاختيارية", + "allDocuments": "كافة المستندات", + "expiredDocuments": "المستندات منتهية الصلاحية", + "missingDocuments": "مستندات مفقودة", + "uploadedDocuments": "المستندات التي تم تحميلها", + "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.", + "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", + "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", + "open": "يفتح", + "requesterOperatingUnit": "وحدة تشغيل مقدم الطلب", + "prepareEmpNum": "إعداد رقم الموظف", + "supplierInfo": "معلومات المورد", + "supplierAcNo": "رقم حساب المورد", + "supplierAcName": "اسم حساب المورد", + "supplierIBAN": "رقم IBAN للمورد", + "supplierCRNo": "رقم السجل التجاري", + "suppliedAcNo": "رقم الحساب المقدم", + "patientRefundInvoice": "فاتورة استرداد الأموال للمريض", + "patientNumber": "رقم المريض", + "patientName": "اسم المريض", + "invoiceDate": "تاريخ الفاتورة", + "refundInvoice": "فاتورة الاسترجاع", + "hospitalClinic": "عيادة المستشفى", + "graphicalAnalysis": "التحليل الرسومي", + "itemHistoryAnalysis": "تحليل تاريخ العنصر", + "pOno": "امر شراء #", + "oprUnit": "وحدة التشغيل", + "qtyOrdered": "الكمية المطلوبة", + "qtyReceived": "الكمية المستلمة", + "bonusQty": "كمية المكافأة", + "balQty": "كمية التوازن" +}; +static const Map en_US = { + "mohemm": "Mohemm", + "english": "English", + "arabic": "عربي", + "login": "Login", + "pleaseEnterLoginDetails": "Please enter the detail below to login", + "username": "Username", + "password": "Password", + "welcomeBack": "Welcome back", + "wouldYouLikeToLoginWithCurrentUsername": "Would you like to login with current Username?", + "lastLoginDetails": "Last Login Details:", + "verificationType": "Verification Type:", + "pleaseVerify": "Please Verify", + "pleaseVerifyForBio": "Please verify login with one of the following options", + "verifyThroughFace": "Verify Through Face", + "verifyThroughFingerprint": "Verify Through Fingerprint", + "verifyThroughSMS": "Verify Through SMS", + "verifyThroughWhatsapp": "Verify Through Whatsapp", + "useAnotherAccount": "Use Another Account", + "pleaseEnterTheVerificationCodeSentTo": "Please enter the verification code sent to ", + "theVerificationCodeWillExpireIn": "The verification code will expire in ", + "goodMorning": "Good Morning", + "markAttendance": "Mark Attendance", + "timeLeftToday": "Time Left Today", + "checkIn": "Check In", + "workList": "Work List", + "leaveBalance": "Leave Balance", + "missingSwipes": "Missing Swipes", + "ticketBalance": "Ticket Balance", + "other": "Other", + "services": "Services", + "viewAllServices": "View All Services", + "monthlyAttendance": "Monthly Attendance", + "vacationRule": "Vacation Rule", + "vacationType": "Vacation Type", + "startDateT": "Start Date", + "endDateT": "End Date", + "workFromHome": "Work From Home", + "ticketRequest": "Ticket Request", + "viewAllOffers": "View All Offers", + "offers": "Offers & ", + "discounts": "Discounts", + "newString": "New", + "setTheNewPassword": "Set the new password", + "typeYourNewPasswordBelow": "Type your new password below", + "typeYourNewActiveDirectoryPasswordBelow": "Type new active directory password below", + "confirmPassword": "Confirm Password", + "update": "Update", + "title": "Title", + "home": "Home", + "mySalary": "My Salary", + "createRequest": "Create Request", + "forgotPassword": "Forgot Password", + "employeeId": "Employee ID", + "loginCodeWillSentToMobileNumber": "Please Enter your Employee ID, A login code will be sent to your mobile number", + "changePassword": "Change Password", + "ok": "OK", + "confirm": "Confirm", + "passwordChangedSuccessfully": "Password changed successfully", + "itemsForSale": "Items for Sale", + "attendanceDetails": "Attendance Details", + "order": "order", + "earlyOut": "Early Out", + "shortage": "Shortage", + "excess": "Excess", + "lateIn": "Late In", + "approvedCheckOut": "Approved Check Out", + "approvedCheckIn": "Approved Check In", + "actualCheckOut": "Actual Check Out", + "actualCheckIn": "Actual Check In", + "present": "PRESENT", + "pres": "present", + "shiftTime": "Shift Time", + "absent": "ABSENT", + "attendance": "Attendance", + "scheduleDays": "Schedule\nDays", + "offDays": "Off\nDays", + "nonAnalyzed": "Non\nAnalyzed", + "shortageHour": "Shortage\nHour", + "stats": "Stats", + "completed": "Completed", + "doNotUseRecentPassword": "Do not use recent password", + "atLeastOneLowercase": "At least one lowercase", + "atLeastOneUppercase": "At least one uppercase", + "atLeastOneNumeric": "At least one numeric", + "minimum8Characters": "Minimum 8 characters", + "doNotAddRepeatingLetters": "Do not add repeating letters", + "itShouldContainSpecialCharacter": "It should not contain special characters", + "confirmPasswordMustMatch": "Confirm password must match", + "sms": "SMS", + "fingerPrint": "Fingerprint", + "face": "Face", + "whatsapp": "Whatsapp", + "reject": "Reject", + "approve": "Approve", + "generate": "Generate", + "cancel": "Cancel", + "requestedItems": "Requested Items", + "request": "Request", + "myRequest": "My Request", + "actions": "Actions", + "delegate": "Delegate", + "request_info": "Request Info", + "attachments": "Attachments", + "info": "Info.", + "employeeNumber": "Employee Number", + "assignmentNumber": "Assignment Number", + "employeeName": "Employee Name", + "scheduleDate": "Schedule Date", + "shiftType": "Shift Type", + "shift": "Shift", + "breakText": "Break", + "actualSwipeStart": "Actual Swipe Start", + "actualSwipeEnd": "Actual Swipe End", + "approvedSwipeStart": "Approved Swipe Start", + "approvedSwipeStartReason": "Approved Swipe Start Reason", + "approvedSwipeEnd": "Approved Swipe End", + "approvedSwipeEndReason": "Approved Swipe End Reason", + "from": "From", + "to": "To", + "sent": "Sent", + "closed": "Closed", + "id": "ID", + "responder": "Responder", + "jobTitle": "Job Title", + "grade": "Grade", + "jobCategory": "Job Category", + "category": "Category", + "employeeEmailAddress": "Employee Email Address", + "payrollBranch": "Payroll Branch", + "yourChangeHasBeenSavedSuccessfully": "Your change has been saved successfully", + "code": "Code", + "unit": "Unit", + "quantity": "Quantity", + "dateRequired": "Date Required", + "lineStatus": "Line Status", + "statusDate": "Status Date", + "transactionType": "Transaction Type", + "operatingUnit": "Operating Unit", + "organizationCode": "Organization Code", + "organization": "Organization", + "fromSubInventory": "From Sub Inventory", + "fromLocator": "From Locator", + "toSubInventory": "To Sub Inventory", + "toLocator": "To Locator", + "shipToLocator": "Ship To Locator", + "itemHistory": "Item History", + "mfg": "MFG", + "lineType": "Line Type", + "price": "Price", + "lineAmount": "Line Amount", + "lineDiscount": "Line Discount %", + "needByDate": "Need By Date", + "promisedDate": "Promised Date", + "deliverToLocation": "Deliver To Location", + "requisitionNumber": "Requisition Number", + "requester": "Requester", + "subject": "Subject", + "quotationAnalysis": "Quotation Analysis", + "description": "Description", + "supplier": "Supplier", + "site": "Site", + "buyer": "Buyer", + "preparer": "Preparer", + "creationDate": "Creation Date", + "shipToLocation": "Ship To Location", + "quotationNumber": "Quotation Number", + "quotationDate": "Quotation Date", + "paymentTerms": "Payment Terms", + "currency": "Currency", + "grossAmount": "Gross Amount", + "discountAmount": "Discount Amount", + "customDuty": "Custom Duty", + "shipHandle": "Ship Handle", + "otherCharges": "Other Charges", + "totalPOAmountWithVAT": "Total PO Amount With VAT", + "totalPOAmountInWords": "Total PO Amount In Words", + "requestNumber": "Request Number", + "uom": "UOM", + "operatingCode": "Operating Code", + "poNumber": "PO Number", + "revision": "Revision", + "quantityOrdered": "Quantity Ordered", + "quantityReceived": "Quantity Received", + "bonusQuantity": "Bonus Quantity", + "purchasePrice": "Purchase Price", + "discountPer": "Discount %", + "balanceQuantity": "Balance Quantity", + "netPrice": "Net Price", + "closureStatus": "Closure Status", + "quotationNetPrice": "Quotation Net Price", + "quotationUOM": "Quotation UOM", + "quotationQty": "Quotation Qty", + "itemCode": "item Code", + "vendorName": "Vendor Name", + "quotationMFGPartNumber": "Quotation MFG Part Number", + "quotationDeliveryDate": "Quotation Delivery Date", + "quotationBonusQuantity": "Quotation Bonus Quantity", + "quotationLineTotal": "Quotation Line Total", + "rfqUOM": "RFQ UOM", + "rfqQty": "RFQ Qty", + "rfqNumber": "RFQ Number", + "msg": "Hello {} in the {} world ", + "msg_named": "{} are written in the {lang} language", + "clickMe": "Click me", + "human": "Human", + "resources": "Resources", + "details": "Details", + "noDataAvailable": "No Data Available", + "productName": "Product Name", + "productDescription": "Product Description", + "unitPrice": "Unit Price", + "manufacturerName": "Manufacturer Name", + "manufacturerPartName": "Manufacturer Part Name", + "supplierName": "Supplier Name", + "supplierContact": "Supplier Contact", + "chargeToPatient": "Charge To Patient", + "justification": "Justification", + "itemDescription": "Item Description", + "groupCode": "Group Code", + "primaryUOM": "Primary UOM", + "subgroupDescription": "Subgroup Description", + "subgroupCode": "Subgroup Code", + "groupDescription": "Group Description", + "templateName": "Template Name", + "itemCreationStatus": "Item Creation Status", + "standardizationApprovalStatus": "Standardization Approval Status", + "standardizationApprovalRejectionReason": "Standardization Approval Rejection Reason", + "analyzedBy": "Analyzed By", + "approvedDate": "Approved Date", + "itemType": "Item Type", + "relatedTo": "Related To", + "requestDate": "Request Date", + "analyzedDate": "Analyzed Date", + "urgent": "Urgent", + "requestDetails": "Request Details", + "approvalLevel": "Approval Level", + "requesterDetails": "Requester Details", + "myAttendance": "My Attendance", + "workOnBreak": "Work On Break", + "next": "Next", + "apply": "Apply", + "mobile": "Mobile", + "year": "Year", + "month": "Month", + "day": "Day", + "completingYear": "We appreciate you for completing the service of", + "address": "Address", + "phoneNumber": "Phone Number", + "businessGroup": "Business", + "Payroll": "Payroll", + "civilIdentityNumber": "Civil Identity Number", + "dateOfBirth": "Date of Birth", + "maritalStatus ": "Marital Status ", + "fullName": "Full Name", + "remove": "Remove", + "Attendance": "Attendance", + "submit": "Submit", + "areYouSureYouWantToSubmit": "Are you sure you want to submit?", + "comments": "Comments", + "writeComment": "Write a comment", + "approversList": "Approvers List", + "yourRequestHasBeenSubmittedForApprovals": "Your request has been submitted for approvals", + "monthlyPaySlip": "Monthly Pay Slip", + "particular": "Particular", + "earnings": "Earnings", + "deductions": "Deductions", + "paymentMethodName": "Payment Method Name", + "bankName": "Bank Name", + "branchCode": "Branch Code", + "accountNo": "Account No", + "summaryOfInformation": "Summary of Information", + "totalPayAmount": "Total Pay Amount", + "paymentInformation": "Payment Information", + "amount": "Amount", + "correctCurrentDatails": "correct or complete the current details", + "selectType": "Select the type of change you want to make", + "enterNewInfo": "Enter new Information because of a real change to the current details (e.g because of a change in marital status)", + "endDate": "*End Date", + "removeThisMember": "Are You Sure You Want to Remove this Member?", + "wantUpdateThisMember": "Are You Sure You Want to Update this Member?", + "addNewFamilyMember": "Add New Family Member", + "addRow": "Add new row", + "pleaseSelect": "Please Select *", + "delete": "delete", + "add": "Add", + "edit": "Edit", + "myProfile": "My Profile", + "mowadhafhi": "Mowadhafi", + "searchAnnouncements": "Search Announcements", + "announcements": "Announcements", + "swipeRequest": "Swipe Request", + "serviceType": "Service Type", + "departmentName": "Department Name", + "selectDepartment": "Select Department", + "relatedSection": "Related Section", + "selectSection": "Select Section", + "relatedTopic": "Related Topic", + "selectTopic": "Select Topic", + "supportingDocument": "Supporting Document", + "mowadhafhiRequest": "Mowadhafi Request", + "ticketReference": "Ticket Reference", + "section": "Section", + "topic": "Topic", + "actionBy": "Action By", + "pendingTransactions": "Pending Transactions", + "selectRequestType": "Please select request type", + "dateFrom": "Date From", + "dateTo": "Date To", + "requestName": "Request Name", + "createdFor": "Created For", + "requestType": "Request Type", + "requestCreatedSuccessfully": "Request created successfully", + "search": "Search", + "wantToReject": "Are you sure want to reject?", + "employeeDigitalID": "Employee Digital ID", + "businessCard": "Business Card", + "checkOut": "Check Out", + "regular": "Regular", + "mark": "Mark", + "performance": "Performance Evaluation", + "performanceEvaluationIn": "Your performance Evaluation in", + "valuationIn": "Performance Evaluation in", + "viewBusinessCard": "View Business Card", + "performanceEvaluation": "Performance Evaluation", + "logout": "Logout", + "selectMethodOfAttendance": "Select the method to mark the attendance", + "comeNearHMGWifi": "Please come near to HMG wifi", + "deliverNotificationToMeRegardless": "Deliver notifications to me regardless of any general rules", + "close": "Close", + "respond": "Respond", + "vacationRuleAdded": "Vacation rule added", + "selectTypeT": "Select Type", + "notification": "Notification", + "selectNotification": "Select Notification", + "ifAllSelectedYouWillSkip": "*If All is selected, you will skip to step 3", + "applyForVacationRule": "Apply for Vacation Rule", + "step1": "Step 1", + "step2": "Step 2", + "step3": "Step 3", + "message": "Message", + "writeAMessage": "Write a message", + "notificationReassign": "Notification Reassign", + "selectEmployee": "Select Employee", + "searchEmployeeForReplacement": "Search employee for replacement", + "searchForEmployee": "Search for Employee", + "pleaseSpecifyEndTime": "Please specify End Time", + "pleaseSelectNotificationReassign": "Please select notification reassign", + "pleaseSelectEmployeeForReplacement": "Please select employee for replacement", + "pleaseSelectAction": "Please select action", + "pleaseSelectDate": "Please select date", + "todayAttendance": "Today's Attendance", + "viewAttendance": "View Attendance", + "teamMembers": "Team Members", + "profileDetails": "Profile Details", + "noResultsFound": "No Results Found", + "searchBy": "Search by", + "myTeamMembers": "My Team Members", + "save": "Save", + "TurnNotificationsFor": "Turn on notifications for", + "worklistSettings": "Worklist Settings", + "absenceType": "Absence Type", + "absenceCategory": "Absence Category", + "days": "Days", + "hours": "Hours", + "approvalStatus": "Approval Status", + "absenceStatus": "Absence Status", + "poweredBy": "Powered By", + "cloudSolutions": "Cloud Solutions", + "subordinateLeave": "Subordinate Leave", + "numberDays": "Number of days", + "selectTemplate": "Select Template", + "myPostedAds": "My posted ads", + "browseCategories": "Browse Categories", + "searchItems": "Search Items", + "offerAndDiscounts": "Offer & Discounts", + "offerValid": "Offer Valid", + "offerExpired": "Offer Expired", + "whatAreYouOffering": "What are you offering?", + "selectCategory": "Select Category", + "inProgress": "InProgress", + "locked": "Locked", + "addDetails": "Add Details", + "reviewAndSell": "Review & Sell", + "itemTitle": "Item Title", + "itemCondition": "Item Condition", + "used": "Used", + "region": "Region", + "selectRegion": "Select Region", + "itemPrice": "Item Price", + "itemPhotos": "Item Photos", + "itemInfo": "Item Info", + "uploadAttachment": "Upload Attachment", + "selectFromGalleryOrOpenCamera": "Select from gallery or open camera", + "openCamera": "Open\nCamera", + "uploadFromGallery": "Upload from\nGallery", + "name": "Name", + "email": "Email", + "noHistoryAvailable": "No History Available", + "purchaseRequisition": "Purchase Requisition", + "moveOrder": "Move Order", + "humanResource": "Human Resource", + "purchaseOrder": "Purchase Order", + "ITGForms": "ITG Forms", + "itemCreation": "Item Creation", + "stamp": "Stamp", + "addFavoriteList": "Do you want to add {name} in your favorite list", + "feedbackUserExperience": "This is to get the feedback about the user experience", + "rateUI": "How would you like to rate", + "rateUI2": "How do you satisfied with this application", + "submitSurvey": "Submit Survey", + "typeHere": "Type here", + "infoDetail": "Info Detail", + "amount_detail": "Amount Detail", + "currentBalance": "Current Balance", + "currentLeaveBalance": "Current Leave Balance", + "calculatedDays": "Calculated Days", + "totalDays": "Total Days", + "usedBalance": "Used", + "infants": "Infants", + "child": "Child", + "adult": "Adult", + "updateMember": "Are You Sure You Want to Update this Member?", + "fieldIsEmpty": "'{data}' Field is empty. Please select", + "pleaseEnterComments": "Please enter comments", + "skip": "Skip", + "typeCurrentPasswordBelow": "Type Your Current password below", + "currentPassword": "Current password", + "concurrentReports": "Concurrent Reports", + "EnterNewAddressMoved": "Enter a new address if you have moved", + "CorrectAddress": "Correct or amend this address", + "SelectChangeWantToMake": "Select the type of change you want to make", + "profile": { + "reset_password": { + "label": "Reset Password", + "username": "Username", + "password": "password" }, - "reset_locale": "إعادة ضبط اللغة", - "chat": "دردشة", - "mychats": "دردشاتي", - "advancedSearch": "بحث متقدم", - "openNot": "التبليغات المفتوحة", - "fyi": "تبليغات للعلم", - "toDo": "تبليغات الأعمال", - "all": "كل التبليغات", - "meNot": "تبليغات صادرة مني", - "view": "عرض", - "fromUserName": "من", - "sentDate": "تاريخ الإرسال", - "itemTypeDisplayName": "اسم العرض", - "none": "بدون", - "createNewChat": "إنشاء محادثة جديدة", - "brainMarathon": "ماراثون الدماغ", - "contestTopicAbout": "سيكون موضوع المسابقة حول:", - "gameDate": "تاريخ اللعبة:", - "gameTime": "وقت اللعب:", - "joinMarathon": "انضم إلى ماراثون", - "joinDemoMarathon": "انضم إلى الماراثون التجريبي", - "demo": "تجريبي", - "minutes": "الدقائق", - "seconds": "ثواني", - "note": "ملحوظة:", - "demoMarathonNoteP1": "يمكنك لعب ماراثون العرض لتتعلم كيف يعمل. يمكنك الانضمام إلى ماراثون", - "demoMarathonNoteP2": "خمس دقائق", - "demoMarathonNoteP3": "قبل الوقت الفعلي.", - "sponsoredBy": "برعاية:", - "question": "سؤال", - "marathoners": "الماراثون", - "marathoner": "ماراثونر", - "prize": "جائزة:", - "winnerSelection": "اختيار الفائز", - "qualifiers": "تصفيات", - "qualifier": "المؤهل", - "getReadyForContest": "استعد للمسابقة القادمة:", - "winnerSelectedRandomly": "سيتم اختيار الفائز عشوائياً من بين التصفيات.", - "fingersCrossed": "تشابك الاصابع!!!", - "congrats": "مبروك !!!", - "allQuestionsCorrect": "لقد أجبت على جميع الأسئلة بشكل صحيح.", - "otp": "OTP", - "verification": "تَحَقّق", - "resend": "إعادة إرسال", - "codeExpire": "انتهت صلاحية رمز التحقق", - "typeheretoreply": "اكتب هنا للرد", - "favorite": "مفضلتي", - "searchfromchat": "البحث من الدردشة", - "yourAnswerCorrect": "إجابتك صحيحة", - "youMissedTheQuestion": "نفد منك الوقت. أنت خارج اللعبة. لكن يمكنك الاستمرار وكمشاهد.", - "wrongAnswer": "إجابتك غير صحيحة. أنت خارج اللعبة. لكن يمكنك الاستمرار وكمشاهد.", - "oops": "أوه!!!", - "winner": "الفائز", - "youWantToLeaveMarathon": "هل أنت متأكد أنك تريد العودة؟ سوف تخرج من المسابقة.", - "ourSponsor": "راعينا:", - "startingIn": "يبدأ في", - "youAreOutOfContest": "أنت خارج المسابقة.", - "winners": "الفائزين!!!", - "expireAfter": "تنتهي بعد", - "oneWeek": "أسبوع 1", - "twoWeek": "2 أسبوع", - "noUpcoming": "لا يوجد قادم", - "fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية", - "noWinner": "حزين! لم يفز أحد اليوم.", - "myTeam": "فريقي", - "youCanPlayDemo": "لكن يمكنك لعب العرض", - "group": "مجموعة", - "searchGroup": "مجموعة البحث", - "connectHmgWifi": "قم بتوصيل HMG WIFI", - "connectedHmgWifi": "اتصال HMG WIFI", - "itgForms": "نماذج (ITG)", - "resetAdPassword": "إعادة تعيين كلمة مرور AD", - "myDocuments": "مستنداتي", - "requiredDocuments": "المستندات المطلوبة", - "optionalDocuments": "المستندات الاختيارية", - "allDocuments": "كافة المستندات", - "expiredDocuments": "المستندات منتهية الصلاحية", - "missingDocuments": "مستندات مفقودة", - "uploadedDocuments": "المستندات التي تم تحميلها", - "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", - "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", - "generate": "يولد", - "paymentRequest":"طلب الدفع", - "paymentDetails":"تفاصيل الدفع", - "requestNo":"رقم الطلب", - "requesterEmpNum":"رقم الموظف الذي قدم الطلب", - "requesterEmpName":"اسم الموظف مقدم الطلب", - "prepareEmpName":"إعداد اسم الموظف", - "requesterPositionName":"اسم الوظيفة لمقدم الطلب", - "preparePositionName":"إعداد اسم الوظيفة", - "requesterPayrollName":"اسم مقدم الطلب", - "payingORGName":"اسم المنظمة الدافعة", - "requestAmount":"مبلغ الطلب", - "typeofPayment":"نوع الدفع", - "beneficiaryDetails":"تفاصيل المستفيد", - "beneficiaryName":"اسم المستفيد", - "idIqama":"الهوية السعودية / الإقامة", - "beneficiaryBankName":"اسم البنك المستفيد", - "sadadNumber":"رقم سداد", - "beneficiaryIBAN":"رقم IBAN للمستفيد", - "purchaseOrders":"طلبات الشراء", - "approvalDate":"تاريخ الموافقة", - "pOAmount":"مبلغ الطلب", - "versionStatus":"حالة الإصدار", - "supplierNo":"رقم المورد", - "general":"عام", - "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", - "prepareEmpNum":"إعداد رقم الموظف", - - }; - static const Map en_US = { - "mohemm": "Mohemm", - "english": "English", - "arabic": "عربي", - "login": "Login", - "pleaseEnterLoginDetails": "Please enter the detail below to login", - "username": "Username", - "password": "Password", - "welcomeBack": "Welcome back", - "wouldYouLikeToLoginWithCurrentUsername": "Would you like to login with current Username?", - "lastLoginDetails": "Last Login Details:", - "verificationType": "Verification Type:", - "pleaseVerify": "Please Verify", - "pleaseVerifyForBio": "Please verify login with one of the following options", - "verifyThroughFace": "Verify Through Face", - "verifyThroughFingerprint": "Verify Through Fingerprint", - "verifyThroughSMS": "Verify Through SMS", - "verifyThroughWhatsapp": "Verify Through Whatsapp", - "useAnotherAccount": "Use Another Account", - "pleaseEnterTheVerificationCodeSentTo": "Please enter the verification code sent to ", - "theVerificationCodeWillExpireIn": "The verification code will expire in ", - "goodMorning": "Good Morning", - "markAttendance": "Mark Attendance", - "timeLeftToday": "Time Left Today", - "checkIn": "Check In", - "workList": "Work List", - "leaveBalance": "Leave Balance", - "missingSwipes": "Missing Swipes", - "ticketBalance": "Ticket Balance", - "other": "Other", - "services": "Services", - "viewAllServices": "View All Services", - "monthlyAttendance": "Monthly Attendance", - "vacationRule": "Vacation Rule", - "vacationType": "Vacation Type", - "startDateT": "Start Date", - "endDateT": "End Date", - "workFromHome": "Work From Home", - "ticketRequest": "Ticket Request", - "viewAllOffers": "View All Offers", - "offers": "Offers & ", - "discounts": "Discounts", - "newString": "New", - "setTheNewPassword": "Set the new password", - "typeYourNewPasswordBelow": "Type your new password below", - "typeYourNewActiveDirectoryPasswordBelow": "Type new active directory password below", - "confirmPassword": "Confirm Password", - "update": "Update", - "title": "Title", - "home": "Home", - "mySalary": "My Salary", - "createRequest": "Create Request", - "forgotPassword": "Forgot Password", - "employeeId": "Employee ID", - "loginCodeWillSentToMobileNumber": "Please Enter your Employee ID, A login code will be sent to your mobile number", - "changePassword": "Change Password", - "ok": "OK", - "confirm": "Confirm", - "passwordChangedSuccessfully": "Password changed successfully", - "itemsForSale": "Items for Sale", - "attendanceDetails": "Attendance Details", - "order": "order", - "earlyOut": "Early Out", - "shortage": "Shortage", - "excess": "Excess", - "lateIn": "Late In", - "approvedCheckOut": "Approved Check Out", - "approvedCheckIn": "Approved Check In", - "actualCheckOut": "Actual Check Out", - "actualCheckIn": "Actual Check In", - "present": "PRESENT", - "pres": "present", - "shiftTime": "Shift Time", - "absent": "ABSENT", - "attendance": "Attendance", - "scheduleDays": "Schedule\nDays", - "offDays": "Off\nDays", - "nonAnalyzed": "Non\nAnalyzed", - "shortageHour": "Shortage\nHour", - "stats": "Stats", - "completed": "Completed", - "doNotUseRecentPassword": "Do not use recent password", - "atLeastOneLowercase": "At least one lowercase", - "atLeastOneUppercase": "At least one uppercase", - "atLeastOneNumeric": "At least one numeric", - "minimum8Characters": "Minimum 8 characters", - "doNotAddRepeatingLetters": "Do not add repeating letters", - "itShouldContainSpecialCharacter": "It should not contain special character", - "confirmPasswordMustMatch": "Confirm password must match", - "sms": "SMS", - "fingerPrint": "Fingerprint", - "face": "Face", - "whatsapp": "Whatsapp", - "reject": "Reject", - "approve": "Approve", - "cancel": "Cancel", - "requestedItems": "Requested Items", - "request": "Request", - "myRequest": "My Request", - "actions": "Actions", - "delegate": "Delegate", - "request_info": "Request Info", - "attachments": "Attachments", - "info": "Info.", - "employeeNumber": "Employee Number", - "assignmentNumber": "Assignment Number", - "employeeName": "Employee Name", - "scheduleDate": "Schedule Date", - "shiftType": "Shift Type", - "shift": "Shift", - "breakText": "Break", - "actualSwipeStart": "Actual Swipe Start", - "actualSwipeEnd": "Actual Swipe End", - "approvedSwipeStart": "Approved Swipe Start", - "approvedSwipeStartReason": "Approved Swipe Start Reason", - "approvedSwipeEnd": "Approved Swipe End", - "approvedSwipeEndReason": "Approved Swipe End Reason", - "from": "From", - "to": "To", - "sent": "Sent", - "closed": "Closed", - "id": "ID", - "responder": "Responder", - "jobTitle": "Job Title", - "grade": "Grade", - "jobCategory": "Job Category", - "category": "Category", - "employeeEmailAddress": "Employee Email Address", - "payrollBranch": "Payroll Branch", - "yourChangeHasBeenSavedSuccessfully": "Your change has been saved successfully", - "code": "Code", - "unit": "Unit", - "quantity": "Quantity", - "dateRequired": "Date Required", - "lineStatus": "Line Status", - "statusDate": "Status Date", - "transactionType": "Transaction Type", - "operatingUnit": "Operating Unit", - "organizationCode": "Organization Code", - "organization": "Organization", - "fromSubInventory": "From Sub Inventory", - "fromLocator": "From Locator", - "toSubInventory": "To Sub Inventory", - "toLocator": "To Locator", - "shipToLocator": "Ship To Locator", - "itemHistory": "Item History", - "mfg": "MFG", - "lineType": "Line Type", - "price": "Price", - "lineAmount": "Line Amount", - "lineDiscount": "Line Discount %", - "needByDate": "Need By Date", - "promisedDate": "Promised Date", - "deliverToLocation": "Deliver To Location", - "requisitionNumber": "Requisition Number", - "requester": "Requester", - "subject": "Subject", - "quotationAnalysis": "Quotation Analysis", - "description": "Description", - "supplier": "Supplier", - "site": "Site", - "buyer": "Buyer", - "preparer": "Preparer", - "creationDate": "Creation Date", - "shipToLocation": "Ship To Location", - "quotationNumber": "Quotation Number", - "quotationDate": "Quotation Date", - "paymentTerms": "Payment Terms", - "currency": "Currency", - "grossAmount": "Gross Amount", - "discountAmount": "Discount Amount", - "customDuty": "Custom Duty", - "shipHandle": "Ship Handle", - "otherCharges": "Other Charges", - "totalPOAmountWithVAT": "Total PO Amount With VAT", - "totalPOAmountInWords": "Total PO Amount In Words", - "requestNumber": "Request Number", - "uom": "UOM", - "operatingCode": "Operating Code", - "poNumber": "PO Number", - "revision": "Revision", - "quantityOrdered": "Quantity Ordered", - "quantityReceived": "Quantity Received", - "bonusQuantity": "Bonus Quantity", - "purchasePrice": "Purchase Price", - "discountPer": "Discount %", - "balanceQuantity": "Balance Quantity", - "netPrice": "Net Price", - "closureStatus": "Closure Status", - "quotationNetPrice": "Quotation Net Price", - "quotationUOM": "Quotation UOM", - "quotationQty": "Quotation Qty", - "itemCode": "item Code", - "vendorName": "Vendor Name", - "quotationMFGPartNumber": "Quotation MFG Part Number", - "quotationDeliveryDate": "Quotation Delivery Date", - "quotationBonusQuantity": "Quotation Bonus Quantity", - "quotationLineTotal": "Quotation Line Total", - "rfqUOM": "RFQ UOM", - "rfqQty": "RFQ Qty", - "rfqNumber": "RFQ Number", - "msg": "Hello {} in the {} world ", - "msg_named": "{} are written in the {lang} language", - "clickMe": "Click me", - "human": "Human", - "resources": "Resources", - "details": "Details", - "noDataAvailable": "No Data Available", - "productName": "Product Name", - "productDescription": "Product Description", - "unitPrice": "Unit Price", - "manufacturerName": "Manufacturer Name", - "manufacturerPartName": "Manufacturer Part Name", - "supplierName": "Supplier Name", - "supplierContact": "Supplier Contact", - "chargeToPatient": "Charge To Patient", - "justification": "Justification", - "itemDescription": "Item Description", - "groupCode": "Group Code", - "primaryUOM": "Primary UOM", - "subgroupDescription": "Subgroup Description", - "subgroupCode": "Subgroup Code", - "groupDescription": "Group Description", - "templateName": "Template Name", - "itemCreationStatus": "Item Creation Status", - "standardizationApprovalStatus": "Standardization Approval Status", - "standardizationApprovalRejectionReason": "Standardization Approval Rejection Reason", - "analyzedBy": "Analyzed By", - "approvedDate": "Approved Date", - "itemType": "Item Type", - "relatedTo": "Related To", - "requestDate": "Request Date", - "analyzedDate": "Analyzed Date", - "urgent": "Urgent", - "requestDetails": "Request Details", - "approvalLevel": "Approval Level", - "requesterDetails": "Requester Details", - "myAttendance": "My Attendance", - "workOnBreak": "Work On Break", - "next": "Next", - "apply": "Apply", - "mobile": "Mobile", - "year": "Year", - "month": "Month", - "day": "Day", - "completingYear": "We appreciate you for completing the service of", + "profileCompletionPer": "Profile Completion", + "completeProfile": "Complete Profile", + "personalInformation": "Personal Information", + "basicDetails": "Basic Details", "address": "Address", - "phoneNumber": "Phone Number", - "businessGroup": "Business", - "Payroll": "Payroll", - "civilIdentityNumber": "Civil Identity Number", - "dateOfBirth": "Date of Birth", - "maritalStatus ": "Marital Status ", - "fullName": "Full Name", - "remove": "Remove", - "Attendance": "Attendance", - "submit": "Submit", - "areYouSureYouWantToSubmit": "Are you sure you want to submit?", - "comments": "Comments", - "writeComment": "Write a comment", - "approversList": "Approvers List", - "yourRequestHasBeenSubmittedForApprovals": "Your request has been submitted for approvals", - "monthlyPaySlip": "Monthly Pay Slip", - "particular": "Particular", - "earnings": "Earnings", - "deductions": "Deductions", - "paymentMethodName": "Payment Method Name", - "bankName": "Bank Name", - "branchCode": "Branch Code", - "accountNo": "Account No", - "summaryOfInformation": "Summary of Information", - "totalPayAmount": "Total Pay Amount", - "paymentInformation": "Payment Information", - "amount": "Amount", - "correctCurrentDatails": "correct or complete the current details", - "selectType": "Select the type of change you want to make", - "enterNewInfo": "Enter new Information because of a real change to the current details (e.g because of a change in marital status)", - "endDate": "*End Date", - "removeThisMember": "Are You Sure You Want to Remove this Member?", - "wantUpdateThisMember": "Are You Sure You Want to Update this Member?", - "addNewFamilyMember": "Add New Family Member", - "addRow": "Add new row", - "pleaseSelect": "Please Select *", - "delete": "delete", - "add": "Add", - "edit": "Edit", - "myProfile": "My Profile", - "mowadhafhi": "Mowadhafi", - "searchAnnouncements": "Search Announcements", - "announcements": "Announcements", - "swipeRequest": "Swipe Request", - "serviceType": "Service Type", - "departmentName": "Department Name", - "selectDepartment": "Select Department", - "relatedSection": "Related Section", - "selectSection": "Select Section", - "relatedTopic": "Related Topic", - "selectTopic": "Select Topic", - "supportingDocument": "Supporting Document", - "mowadhafhiRequest": "Mowadhafi Request", - "ticketReference": "Ticket Reference", - "section": "Section", - "topic": "Topic", - "actionBy": "Action By", - "pendingTransactions": "Pending Transactions", - "selectRequestType": "Please select request type", - "dateFrom": "Date From", - "dateTo": "Date To", - "requestName": "Request Name", - "createdFor": "Created For", - "requestType": "Request Type", - "requestCreatedSuccessfully": "Request created successfully", - "search": "Search", - "wantToReject": "Are you sure want to reject?", - "employeeDigitalID": "Employee Digital ID", - "businessCard": "Business Card", - "checkOut": "Check Out", - "regular": "Regular", - "mark": "Mark", - "performance": "Performance Evaluation", - "performanceEvaluationIn": "Your performance Evaluation in", - "valuationIn": "Performance Evaluation in", - "viewBusinessCard": "View Business Card", - "performanceEvaluation": "Performance Evaluation", - "logout": "Logout", - "selectMethodOfAttendance": "Select the method to mark the attendance", - "comeNearHMGWifi": "Please come near to HMG wifi", - "deliverNotificationToMeRegardless": "Deliver notifications to me regardless of any general rules", - "close": "Close", - "respond": "Respond", - "vacationRuleAdded": "Vacation rule added", - "selectTypeT": "Select Type", - "notification": "Notification", - "selectNotification": "Select Notification", - "ifAllSelectedYouWillSkip": "*If All is selected, you will skip to step 3", - "applyForVacationRule": "Apply for Vacation Rule", - "step1": "Step 1", - "step2": "Step 2", - "step3": "Step 3", - "message": "Message", - "writeAMessage": "Write a message", - "notificationReassign": "Notification Reassign", - "selectEmployee": "Select Employee", - "searchEmployeeForReplacement": "Search employee for replacement", - "searchForEmployee": "Search for Employee", - "pleaseSpecifyEndTime": "Please specify End Time", - "pleaseSelectNotificationReassign": "Please select notification reassign", - "pleaseSelectEmployeeForReplacement": "Please select employee for replacement", - "pleaseSelectAction": "Please select action", - "pleaseSelectDate": "Please select date", - "todayAttendance": "Today's Attendance", - "viewAttendance": "View Attendance", - "teamMembers": "Team Members", - "profileDetails": "Profile Details", - "noResultsFound": "No Results Found", - "searchBy": "Search by", - "myTeamMembers": "My Team Members", - "save": "Save", - "TurnNotificationsFor": "Turn on notifications for", - "worklistSettings": "Worklist Settings", - "absenceType": "Absence Type", - "absenceCategory": "Absence Category", - "days": "Days", - "hours": "Hours", - "approvalStatus": "Approval Status", - "absenceStatus": "Absence Status", - "poweredBy": "Powered By", - "cloudSolutions": "Cloud Solutions", - "subordinateLeave": "Subordinate Leave", - "numberDays": "Number of days", - "selectTemplate": "Select Template", - "myPostedAds": "My posted ads", - "browseCategories": "Browse Categories", - "searchItems": "Search Items", - "offerAndDiscounts": "Offer & Discounts", - "offerValid": "Offer Valid", - "offerExpired": "Offer Expired", - "whatAreYouOffering": "What are you offering?", - "selectCategory": "Select Category", - "inProgress": "InProgress", - "locked": "Locked", - "addDetails": "Add Details", - "reviewAndSell": "Review & Sell", - "itemTitle": "Item Title", - "itemCondition": "Item Condition", - "used": "Used", - "region": "Region", - "selectRegion": "Select Region", - "itemPrice": "Item Price", - "itemPhotos": "Item Photos", - "itemInfo": "Item Info", - "uploadAttachment": "Upload Attachment", - "selectFromGalleryOrOpenCamera": "Select from gallery or open camera", - "openCamera": "Open\nCamera", - "uploadFromGallery": "Upload from\nGallery", - "name": "Name", - "email": "Email", - "noHistoryAvailable": "No History Available", - "purchaseRequisition": "Purchase Requisition", - "moveOrder": "Move Order", - "humanResource": "Human Resource", - "purchaseOrder": "Purchase Order", - "ITGForms": "ITG Forms", - "itemCreation": "Item Creation", - "stamp": "Stamp", - "addFavoriteList": "Do you want to add {name} in your favorite list", - "feedbackUserExperience": "This is to get the feedback about the user experience", - "rateUI": "How would you like to rate", - "rateUI2": "How do you satisfied with this application", - "submitSurvey": "Submit Survey", - "typeHere": "Type here", - "infoDetail": "Info Detail", - "amount_detail": "Amount Detail", - "currentBalance": "Current Balance", - "currentLeaveBalance": "Current Leave Balance", - "calculatedDays": "Calculated Days", - "totalDays": "Total Days", - "usedBalance": "Used", - "infants": "Infants", - "child": "Child", - "adult": "Adult", - "updateMember": "Are You Sure You Want to Update this Member?", - "fieldIsEmpty": "'{data}' Field is empty. Please select", - "pleaseEnterComments": "Please enter comments", - "skip": "Skip", - "typeCurrentPasswordBelow": "Type Your Current password below", - "currentPassword": "Current password", - "concurrentReports": "Concurrent Reports", - "EnterNewAddressMoved": "Enter a new address if you have moved", - "CorrectAddress": "Correct or amend this address", - "SelectChangeWantToMake": "Select the type of change you want to make", - "profile": { - "reset_password": {"label": "Reset Password", "username": "Username", "password": "password"}, - "profileCompletionPer": "Profile Completion", - "completeProfile": "Complete Profile", - "personalInformation": "Personal Information", - "basicDetails": "Basic Details", - "address": "Address", - "contactDetails": "Contact Details", - "familyDetails": "Family Members", - "effectiveDate": "Effective Date", - "country": "Country" - }, - "clicked": { - "zero": "You clicked {} times!", - "one": "You clicked {} time!", - "two": "You clicked {} times!", - "few": "You clicked {} times!", - "many": "You clicked {} times!", - "other": "You clicked {} times!" - }, - "gender": { - "male": "Hi man ;) ", - "female": "Hello girl :)", - "with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"} - }, - "reset_locale": "Reset Language", - "chat": "Chat", - "mychats": "My Chats", - "createNewChat": "Create New Chat", - "brainMarathon": "Brain Marathon", - "contestTopicAbout": "Contest Topic will be about:", - "gameDate": "Game Date:", - "gameTime": "Game Time:", - "joinMarathon": "Join Marathon", - "joinDemoMarathon": "Join Demo Marathon", - "demo": "Demo", - "minutes": "Minutes", - "seconds": "Seconds", - "note": "Note:", - "demoMarathonNoteP1": "You can play the demo Marathon to learn how it works. You can join the Marathon", - "demoMarathonNoteP2": "5 Minutes", - "demoMarathonNoteP3": "before the actual time.", - "sponsoredBy": "Sponsored By:", - "question": "Question", - "marathoners": "Marathoners", - "marathoner": "Marathoner", - "prize": "Prize:", - "advancedSearch": "Advanced Search", - "openNot": "Open Notifications", - "fyi": "FYI Notifications", - "toDo": "To Do Notifications", - "all": "All Notifications", - "meNot": "Notifications from Me", - "view": "View", - "fromUserName": "From User Name", - "sentDate": "Sent Date", - "itemTypeDisplayName": "Item Type Display Name", - "none": "None", - "winnerSelection": "Winner Selection", - "qualifiers": "Qualifiers", - "qualifier": "Qualifier", - "getReadyForContest": "Get Ready for the coming contest:", - "winnerSelectedRandomly": "The winner will be selected randomly among the qualifiers.", - "fingersCrossed": "Fingers Crossed!!!", - "congrats": "Congratulations!!!", - "otp": "OTP", - "verification": "Verification", - "resend": "Resend", - "codeExpire": "The verification code has been expired", - "allQuestionsCorrect": "You have answered all questions correct", - "typeheretoreply": "Type here to reply", - "favorite": "My Favorites", - "searchfromchat": "Search from chat", - "yourAnswerCorrect": "Your answer is correct", - "youMissedTheQuestion": "You ran out of time. You are out of the game. But you can continue as a viewer.", - "wrongAnswer": "Your answer is Incorrect. You are out of the game. But you can continue as a viewer.", - "oops": "Ooopsss!!!!", - "winner": "WINNER", - "youWantToLeaveMarathon": "Are you sure you want to go back? You will be out of the contest.", - "ourSponsor": "Our Sponsor:", - "startingIn": "Starting in", - "youAreOutOfContest": "You are out of the contest.", - "winners": "WINNERS!!!", - "expireAfter": "Expires After", - "oneWeek": "1 Week", - "twoWeek": "2 Week", - "noUpcoming": "There is no upcoming", - "fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.", - "noWinner": "Sad! No one won today.", - "myTeam": "My Team", - "youCanPlayDemo": "But you can play demo", - "group": "Groups", - "searchGroup": "Search Group", - "connectHmgWifi": "Connect HMG WIFI", - "connectedHmgWifi": "Connected HMG WIFI", - "itgForms": "ITG Forms", - "resetAdPassword": "Reset AD Password", - "myDocuments": "My Documents", - "requiredDocuments": "Required Documents", - "optionalDocuments": "Optional Documents", - "allDocuments": "All\nDocuments", - "expiredDocuments": "Expired\nDocuments", - "missingDocuments": "Missing\nDocuments", - "uploadedDocuments": "Uploaded\nDocuments", - "manage": "Manage", - "members": "Members", - "areYouSureWantTodelete": "Are you sure want to delete?", - "groupMembers": "Group Members", - "manageGroup": "Manage Group", - "admin": "Admin", - "addUsers": "Add users to the group", - "editGroups": "Edit Group", - "groupNameshouldbe": "Group name should be minimum 10 character long", - "enterGroupName": "Please enter valid group Name", - "groupName": "Group Name", - "enterGroupNamePlease": "Please enter group name", - "audioCall": "Audio Call", - "videoCall": "Video Call", - "shareScreen": "Share Screen", - "searchByUserName": "Search By Username", - "userSearch": "User Search", - "userName": "User Name", - "userId": "UserID", - "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", - "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", - "generate": "Generate", - "paymentRequest":"Pay Request", - "paymentDetails":"Payment Details", - "requestNo":"Request No", - "requesterEmpNum":"Requester Employee Num", - "requesterEmpName":"Requester Employee Name", - "prepareEmpName":"Prepare Employee Name", - "requesterPositionName":"Requester Position Name", - "preparePositionName":"Prepare Position Name", - "requesterPayrollName":"Requester Payroll Name", - "payingORGName":"Paying Organization Name", - "requestAmount":"Request Amount", - "typeofPayment":"Type of Payment", - "beneficiaryDetails":"Beneficiary Details", - "beneficiaryName":"Beneficiary Name", - "idIqama":"Saudi ID / Iqama", - "beneficiaryBankName":"Beneficiary Bank Name", - "sadadNumber":"Sadad Number", - "beneficiaryIBAN":"Beneficiary IBAN", - "purchaseOrders":"Purchase Orders", - "approvalDate":"Approval Date", - "pOAmount":"PO Amount", - "versionStatus":"Version Status", - "supplierNo":"Supplier No", - "general":"General", - "prepareEmpNum":"Prepare Employee Num", - "requesterOperatingUnit":"Requester Operating Unit", - "supplierInfo" : "Supplier Information", - "supplierNum": "Supplier Number", - "supplierAcNo": "Supplier Account Number", - "supplierAcName" : 'Supplier Account Name', - "supplierIBAN" : 'Supplier IBAN', - "supplierCRNo" : 'CR Number', - "suppliedAcNo" : 'Supplied Account No.', - "patientRefundInvoice" : 'Patient Refund Invoice', - "patientNumber" : 'Patient Number', - "patientName" : 'Patient Name', - "invoiceDate" : 'Invoice Date', - "refundInvoice" : 'Refund Invoice', - "hospitalClinic" : 'Hospital Clinic', - - - - }; - static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; + "contactDetails": "Contact Details", + "familyDetails": "Family Members", + "effectiveDate": "Effective Date", + "country": "Country" + }, + "clicked": { + "zero": "You clicked {} times!", + "one": "You clicked {} time!", + "two": "You clicked {} times!", + "few": "You clicked {} times!", + "many": "You clicked {} times!", + "other": "You clicked {} times!" + }, + "gender": { + "male": "Hi man ;) ", + "female": "Hello girl :)", + "with_arg": { + "male": "Hi man ;) {}", + "female": "Hello girl :) {}" + } + }, + "reset_locale": "Reset Language", + "chat": "Chat", + "mychats": "My Chats", + "createNewChat": "Create New Chat", + "brainMarathon": "Brain Marathon", + "contestTopicAbout": "Contest Topic will be about:", + "gameDate": "Game Date:", + "gameTime": "Game Time:", + "joinMarathon": "Join Marathon", + "joinDemoMarathon": "Join Demo Marathon", + "demo": "Demo", + "minutes": "Minutes", + "seconds": "Seconds", + "note": "Note:", + "demoMarathonNoteP1": "You can play the demo Marathon to learn how it works. You can join the Marathon", + "demoMarathonNoteP2": "5 Minutes", + "demoMarathonNoteP3": "before the actual time.", + "sponsoredBy": "Sponsored By:", + "question": "Question", + "marathoners": "Marathoners", + "marathoner": "Marathoner", + "prize": "Prize:", + "advancedSearch": "Advanced Search", + "openNot": "Open Notifications", + "fyi": "FYI Notifications", + "toDo": "To Do Notifications", + "all": "All Notifications", + "meNot": "Notifications from Me", + "view": "View", + "fromUserName": "From User Name", + "sentDate": "Sent Date", + "itemTypeDisplayName": "Item Type Display Name", + "none": "None", + "winnerSelection": "Winner Selection", + "qualifiers": "Qualifiers", + "qualifier": "Qualifier", + "getReadyForContest": "Get Ready for the coming contest:", + "winnerSelectedRandomly": "The winner will be selected randomly among the qualifiers.", + "fingersCrossed": "Fingers Crossed!!!", + "congrats": "Congratulations!!!", + "otp": "OTP", + "verification": "Verification", + "resend": "Resend", + "codeExpire": "The verification code has been expired", + "allQuestionsCorrect": "You have answered all questions correct", + "typeheretoreply": "Type here to reply", + "favorite": "My Favorites", + "searchfromchat": "Search from chat", + "yourAnswerCorrect": "Your answer is correct", + "youMissedTheQuestion": "You ran out of time. You are out of the game. But you can continue as a viewer.", + "wrongAnswer": "Your answer is Incorrect. You are out of the game. But you can continue as a viewer.", + "oops": "Ooopsss!!!!", + "winner": "WINNER", + "youWantToLeaveMarathon": "Are you sure you want to go back? You will be out of the contest.", + "ourSponsor": "Our Sponsor:", + "startingIn": "Starting in", + "youAreOutOfContest": "You are out of the contest.", + "winners": "WINNERS!!!", + "expireAfter": "Expires After", + "oneWeek": "1 Week", + "twoWeek": "2 Week", + "noUpcoming": "There is no upcoming", + "fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.", + "noWinner": "Sad! No one won today.", + "myTeam": "My Team", + "youCanPlayDemo": "But you can play demo", + "group": "Groups", + "searchGroup": "Search Group", + "connectHmgWifi": "Connect HMG WIFI", + "connectedHmgWifi": "Connected HMG WIFI", + "itgForms": "ITG Forms", + "resetAdPassword": "Reset AD Password", + "myDocuments": "My Documents", + "requiredDocuments": "Required Documents", + "optionalDocuments": "Optional Documents", + "allDocuments": "All\nDocuments", + "expiredDocuments": "Expired\nDocuments", + "missingDocuments": "Missing\nDocuments", + "uploadedDocuments": "Uploaded\nDocuments", + "manage": "Manage", + "members": "Members", + "areYouSureWantTodelete": "Are you sure want to delete?", + "groupMembers": "Group Members", + "manageGroup": "Manage Group", + "admin": "Admin", + "addUsers": "Add users to the group", + "editGroups": "Edit Group", + "groupNameshouldbe": "Group name should be minimum 10 character long", + "enterGroupName": "Please enter valid group Name", + "groupName": "Group Name", + "enterGroupNamePlease": "Please enter group name", + "audioCall": "Audio Call", + "videoCall": "Video Call", + "shareScreen": "Share Screen", + "searchByUserName": "Search By Username", + "userSearch": "User Search", + "userName": "User Name", + "userId": "UserID", + "open": "open", + "addAtLeastOneAttachment": "Please add at least one attachment.", + "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", + "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", + "requesterOperatingUnit": "Requester Operating Unit", + "prepareEmpNum": "Prepare Employee Num", + "supplierInfo": "Supplier Information", + "supplierAcNo": "Supplier Account No", + "supplierAcName": "Supplier Account Name", + "supplierIBAN": "Supplier IBAN", + "supplierCRNo": "CR Number", + "suppliedAcNo": "Supplied Account No.", + "patientRefundInvoice": "Patient Refund Invoice", + "patientNumber": "Patient Number", + "patientName": "Patient Name", + "invoiceDate": "Invoice Date", + "refundInvoice": "Refund Invoice", + "hospitalClinic": "Hospital Clinic", + "graphicalAnalysis": "Graphical Analysis", + "itemHistoryAnalysis": "Item History Analysis", + "pOno": "P.O #", + "oprUnit": "Opr. Unit", + "qtyOrdered": "Qty. Ordered", + "qtyReceived": "Qty. Received", + "bonusQty": "Bonus Qty.", + "balQty": "Bal. Qty." +}; +static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 9faea5a..c372a3a 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -98,6 +98,7 @@ abstract class LocaleKeys { static const reject = 'reject'; static const approve = 'approve'; static const cancel = 'cancel'; + static const generate = 'generate'; static const requestedItems = 'requestedItems'; static const request = 'request'; static const myRequest = 'myRequest'; @@ -403,7 +404,6 @@ abstract class LocaleKeys { static const purchaseOrder = 'purchaseOrder'; static const ITGForms = 'ITGForms'; static const itemCreation = 'itemCreation'; - static const paymentRequest = 'paymentRequest'; static const stamp = 'stamp'; static const addFavoriteList = 'addFavoriteList'; static const feedbackUserExperience = 'feedbackUserExperience'; @@ -527,67 +527,31 @@ abstract class LocaleKeys { static const expiredDocuments = 'expiredDocuments'; static const missingDocuments = 'missingDocuments'; static const uploadedDocuments = 'uploadedDocuments'; - - static const manage = 'manage'; - static const members = 'members'; - static const areYouSureWantTodelete = 'areYouSureWantTodelete'; - static const groupMembers = "groupMembers"; - static const manageGroup = "manageGroup"; - static const admin = "admin"; - static const addUsers ="addUsers"; - static const editGroups ="editGroups"; - static const groupNameshouldbe ="groupNameshouldbe"; - static const enterGroupName ="enterGroupName"; - static const groupName ="groupName"; - static const enterGroupNamePlease ="enterGroupNamePlease"; - static const audioCall = 'audioCall'; - static const videoCall ='videoCall'; - static const shareScreen ='shareScreen'; - static const searchByUserName ='searchByUserName'; - static const userSearch ='userSearch'; - static const userName ='userName'; - static const userId ='userId'; - static const addAtLeastOneAttachment ='addAtLeastOneAttachment'; - static const pleaseClickButtonToJoinMarathon ='pleaseClickButtonToJoinMarathon'; - static const youCannotJoinTheMarathon ='youCannotJoinTheMarathon'; - static const open ='open'; - static const generate = 'generate'; - static const paymentDetails ='paymentDetails'; - static const requestNo ='requestNo'; - static const requesterEmpNum ='requesterEmpNum'; - static const requesterEmpName ='requesterEmpName'; - static const prepareEmpName ='prepareEmpName'; - static const requesterPositionName ='requesterPositionName'; - static const preparePositionName ='preparePositionName'; - static const requesterPayrollName ='requesterPayrollName'; - static const payingORGName ='payingORGName'; - static const requestAmount ='requestAmount'; - static const typeofPayment ='typeofPayment'; - static const beneficiaryDetails ='beneficiaryDetails'; - static const beneficiaryName ='beneficiaryName'; - static const idIqama ='idIqama'; - static const beneficiaryBankName ='beneficiaryBankName'; - static const sadadNumber ='sadadNumber'; - static const beneficiaryIBAN ='beneficiaryIBAN'; - static const purchaseOrders ='purchaseOrders'; - static const pOAmount ='pOAmount'; - static const approvalDate ='approvalDate'; - static const versionStatus ='versionStatus'; - static const supplierNo ='supplierNo'; - static const general ="general"; + static const addAtLeastOneAttachment = 'addAtLeastOneAttachment'; + static const pleaseClickButtonToJoinMarathon = 'pleaseClickButtonToJoinMarathon'; + static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon'; + static const open = 'open'; + static const requesterOperatingUnit = 'requesterOperatingUnit'; + static const prepareEmpNum = 'prepareEmpNum'; static const supplierInfo = 'supplierInfo'; static const supplierAcNo = 'supplierAcNo'; static const supplierAcName = 'supplierAcName'; - static const supplierIBAN = 'Supplier IBAN'; - static const supplierCRNo = 'CR Number'; - static const suppliedAcNo = 'Supplied Account No.'; - static const patientRefundInvoice = "patientRefundInvoice"; - static const patientNumber = 'Patient Number'; - static const patientName = 'Patient Name'; - static const invoiceDate = 'Invoice Date'; - static const refundInvoice = 'Refund Invoice'; - static const hospitalClinic = 'Hospital Clinic'; - static const requesterOperatingUnit ='requesterOperatingUnit'; - static const prepareEmpNum ='prepareEmpNum'; + static const supplierIBAN = 'supplierIBAN'; + static const supplierCRNo = 'supplierCRNo'; + static const suppliedAcNo = 'suppliedAcNo'; + static const patientRefundInvoice = 'patientRefundInvoice'; + static const patientNumber = 'patientNumber'; + static const patientName = 'patientName'; + static const invoiceDate = 'invoiceDate'; + static const refundInvoice = 'refundInvoice'; + static const hospitalClinic = 'hospitalClinic'; + static const graphicalAnalysis = 'graphicalAnalysis'; + static const itemHistoryAnalysis = 'itemHistoryAnalysis'; + static const pOno = 'pOno'; + static const oprUnit = 'oprUnit'; + static const qtyOrdered = 'qtyOrdered'; + static const qtyReceived = 'qtyReceived'; + static const bonusQty = 'bonusQty'; + static const balQty = 'balQty'; } diff --git a/lib/ui/work_list/item_history_screen.dart b/lib/ui/work_list/item_history_screen.dart index 7490d38..71cea08 100644 --- a/lib/ui/work_list/item_history_screen.dart +++ b/lib/ui/work_list/item_history_screen.dart @@ -2,7 +2,8 @@ import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; -import 'package:easy_localization/src/public_ext.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart'; @@ -60,13 +61,21 @@ class _ItemHistoryScreenState extends State { int tabIndex = 0; PageController controller = PageController(); + final ScrollController _horizontalScrollController = ScrollController(); + final ScrollController _horizontalHeaderScrollController = ScrollController(); + @override void initState() { super.initState(); + _horizontalScrollController.addListener(() { + _horizontalHeaderScrollController.jumpTo(_horizontalScrollController.offset); + }); } @override void dispose() { + _horizontalScrollController.dispose(); + _horizontalHeaderScrollController.dispose(); super.dispose(); actionHistoryList.clear(); } @@ -129,23 +138,231 @@ class _ItemHistoryScreenState extends State { } } + TableRow rowChildren(GetPoItemHistoryList poData, int index) { + return TableRow( + decoration: BoxDecoration(color: index % 2 == 0 ? Colors.white : Colors.grey[100]), + children: [ + rowCell(poData.cREATIONDATE!, index), + rowCell(poData.pURCHASEPRICE!.toString(), index), + rowCell(poData.sUPPLIER!, index), + rowCell(poData.pONUMBER!.toString(), index), + rowCell(poData.oUNAME!, index), + rowCell(poData.rEVISIONNUM!.toString(), index), + rowCell(poData.bUYER!, index), + rowCell(poData.uOM!, index), + rowCell(poData.qUANTITYORDERED!.toString(), index), + rowCell(poData.qUANTITYRECEIVED!.toString(), index), + rowCell(poData.bONUSQUANTITY!.toString(), index), + rowCell(poData.dISCOUNTPERCENTAGE!.toString(), index), + rowCell(poData.bALANCEQUANTITY!.toString(), index), + rowCell(poData.nETPRICE!.toString(), index), + rowCell(poData.cLOSEDCODE!, index), + ], + ); + } + + Widget rowCell(String data, int index) { + return TableCell( + verticalAlignment: TableCellVerticalAlignment.middle, + child: Center( + child: Text( + data, + style: TextStyle(fontSize: 12, color: MyColors.normalTextColor, fontWeight: FontWeight.w500), + ), + + // data.toText12(color: MyColors.normalTextColor), + ).paddingAll(8)); + } + + Widget headerCell(String data) { + return Container( + padding: const EdgeInsets.only(top: 16, bottom: 16, left: 8, right: 8), + width: 120, + alignment: Alignment.center, + decoration: BoxDecoration(color: Colors.grey[300]), + child: data.toText14(color: MyColors.darkIconColor), + ); + } + + List gradientColors = [MyColors.gradiantEndColor, MyColors.gradiantEndColor]; + + LineChartData drawLineChart(List spots, List reversedList) { + return LineChartData( + lineTouchData: LineTouchData(enabled: true, touchTooltipData: LineTouchTooltipData(tooltipBgColor: Colors.grey[300])), + gridData: FlGridData( + show: true, + drawHorizontalLine: true, + drawVerticalLine: true, + verticalInterval: 1, + horizontalInterval: 1, + getDrawingVerticalLine: (value) { + return FlLine(color: Color(0xff37434d), strokeWidth: .3); + }, + getDrawingHorizontalLine: (value) { + return FlLine(color: Color(0xff37434d), strokeWidth: .3); + }, + ), + titlesData: FlTitlesData( + show: true, + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + reservedSize: 30, + interval: 1, + getTitlesWidget: (double value, TitleMeta meta) { + return SideTitleWidget( + axisSide: meta.axisSide, + child: Text(reversedList[int.parse(meta.formattedValue)].cREATIONDATE!, style: TextStyle(fontSize: 10)), + ); + })), + leftTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + reservedSize: 30, + interval: 1, + getTitlesWidget: (double value, TitleMeta meta) { + return SideTitleWidget( + axisSide: meta.axisSide, + child: Text(meta.formattedValue, style: TextStyle(fontSize: 10)), + ); + })), + topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)), + rightTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + reservedSize: 15, + getTitlesWidget: (double value, TitleMeta meta) { + return SideTitleWidget( + axisSide: meta.axisSide, + child: Text("", style: TextStyle(fontSize: 10)), + ); + })), + ), + borderData: FlBorderData(show: true, border: Border.all(color: const Color(0xff37434d))), + minX: 0, + maxX: poItemHistoryList.length.toDouble() - 1, + minY: poItemHistoryList.map((e) => e.pURCHASEPRICE!.toDouble()).reduce((curr, next) => curr < next ? curr : next) - 1, + maxY: poItemHistoryList.map((e) => e.pURCHASEPRICE!.toDouble()).reduce((curr, next) => curr > next ? curr : next) + 1, + lineBarsData: [ + LineChartBarData( + spots: spots, + isCurved: true, + gradient: LinearGradient( + colors: [ + ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!, + ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!, + ], + ), + barWidth: 2, + isStrokeCapRound: true, + dotData: FlDotData(show: true), + belowBarData: BarAreaData( + show: true, + gradient: LinearGradient( + colors: [ + ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!.withOpacity(0.1), + ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!.withOpacity(0.1), + ], + ), + ), + ), + ], + ); + } + @override Widget build(BuildContext context) { loadData(); + Widget? chartWidget; + + if (_screenParams!.isItemHistory && poItemHistoryList.isNotEmpty) { + try { + List reversedList = poItemHistoryList.reversed.toList(); + List dataPoints = List.generate( + reversedList.length, + (index) => FlSpot(index.toDouble(), reversedList[index].pURCHASEPRICE!.toDouble()), + ); + + double chartWidth = dataPoints.length * 70.0; + chartWidget = Column( + mainAxisSize: MainAxisSize.min, + children: [ + LocaleKeys.graphicalAnalysis.tr().toText14(color: MyColors.darkIconColor), + SizedBox( + height: 400, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + width: chartWidth, + padding: const EdgeInsets.all(16.0), + child: LineChart(drawLineChart(dataPoints, reversedList)), + ), + ), + ), + ], + ); + } catch (ex) {} + } + return Scaffold( appBar: AppBarWidget(context, title: _screenParams?.title ?? ""), backgroundColor: Colors.white, - body: ListView( - padding: _screenParams!.isPRInfo ? const EdgeInsets.all(0) : const EdgeInsets.all(21), - physics: const NeverScrollableScrollPhysics(), - children: [ - if (_screenParams!.isPRInfo) prLinesDataView(), - if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData(), - if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData(), - if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData(), - if (moItemHistoryList.isEmpty && poItemHistoryList.isEmpty && quotationAnalysisList.isEmpty && !_screenParams!.isPRInfo) Utils.getNoDataWidget(context), - ], - ), + body: (_screenParams!.isItemHistory && poItemHistoryList.isNotEmpty) + ? Column( + children: [ + if (chartWidget != null) chartWidget, + if (poItemHistoryList.isNotEmpty) ...[ + LocaleKeys.itemHistoryAnalysis.tr().toText14(color: MyColors.darkIconColor), + 16.height, + SingleChildScrollView( + scrollDirection: Axis.horizontal, + physics: const NeverScrollableScrollPhysics(), + controller: _horizontalHeaderScrollController, + child: Row( + children: [ + headerCell(LocaleKeys.creationDate.tr()), + headerCell(LocaleKeys.purchasePrice.tr()), + headerCell(LocaleKeys.supplier.tr()), + headerCell(LocaleKeys.pOno.tr()), + headerCell(LocaleKeys.oprUnit.tr()), + headerCell(LocaleKeys.revision.tr()), + headerCell(LocaleKeys.buyer.tr()), + headerCell(LocaleKeys.uom.tr()), + headerCell(LocaleKeys.qtyOrdered.tr()), + headerCell(LocaleKeys.qtyReceived.tr()), + headerCell(LocaleKeys.bonusQty.tr()), + headerCell(LocaleKeys.discountPer.tr()), + headerCell(LocaleKeys.balQty.tr()), + headerCell(LocaleKeys.netPrice.tr()), + headerCell(LocaleKeys.closureStatus.tr()), + ], + ), + ), + SingleChildScrollView( + scrollDirection: Axis.vertical, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + controller: _horizontalScrollController, + child: Table( + defaultColumnWidth: const FixedColumnWidth(120.0), + children: [for (int index = 0; index < poItemHistoryList.length; index++) rowChildren(poItemHistoryList[index], index)], + ), + ), + ).expanded, + ], + ], + ) + : ListView( + padding: _screenParams!.isPRInfo ? const EdgeInsets.all(0) : const EdgeInsets.all(21), + // physics: const NeverScrollableScrollPhysics(), + children: [ + if (_screenParams!.isPRInfo) prLinesDataView(), + if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData(), + if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData(), + if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData(), + if (moItemHistoryList.isEmpty && poItemHistoryList.isEmpty && quotationAnalysisList.isEmpty && !_screenParams!.isPRInfo) Utils.getNoDataWidget(context), + ], + ), ); } diff --git a/pubspec.yaml b/pubspec.yaml index 2bcc749..687a3c0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -76,6 +76,7 @@ dependencies: flutter_rating_bar: ^4.0.1 auto_size_text: ^3.0.0 pull_to_refresh: ^2.0.0 + fl_chart: ^0.62.0 # lottie json animations lottie: any # Marathon Card Swipe From 8e49df98a2a59c2aef9d05f020ec995e3ae6dcdb Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 25 Nov 2024 11:07:21 +0300 Subject: [PATCH 05/39] translation issue fixed. --- assets/langs/ar-SA.json | 52 +++++++++++++++++-- assets/langs/en-US.json | 27 +++++++++- lib/generated/codegen_loader.g.dart | 79 +++++++++++++++++++++++++++-- lib/generated/locale_keys.g.dart | 50 ++++++++++++++++-- 4 files changed, 195 insertions(+), 13 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 12c1eb7..5220ae9 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -4,7 +4,10 @@ "arabic": "عربي", "login": "تسجيل الدخول", "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", + "userId": "UserID", "username": "اسم المستخدم", + "userName": "اسم المستخدم", + "userSearch": "User Search", "password": "كلمة المرور", "welcomeBack": "مرحبا بعودتك", "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", @@ -97,7 +100,6 @@ "reject": "يرفض", "approve": "يوافق", "cancel": "إلغاء", - "generate": "يولد", "requestedItems": "العناصر المطلوبة", "request": "طلب", "myRequest": "طلبي", @@ -542,9 +544,34 @@ "missingDocuments": "مستندات مفقودة", "uploadedDocuments": "المستندات التي تم تحميلها", "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.", - "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", - "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "open": "يفتح", + "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", + "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", + "generate": "يولد", + "paymentRequest": "طلب الدفع", + "paymentDetails": "تفاصيل الدفع", + "requestNo": "رقم الطلب", + "requesterEmpNum": "رقم الموظف الذي قدم الطلب", + "requesterEmpName": "اسم الموظف مقدم الطلب", + "prepareEmpName": "إعداد اسم الموظف", + "requesterPositionName": "اسم الوظيفة لمقدم الطلب", + "preparePositionName": "إعداد اسم الوظيفة", + "requesterPayrollName": "اسم مقدم الطلب", + "payingORGName": "اسم المنظمة الدافعة", + "requestAmount": "مبلغ الطلب", + "typeofPayment": "نوع الدفع", + "beneficiaryDetails": "تفاصيل المستفيد", + "beneficiaryName": "اسم المستفيد", + "idIqama": "الهوية السعودية / الإقامة", + "beneficiaryBankName": "اسم البنك المستفيد", + "sadadNumber": "رقم سداد", + "beneficiaryIBAN": "رقم IBAN للمستفيد", + "purchaseOrders": "طلبات الشراء", + "approvalDate": "تاريخ الموافقة", + "pOAmount": "مبلغ الطلب", + "versionStatus": "حالة الإصدار", + "supplierNo": "رقم المورد", + "general": "عام", "requesterOperatingUnit": "وحدة تشغيل مقدم الطلب", "prepareEmpNum": "إعداد رقم الموظف", "supplierInfo": "معلومات المورد", @@ -566,5 +593,22 @@ "qtyOrdered": "الكمية المطلوبة", "qtyReceived": "الكمية المستلمة", "bonusQty": "كمية المكافأة", - "balQty": "كمية التوازن" + "balQty": "كمية التوازن", + "videoCall": "مكالمة فيديو", + "addUsers": "إضافة مستخدمين إلى المجموعة", + "admin": "مشرف", + "areYouSureWantTodelete": "هل أنت متأكد أنك تريد الحذف؟", + "Attendance": "الحضور", + "audioCall": "مكالمة صوتية", + "editGroups": "تعديل المجموعة", + "enterGroupName": "يرجى إدخال اسم المجموعة الصحيح", + "enterGroupNamePlease": "يرجى إدخال اسم المجموعة", + "groupMembers": "أعضاء المجموعة", + "groupName": "اسم المجموعة", + "groupNameshouldbe": "يجب أن يتكون اسم المجموعة من 10 أحرف على الأقل", + "manage": "إدارة", + "manageGroup": "إدارة المجموعة", + "members": "الأعضاء", + "searchByUserName": "البحث بواسطة اسم المستخدم", + "shareScreen": "مشاركة الشاشة" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 21e53de..7ea8af9 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -93,7 +93,6 @@ "whatsapp": "Whatsapp", "reject": "Reject", "approve": "Approve", - "generate": "Generate", "cancel": "Cancel", "requestedItems": "Requested Items", "request": "Request", @@ -303,6 +302,7 @@ "section": "Section", "topic": "Topic", "actionBy": "Action By", + "pending": "Pending", "pendingTransactions": "Pending Transactions", "selectRequestType": "Please select request type", "dateFrom": "Date From", @@ -565,6 +565,31 @@ "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", "requesterOperatingUnit": "Requester Operating Unit", + "generate": "Generate", + "paymentRequest": "Pay Request", + "paymentDetails": "Payment Details", + "requestNo": "Request No", + "requesterEmpNum": "Requester Employee Num", + "requesterEmpName": "Requester Employee Name", + "prepareEmpName": "Prepare Employee Name", + "requesterPositionName": "Requester Position Name", + "preparePositionName": "Prepare Position Name", + "requesterPayrollName": "Requester Payroll Name", + "payingORGName": "Paying Organization Name", + "requestAmount": "Request Amount", + "typeofPayment": "Type of Payment", + "beneficiaryDetails": "Beneficiary Details", + "beneficiaryName": "Beneficiary Name", + "idIqama": "Saudi ID / Iqama", + "beneficiaryBankName": "Beneficiary Bank Name", + "sadadNumber": "Sadad Number", + "beneficiaryIBAN": "Beneficiary IBAN", + "purchaseOrders": "Purchase Orders", + "approvalDate": "Approval Date", + "pOAmount": "PO Amount", + "versionStatus": "Version Status", + "supplierNo": "Supplier No", + "general": "General", "prepareEmpNum": "Prepare Employee Num", "supplierInfo": "Supplier Information", "supplierAcNo": "Supplier Account No", diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index aa3ed5c..36d809d 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -20,7 +20,10 @@ class CodegenLoader extends AssetLoader{ "arabic": "عربي", "login": "تسجيل الدخول", "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", + "userId": "UserID", "username": "اسم المستخدم", + "userName": "اسم المستخدم", + "userSearch": "User Search", "password": "كلمة المرور", "welcomeBack": "مرحبا بعودتك", "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", @@ -113,7 +116,6 @@ class CodegenLoader extends AssetLoader{ "reject": "يرفض", "approve": "يوافق", "cancel": "إلغاء", - "generate": "يولد", "requestedItems": "العناصر المطلوبة", "request": "طلب", "myRequest": "طلبي", @@ -558,9 +560,34 @@ class CodegenLoader extends AssetLoader{ "missingDocuments": "مستندات مفقودة", "uploadedDocuments": "المستندات التي تم تحميلها", "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.", - "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", - "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "open": "يفتح", + "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", + "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", + "generate": "يولد", + "paymentRequest": "طلب الدفع", + "paymentDetails": "تفاصيل الدفع", + "requestNo": "رقم الطلب", + "requesterEmpNum": "رقم الموظف الذي قدم الطلب", + "requesterEmpName": "اسم الموظف مقدم الطلب", + "prepareEmpName": "إعداد اسم الموظف", + "requesterPositionName": "اسم الوظيفة لمقدم الطلب", + "preparePositionName": "إعداد اسم الوظيفة", + "requesterPayrollName": "اسم مقدم الطلب", + "payingORGName": "اسم المنظمة الدافعة", + "requestAmount": "مبلغ الطلب", + "typeofPayment": "نوع الدفع", + "beneficiaryDetails": "تفاصيل المستفيد", + "beneficiaryName": "اسم المستفيد", + "idIqama": "الهوية السعودية / الإقامة", + "beneficiaryBankName": "اسم البنك المستفيد", + "sadadNumber": "رقم سداد", + "beneficiaryIBAN": "رقم IBAN للمستفيد", + "purchaseOrders": "طلبات الشراء", + "approvalDate": "تاريخ الموافقة", + "pOAmount": "مبلغ الطلب", + "versionStatus": "حالة الإصدار", + "supplierNo": "رقم المورد", + "general": "عام", "requesterOperatingUnit": "وحدة تشغيل مقدم الطلب", "prepareEmpNum": "إعداد رقم الموظف", "supplierInfo": "معلومات المورد", @@ -582,7 +609,24 @@ class CodegenLoader extends AssetLoader{ "qtyOrdered": "الكمية المطلوبة", "qtyReceived": "الكمية المستلمة", "bonusQty": "كمية المكافأة", - "balQty": "كمية التوازن" + "balQty": "كمية التوازن", + "videoCall": "مكالمة فيديو", + "addUsers": "إضافة مستخدمين إلى المجموعة", + "admin": "مشرف", + "areYouSureWantTodelete": "هل أنت متأكد أنك تريد الحذف؟", + "Attendance": "الحضور", + "audioCall": "مكالمة صوتية", + "editGroups": "تعديل المجموعة", + "enterGroupName": "يرجى إدخال اسم المجموعة الصحيح", + "enterGroupNamePlease": "يرجى إدخال اسم المجموعة", + "groupMembers": "أعضاء المجموعة", + "groupName": "اسم المجموعة", + "groupNameshouldbe": "يجب أن يتكون اسم المجموعة من 10 أحرف على الأقل", + "manage": "إدارة", + "manageGroup": "إدارة المجموعة", + "members": "الأعضاء", + "searchByUserName": "البحث بواسطة اسم المستخدم", + "shareScreen": "مشاركة الشاشة" }; static const Map en_US = { "mohemm": "Mohemm", @@ -679,7 +723,6 @@ static const Map en_US = { "whatsapp": "Whatsapp", "reject": "Reject", "approve": "Approve", - "generate": "Generate", "cancel": "Cancel", "requestedItems": "Requested Items", "request": "Request", @@ -889,6 +932,7 @@ static const Map en_US = { "section": "Section", "topic": "Topic", "actionBy": "Action By", + "pending": "Pending", "pendingTransactions": "Pending Transactions", "selectRequestType": "Please select request type", "dateFrom": "Date From", @@ -1151,6 +1195,31 @@ static const Map en_US = { "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", "requesterOperatingUnit": "Requester Operating Unit", + "generate": "Generate", + "paymentRequest": "Pay Request", + "paymentDetails": "Payment Details", + "requestNo": "Request No", + "requesterEmpNum": "Requester Employee Num", + "requesterEmpName": "Requester Employee Name", + "prepareEmpName": "Prepare Employee Name", + "requesterPositionName": "Requester Position Name", + "preparePositionName": "Prepare Position Name", + "requesterPayrollName": "Requester Payroll Name", + "payingORGName": "Paying Organization Name", + "requestAmount": "Request Amount", + "typeofPayment": "Type of Payment", + "beneficiaryDetails": "Beneficiary Details", + "beneficiaryName": "Beneficiary Name", + "idIqama": "Saudi ID / Iqama", + "beneficiaryBankName": "Beneficiary Bank Name", + "sadadNumber": "Sadad Number", + "beneficiaryIBAN": "Beneficiary IBAN", + "purchaseOrders": "Purchase Orders", + "approvalDate": "Approval Date", + "pOAmount": "PO Amount", + "versionStatus": "Version Status", + "supplierNo": "Supplier No", + "general": "General", "prepareEmpNum": "Prepare Employee Num", "supplierInfo": "Supplier Information", "supplierAcNo": "Supplier Account No", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index c372a3a..851a5cd 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -6,7 +6,10 @@ abstract class LocaleKeys { static const arabic = 'arabic'; static const login = 'login'; static const pleaseEnterLoginDetails = 'pleaseEnterLoginDetails'; + static const userId = 'userId'; static const username = 'username'; + static const userName = 'userName'; + static const userSearch = 'userSearch'; static const password = 'password'; static const welcomeBack = 'welcomeBack'; static const wouldYouLikeToLoginWithCurrentUsername = 'wouldYouLikeToLoginWithCurrentUsername'; @@ -98,7 +101,6 @@ abstract class LocaleKeys { static const reject = 'reject'; static const approve = 'approve'; static const cancel = 'cancel'; - static const generate = 'generate'; static const requestedItems = 'requestedItems'; static const request = 'request'; static const myRequest = 'myRequest'; @@ -528,9 +530,34 @@ abstract class LocaleKeys { static const missingDocuments = 'missingDocuments'; static const uploadedDocuments = 'uploadedDocuments'; static const addAtLeastOneAttachment = 'addAtLeastOneAttachment'; - static const pleaseClickButtonToJoinMarathon = 'pleaseClickButtonToJoinMarathon'; - static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon'; static const open = 'open'; + static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon'; + static const pleaseClickButtonToJoinMarathon = 'pleaseClickButtonToJoinMarathon'; + static const generate = 'generate'; + static const paymentRequest = 'paymentRequest'; + static const paymentDetails = 'paymentDetails'; + static const requestNo = 'requestNo'; + static const requesterEmpNum = 'requesterEmpNum'; + static const requesterEmpName = 'requesterEmpName'; + static const prepareEmpName = 'prepareEmpName'; + static const requesterPositionName = 'requesterPositionName'; + static const preparePositionName = 'preparePositionName'; + static const requesterPayrollName = 'requesterPayrollName'; + static const payingORGName = 'payingORGName'; + static const requestAmount = 'requestAmount'; + static const typeofPayment = 'typeofPayment'; + static const beneficiaryDetails = 'beneficiaryDetails'; + static const beneficiaryName = 'beneficiaryName'; + static const idIqama = 'idIqama'; + static const beneficiaryBankName = 'beneficiaryBankName'; + static const sadadNumber = 'sadadNumber'; + static const beneficiaryIBAN = 'beneficiaryIBAN'; + static const purchaseOrders = 'purchaseOrders'; + static const approvalDate = 'approvalDate'; + static const pOAmount = 'pOAmount'; + static const versionStatus = 'versionStatus'; + static const supplierNo = 'supplierNo'; + static const general = 'general'; static const requesterOperatingUnit = 'requesterOperatingUnit'; static const prepareEmpNum = 'prepareEmpNum'; static const supplierInfo = 'supplierInfo'; @@ -553,5 +580,22 @@ abstract class LocaleKeys { static const qtyReceived = 'qtyReceived'; static const bonusQty = 'bonusQty'; static const balQty = 'balQty'; + static const videoCall = 'videoCall'; + static const addUsers = 'addUsers'; + static const admin = 'admin'; + static const areYouSureWantTodelete = 'areYouSureWantTodelete'; + static const Attendance = 'Attendance'; + static const audioCall = 'audioCall'; + static const editGroups = 'editGroups'; + static const enterGroupName = 'enterGroupName'; + static const enterGroupNamePlease = 'enterGroupNamePlease'; + static const groupMembers = 'groupMembers'; + static const groupName = 'groupName'; + static const groupNameshouldbe = 'groupNameshouldbe'; + static const manage = 'manage'; + static const manageGroup = 'manageGroup'; + static const members = 'members'; + static const searchByUserName = 'searchByUserName'; + static const shareScreen = 'shareScreen'; } From d4e17e7f0d2f6026f7f44f056f30a4cfa7a43f5f Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 27 Nov 2024 16:07:34 +0300 Subject: [PATCH 06/39] dynamic form parent value added. (saudi council employee) --- lib/api/my_attendance_api_client.dart | 9 ++++-- lib/classes/consts.dart | 4 +-- .../dynamic_screens/dynamic_input_screen.dart | 29 +++++++++++++++---- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/lib/api/my_attendance_api_client.dart b/lib/api/my_attendance_api_client.dart index 78742a3..24cf6c0 100644 --- a/lib/api/my_attendance_api_client.dart +++ b/lib/api/my_attendance_api_client.dart @@ -40,14 +40,19 @@ class MyAttendanceApiClient { }, url, postParams); } - Future> getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list, {String? empID, String? parentValue}) async { + Future> getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list, + {String? empID, String? parentValue, bool hasParent = false}) async { String url = "${ApiConsts.erpRest}GET_VALUE_SET_VALUES"; Map postParams = { "P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_PAGE_LIMIT": 1000, "P_PAGE_NUM": 1, - "P_PARENT_VALUE": empID != null ? parentValue : null, + "P_PARENT_VALUE": hasParent + ? parentValue + : empID != null + ? parentValue + : null, "P_SEGMENT_NAME": pSegmentName, "P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode, "P_DESC_FLEX_NAME": pDescFlexName, diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 7103dfd..170762c 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // 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://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 diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 4f67c62..ef88e11 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -97,7 +97,8 @@ class _DynamicInputScreenState extends State { SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp); Utils.hideLoading(context); await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, - arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit',isAttachmentMandatory: dynamicParams!.isAttachmentMandatory)); + arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit', + isAttachmentMandatory: dynamicParams!.isAttachmentMandatory)); if (!AppState().cancelRequestTrancsection) { return; } @@ -133,8 +134,27 @@ class _DynamicInputScreenState extends State { .toJson()) .toList(); + String? selectedEmp = dynamicParams!.selectedEmp; + bool hasParentId = false; + + if (segmentId.isNotEmpty && selectedEmp == null) { + for (var element in getEitDffStructureList!) { + try { + if (element.sEGMENTNAME == segmentId && selectedEmp == null) { + var selectedElement = element; + if (selectedElement.vALIDATIONTYPE == "Y" || selectedElement.vALIDATIONTYPE == "D") { + hasParentId = true; + break; + } + } + } catch (ex) { + print("err:$ex"); + } + } + } + List eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values, - empID: dynamicParams!.selectedEmp, parentValue: structureList.eSERVICESDV!.pVALUECOLUMNNAME); + empID: selectedEmp, parentValue: structureList.eSERVICESDV!.pVALUECOLUMNNAME, hasParent: hasParentId); List abc = genericResponseModel?.getEITDFFStructureList ?? []; getEitDffStructureList = abc; int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId); @@ -862,9 +882,8 @@ class _DynamicInputScreenState extends State { context: context, initialTime: time, builder: (cxt, child) { - return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: Localizations.override( - context: context, - locale: const Locale('en', 'US'),child: child ?? Container())); + return MediaQuery( + data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: Localizations.override(context: context, locale: const Locale('en', 'US'), child: child ?? Container())); }); if (picked != null && picked != time) { From 0da0ffd43e7ea1328e2e622e77d892bfa2083ed2 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 27 Nov 2024 16:47:50 +0300 Subject: [PATCH 07/39] itg form attachment overlapping issue fixed. --- lib/ui/work_list/itg_detail_screen.dart | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index 8cb7944..96139b4 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -642,16 +642,13 @@ class _ItgDetailScreenState extends State { void getItgRequestAttachments() async { try { - // Utils.showLoading(context); - itgFormAttachmentsList = + isAttachmentLoaded = false; + itgFormAttachmentsList.clear(); + List _itgFormAttachmentsList = (await WorkListApiClient().getITGFormAttachments(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"); - // } - // Utils.hideLoading(context); + if (!isAttachmentLoaded) { + itgFormAttachmentsList = _itgFormAttachmentsList; + } setState(() { isAttachmentLoaded = true; }); From b20e0a8c7bd3a6106651e26f0dad8db6a5d8a024 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 5 Dec 2024 13:42:04 +0300 Subject: [PATCH 08/39] updates --- assets/langs/ar-SA.json | 29 +++++++++++++----------- assets/langs/en-US.json | 27 +++++++++++----------- lib/widgets/item_detail_view_widget.dart | 3 ++- pubspec.yaml | 4 ++-- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 5220ae9..1eb7dde 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -100,6 +100,7 @@ "reject": "يرفض", "approve": "يوافق", "cancel": "إلغاء", + "generate": "يولد", "requestedItems": "العناصر المطلوبة", "request": "طلب", "myRequest": "طلبي", @@ -530,7 +531,7 @@ "noWinner": "حزين! لم يفز أحد اليوم.", "myTeam": "فريقي", "youCanPlayDemo": "لكن يمكنك لعب العرض", - "group": "مجموعة", + "group" : "مجموعة", "searchGroup": "مجموعة البحث", "connectHmgWifi": "قم بتوصيل HMG WIFI", "connectedHmgWifi": "اتصال HMG WIFI", @@ -544,6 +545,8 @@ "missingDocuments": "مستندات مفقودة", "uploadedDocuments": "المستندات التي تم تحميلها", "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.", + "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", + "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "open": "يفتح", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", @@ -572,20 +575,20 @@ "versionStatus": "حالة الإصدار", "supplierNo": "رقم المورد", "general": "عام", - "requesterOperatingUnit": "وحدة تشغيل مقدم الطلب", - "prepareEmpNum": "إعداد رقم الموظف", - "supplierInfo": "معلومات المورد", + "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", + "prepareEmpNum":"إعداد رقم الموظف", + "supplierInfo" : "معلومات المورد", "supplierAcNo": "رقم حساب المورد", "supplierAcName": "اسم حساب المورد", - "supplierIBAN": "رقم IBAN للمورد", - "supplierCRNo": "رقم السجل التجاري", - "suppliedAcNo": "رقم الحساب المقدم", - "patientRefundInvoice": "فاتورة استرداد الأموال للمريض", - "patientNumber": "رقم المريض", - "patientName": "اسم المريض", - "invoiceDate": "تاريخ الفاتورة", - "refundInvoice": "فاتورة الاسترجاع", - "hospitalClinic": "عيادة المستشفى", + "supplierIBAN" : "رقم IBAN للمورد", + "supplierCRNo" :"رقم السجل التجاري", + "suppliedAcNo" : "رقم الحساب المقدم", + "patientRefundInvoice" : "فاتورة استرداد الأموال للمريض", + "patientNumber" : "رقم المريض", + "patientName" : "اسم المريض", + "invoiceDate" : "تاريخ الفاتورة", + "refundInvoice" :"فاتورة الاسترجاع", + "hospitalClinic" : "عيادة المستشفى", "graphicalAnalysis": "التحليل الرسومي", "itemHistoryAnalysis": "تحليل تاريخ العنصر", "pOno": "امر شراء #", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 7ea8af9..03ae4d6 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -93,6 +93,7 @@ "whatsapp": "Whatsapp", "reject": "Reject", "approve": "Approve", + "generate": "Generate", "cancel": "Cancel", "requestedItems": "Requested Items", "request": "Request", @@ -564,7 +565,7 @@ "addAtLeastOneAttachment": "Please add at least one attachment.", "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", - "requesterOperatingUnit": "Requester Operating Unit", + "requesterOperatingUnit":"Requester Operating Unit", "generate": "Generate", "paymentRequest": "Pay Request", "paymentDetails": "Payment Details", @@ -590,19 +591,19 @@ "versionStatus": "Version Status", "supplierNo": "Supplier No", "general": "General", - "prepareEmpNum": "Prepare Employee Num", - "supplierInfo": "Supplier Information", + "prepareEmpNum":"Prepare Employee Num", + "supplierInfo" : "Supplier Information", "supplierAcNo": "Supplier Account No", - "supplierAcName": "Supplier Account Name", - "supplierIBAN": "Supplier IBAN", - "supplierCRNo": "CR Number", - "suppliedAcNo": "Supplied Account No.", - "patientRefundInvoice": "Patient Refund Invoice", - "patientNumber": "Patient Number", - "patientName": "Patient Name", - "invoiceDate": "Invoice Date", - "refundInvoice": "Refund Invoice", - "hospitalClinic": "Hospital Clinic", + "supplierAcName":"Supplier Account Name", + "supplierIBAN" : "Supplier IBAN", + "supplierCRNo" : "CR Number", + "suppliedAcNo" : "Supplied Account No.", + "patientRefundInvoice" : "Patient Refund Invoice", + "patientNumber" : "Patient Number", + "patientName" : "Patient Name", + "invoiceDate" : "Invoice Date", + "refundInvoice" :"Refund Invoice", + "hospitalClinic" : "Hospital Clinic", "graphicalAnalysis": "Graphical Analysis", "itemHistoryAnalysis": "Item History Analysis", "pOno": "P.O #", diff --git a/lib/widgets/item_detail_view_widget.dart b/lib/widgets/item_detail_view_widget.dart index 68b245a..f6797e8 100644 --- a/lib/widgets/item_detail_view_widget.dart +++ b/lib/widgets/item_detail_view_widget.dart @@ -86,7 +86,8 @@ class ItemDetailViewGridItem extends StatelessWidget { type != null ? type!.toLowerCase() == "table" ? getStringFromJSON(value!) - : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor)) + // : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 5)) + : (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 6) : Container(), ], ), diff --git a/pubspec.yaml b/pubspec.yaml index 687a3c0..0265525 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.7.96+1 +version: 3.7.98+1 environment: sdk: ">=2.16.0 <3.0.0" @@ -66,7 +66,7 @@ dependencies: month_picker_dialog_2: ^0.5.5 # open_file: ^3.2.1 open_filex: ^4.4.0 - wifi_iot: ^0.3.18 + wifi_iot: ^0.3.19+1 flutter_html: ^3.0.0-alpha.6 # flutter_barcode_scanner: ^2.0.0 qr_code_scanner: ^1.0.1 From cdd56b2a5a2ae2d5fc422e85229a80ab0989874c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 17 Dec 2024 16:40:25 +0300 Subject: [PATCH 09/39] Issue fixes & updates --- android/build.gradle | 2 +- .../leave_balance/leave_balance_screen.dart | 91 ++++++++++--------- lib/ui/login/login_screen.dart | 37 ++++---- lib/ui/work_list/itg_detail_screen.dart | 2 + .../worklist_fragments/actions_fragment.dart | 2 +- pubspec.yaml | 1 + 6 files changed, 74 insertions(+), 61 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 23ea6ba..abef75b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.20' + ext.kotlin_version = '1.8.20' repositories { google() mavenCentral() diff --git a/lib/ui/leave_balance/leave_balance_screen.dart b/lib/ui/leave_balance/leave_balance_screen.dart index 9fb925c..447767f 100644 --- a/lib/ui/leave_balance/leave_balance_screen.dart +++ b/lib/ui/leave_balance/leave_balance_screen.dart @@ -64,47 +64,56 @@ class _LeaveBalanceState extends State { context, title: LocaleKeys.leaveBalance.tr(), ), - body: absenceTransList == null - ? const SizedBox() - : (absenceTransList!.isEmpty - ? Utils.getNoDataWidget(context).paddingOnly(top: 50) - : ListView( - physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.all(21), - children: [ - BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true, selectedEmp: employeeId, showLoading: false), - 12.height, - ListView.separated( - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - padding: EdgeInsets.zero, - itemBuilder: (cxt, int index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.startDateT.tr(), absenceTransList![index].sTARTDATE ?? ""), - ItemDetailViewCol(LocaleKeys.endDateT.tr(), absenceTransList![index].eNDDATE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.absenceType.tr(), absenceTransList![index].aBSENCETYPE ?? ""), - ItemDetailViewCol(LocaleKeys.absenceCategory.tr(), absenceTransList![index].aBSENCECATEGORY ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.days.tr(), absenceTransList![index].aBSENCEDAYS?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.hours.tr(), absenceTransList![index].aBSENCEHOURS?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.approvalStatus.tr(), absenceTransList![index].aPPROVALSTATUS ?? ""), - ItemDetailViewCol(LocaleKeys.absenceStatus.tr(), absenceTransList![index].aBSENCESTATUS ?? ""), - isItLast: true, - ), - ], - ).objectContainerView(), - separatorBuilder: (cxt, index) => 12.height, - itemCount: absenceTransList!.length), - ], - )), + body: Column( + children: [ + Padding( + padding: const EdgeInsets.all(21.0), + child: BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true, selectedEmp: employeeId, showLoading: false), + ), + 12.height, + absenceTransList == null + ? const SizedBox() + : (absenceTransList!.isEmpty + ? Utils.getNoDataWidget(context).paddingOnly(top: 50) + : ListView( + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.all(21), + children: [ + // BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true, selectedEmp: employeeId, showLoading: false), + // 12.height, + ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.zero, + itemBuilder: (cxt, int index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.startDateT.tr(), absenceTransList![index].sTARTDATE ?? ""), + ItemDetailViewCol(LocaleKeys.endDateT.tr(), absenceTransList![index].eNDDATE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.absenceType.tr(), absenceTransList![index].aBSENCETYPE ?? ""), + ItemDetailViewCol(LocaleKeys.absenceCategory.tr(), absenceTransList![index].aBSENCECATEGORY ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.days.tr(), absenceTransList![index].aBSENCEDAYS?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.hours.tr(), absenceTransList![index].aBSENCEHOURS?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.approvalStatus.tr(), absenceTransList![index].aPPROVALSTATUS ?? ""), + ItemDetailViewCol(LocaleKeys.absenceStatus.tr(), absenceTransList![index].aBSENCESTATUS ?? ""), + isItLast: true, + ), + ], + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: absenceTransList!.length), + ], + )), + ], + ), floatingActionButton: Container( height: 54, width: 54, diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index d4f1644..c71ae7f 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -30,6 +30,7 @@ import 'package:mohem_flutter_app/models/member_login_list_model.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/input_widget.dart'; +import 'package:safe_device/safe_device.dart'; // import 'package:safe_device/safe_device.dart'; import 'package:wifi_iot/wifi_iot.dart'; @@ -70,26 +71,26 @@ class _LoginScreenState extends State { super.initState(); // hmsApiAvailability = HmsApiAvailability(); // checkFirebaseToken(); - // if (kReleaseMode) { - // checkDeviceSafety(); - // } + if (kReleaseMode) { + checkDeviceSafety(); + } } - // void checkDeviceSafety() async { - // try { - // isJailBroken = await SafeDevice.isJailBroken; - // isRealDevice = await SafeDevice.isRealDevice; - // if (Platform.isAndroid) { - // isOnExternalStorage = await SafeDevice.isOnExternalStorage; - // isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable; - // } - // if (isJailBroken || !isRealDevice || isOnExternalStorage || isDevelopmentModeEnable) { - // Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false); - // } - // } catch (error) { - // print(error); - // } - // } + void checkDeviceSafety() async { + try { + isJailBroken = await SafeDevice.isJailBroken; + isRealDevice = await SafeDevice.isRealDevice; + if (Platform.isAndroid) { + isOnExternalStorage = await SafeDevice.isOnExternalStorage; + isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable; + } + if (isJailBroken || !isRealDevice || isOnExternalStorage || isDevelopmentModeEnable) { + Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false); + } + } catch (error) { + print(error); + } + } @override void dispose() { diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index 96139b4..aaef95f 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -84,6 +84,7 @@ class _ItgDetailScreenState extends State { controller.jumpToPage(0); }); } catch (ex) { + setState(() {}); Utils.hideLoading(context); Utils.handleException(ex, context, null); } @@ -534,6 +535,7 @@ class _ItgDetailScreenState extends State { Utils.handleException(ex, context, null); } } + void performAnswerAction(String requestType, taskId, itemId, String employeeNumber, String comments) async { try { Utils.showLoading(context); diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index 41de635..29d5328 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -167,7 +167,7 @@ class ActionsFragment extends StatelessWidget { Duration duration = DateTime.now().difference(dateTimeFrom); return "Action duration: " + DateUtil.formatDuration(duration); } else { - if (actionHistoryList[index].nOTIFICATIONDATE!.isEmpty) { + if (actionHistoryList[index].nOTIFICATIONDATE!.isEmpty || actionHistoryList[index].aCTIONCODE! == "NO ACTION") { return ""; } else { DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!); diff --git a/pubspec.yaml b/pubspec.yaml index 0265525..a12c83a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -82,6 +82,7 @@ dependencies: # Marathon Card Swipe appinio_swiper: ^1.1.1 expandable: ^5.0.1 + safe_device: ^1.1.9 # networkImage cached_network_image: ^3.2.2 From 2682158590bb8da716634c905f2d062546a7ae30 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 19 Dec 2024 12:58:10 +0300 Subject: [PATCH 10/39] ERM Channel Video changes --- lib/classes/consts.dart | 4 +- .../itg/its_add_screen_video_image.dart | 168 +++++++++++------- lib/widgets/my_video_progress_indicator.dart | 105 +++++++++++ 3 files changed, 214 insertions(+), 63 deletions(-) create mode 100644 lib/widgets/my_video_progress_indicator.dart diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 170762c..7103dfd 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // 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://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 diff --git a/lib/ui/landing/itg/its_add_screen_video_image.dart b/lib/ui/landing/itg/its_add_screen_video_image.dart index cf2d92b..2095650 100644 --- a/lib/ui/landing/itg/its_add_screen_video_image.dart +++ b/lib/ui/landing/itg/its_add_screen_video_image.dart @@ -12,6 +12,7 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/models/itg/advertisement.dart' as ads; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/my_video_progress_indicator.dart'; import 'package:video_player/video_player.dart'; class ITGAdsScreen extends StatefulWidget { @@ -148,7 +149,35 @@ class _ITGAdsScreenState extends State { ? Lottie.asset(MyLottieConsts.audioPlaybackLottie) : AspectRatio( aspectRatio: _controller.value.aspectRatio, - child: VideoPlayer(_controller), + child: Stack( + alignment: Alignment.bottomCenter, + children: [ + VideoPlayer(_controller), + if (advertisementData?.isOptional ?? false) + Positioned( + top: 4, + right: 8, + child: Container( + padding: const EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.5), + borderRadius: BorderRadius.circular(30)), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text(AppState().isArabic(context) ? "يتخطى" : "Skip"), + Icon(Icons.skip_next), + ], + ), + ).onPress(() { + Navigator.pop(context); + DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Skip").then((value) { + logger.d(value); + }); + }), + ), + ], + ), ), ), 30.height, @@ -159,70 +188,87 @@ class _ITGAdsScreenState extends State { textStyle: const TextStyle(color: Colors.white, fontSize: 16, letterSpacing: -0.48, fontWeight: FontWeight.bold), ), 50.height, - if (advertisementData?.isOptional ?? false) - DefaultButton(AppState().isArabic(context) ? "يتخطى" : "Skip", () async { - Navigator.pop(context); - DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Skip").then((value) { - logger.d(value); - }); - }).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8), + // if (advertisementData?.isOptional ?? false) + // DefaultButton(AppState().isArabic(context) ? "يتخطى" : "Skip", () async { + // Navigator.pop(context); + // DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Skip").then((value) { + // logger.d(value); + // }); + // }).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8), ValueListenableBuilder( valueListenable: hasTimerEnded, builder: (context, val, child) { - if (hasTimerEndedBool) { - return GridView.builder( - padding: EdgeInsets.zero, - itemCount: advertisementData?.actionButtonsColl!.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - String? btnText = AppState().isArabic(context) ? advertisementData?.actionButtonsColl![index].btnTextAr : advertisementData?.actionButtonsColl![index].btnTextEn; - return DefaultButton(btnText!, () async { - Navigator.pop(context); - DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, advertisementData?.actionButtonsColl![index].actionValue).then((value) { - logger.d(value); - }); - }).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8); - }, - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1, - childAspectRatio: (7.0), + // if (hasTimerEndedBool) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + MyVideoProgressIndicator( + _controller, + allowScrubbing: false, + padding: EdgeInsets.only(left: 60, right: 60), + ), + GridView.builder( + padding: EdgeInsets.zero, + itemCount: advertisementData?.actionButtonsColl!.length, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + String? btnText = AppState().isArabic(context) ? advertisementData?.actionButtonsColl![index].btnTextAr : advertisementData?.actionButtonsColl![index].btnTextEn; + return DefaultButton( + btnText!, + hasTimerEndedBool + ? () async { + Navigator.pop(context); + DashboardApiClient() + .setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, advertisementData?.actionButtonsColl![index].actionValue) + .then((value) { + logger.d(value); + }); + } + : null) + .paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8); + }, + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 1, + childAspectRatio: (7.0), + ), ), - ); - // Row( - // mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // Container(padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_up, color: MyColors.gradiantEndColor)) - // .onPress(() { - // try { - // Navigator.pop(context); - // DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Like").then((value) { - // logger.d(value); - // }); - // } catch (ex) { - // logger.wtf(ex); - // Utils.handleException(ex, context, null); - // } - // }), - // 20.width, - // Container( - // padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_down, color: MyColors.gradiantEndColor)) - // .onPress(() { - // try { - // Navigator.pop(context); - // DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Dislike").then((value) { - // logger.d(value); - // }); - // } catch (ex) { - // logger.wtf(ex); - // Utils.handleException(ex, context, null); - // } - // }), - // ], - // ); - } else { - return Container(); - } + ], + ); + // Row( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Container(padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_up, color: MyColors.gradiantEndColor)) + // .onPress(() { + // try { + // Navigator.pop(context); + // DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Like").then((value) { + // logger.d(value); + // }); + // } catch (ex) { + // logger.wtf(ex); + // Utils.handleException(ex, context, null); + // } + // }), + // 20.width, + // Container( + // padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_down, color: MyColors.gradiantEndColor)) + // .onPress(() { + // try { + // Navigator.pop(context); + // DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Dislike").then((value) { + // logger.d(value); + // }); + // } catch (ex) { + // logger.wtf(ex); + // Utils.handleException(ex, context, null); + // } + // }), + // ], + // ); + // } else { + // return Container(); + // } }, ), 20.height, diff --git a/lib/widgets/my_video_progress_indicator.dart b/lib/widgets/my_video_progress_indicator.dart new file mode 100644 index 0000000..a6e9172 --- /dev/null +++ b/lib/widgets/my_video_progress_indicator.dart @@ -0,0 +1,105 @@ +import 'package:flutter/material.dart'; +import 'package:video_player/video_player.dart'; + +class MyVideoProgressIndicator extends StatefulWidget { + const MyVideoProgressIndicator( + this.controller, { + Key? key, + this.colors = const VideoProgressColors(), + required this.allowScrubbing, + this.padding = const EdgeInsets.only(top: 5.0), + }) : super(key: key); + + final VideoPlayerController controller; + + final VideoProgressColors colors; + + final bool allowScrubbing; + + final EdgeInsets padding; + + @override + State createState() => _VideoProgressIndicatorState(); +} + +class _VideoProgressIndicatorState extends State { + _VideoProgressIndicatorState() { + listener = () { + if (!mounted) { + return; + } + setState(() {}); + }; + } + + late VoidCallback listener; + + VideoPlayerController get controller => widget.controller; + + VideoProgressColors get colors => widget.colors; + + @override + void initState() { + super.initState(); + controller.addListener(listener); + } + + @override + void deactivate() { + controller.removeListener(listener); + super.deactivate(); + } + + @override + Widget build(BuildContext context) { + Widget progressIndicator; + if (controller.value.isInitialized) { + int duration = controller.value.duration.inMilliseconds; + int position = controller.value.position.inMilliseconds; + + int maxBuffering = 0; + for (DurationRange range in controller.value.buffered) { + int end = range.end.inMilliseconds; + if (end > maxBuffering) { + maxBuffering = end; + } + } + + progressIndicator = Stack( + fit: StackFit.passthrough, + children: [ + LinearProgressIndicator( + value: maxBuffering / duration, + valueColor: AlwaysStoppedAnimation(colors.bufferedColor), + backgroundColor: colors.backgroundColor, + minHeight: 8, + ), + LinearProgressIndicator( + value: position / duration, + valueColor: AlwaysStoppedAnimation(colors.playedColor), + backgroundColor: Colors.transparent, + minHeight: 8, + ), + ], + ); + } else { + progressIndicator = LinearProgressIndicator( + valueColor: AlwaysStoppedAnimation(colors.playedColor), + backgroundColor: colors.backgroundColor, + minHeight: 8, + ); + } + Widget paddedProgressIndicator = Padding( + padding: widget.padding, + child: progressIndicator, + ); + if (widget.allowScrubbing) { + return VideoScrubber( + controller: controller, + child: paddedProgressIndicator, + ); + } else { + return paddedProgressIndicator; + } + } +} From 4eb3e6d52d80b9fb9ff5f38f30ee18f376947b16 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 19 Dec 2024 16:52:02 +0300 Subject: [PATCH 11/39] progress bar added on erm video. & skip button relocation. --- .../itg/its_add_screen_video_image.dart | 87 +++++---- lib/widgets/AnimatedProgressBar.dart | 176 ++++++++++++++++++ lib/widgets/button/default_button.dart | 17 +- lib/widgets/my_video_progress_indicator.dart | 73 +++++--- 4 files changed, 282 insertions(+), 71 deletions(-) create mode 100644 lib/widgets/AnimatedProgressBar.dart diff --git a/lib/ui/landing/itg/its_add_screen_video_image.dart b/lib/ui/landing/itg/its_add_screen_video_image.dart index 2095650..db6ba3e 100644 --- a/lib/ui/landing/itg/its_add_screen_video_image.dart +++ b/lib/ui/landing/itg/its_add_screen_video_image.dart @@ -159,9 +159,7 @@ class _ITGAdsScreenState extends State { right: 8, child: Container( padding: const EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 4), - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.5), - borderRadius: BorderRadius.circular(30)), + decoration: BoxDecoration(color: Colors.white.withOpacity(0.5), borderRadius: BorderRadius.circular(30)), child: Row( mainAxisSize: MainAxisSize.min, children: [ @@ -199,41 +197,56 @@ class _ITGAdsScreenState extends State { valueListenable: hasTimerEnded, builder: (context, val, child) { // if (hasTimerEndedBool) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - MyVideoProgressIndicator( - _controller, - allowScrubbing: false, - padding: EdgeInsets.only(left: 60, right: 60), - ), - GridView.builder( - padding: EdgeInsets.zero, - itemCount: advertisementData?.actionButtonsColl!.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - String? btnText = AppState().isArabic(context) ? advertisementData?.actionButtonsColl![index].btnTextAr : advertisementData?.actionButtonsColl![index].btnTextEn; - return DefaultButton( - btnText!, - hasTimerEndedBool - ? () async { - Navigator.pop(context); - DashboardApiClient() - .setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, advertisementData?.actionButtonsColl![index].actionValue) - .then((value) { - logger.d(value); - }); - } - : null) - .paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8); + return GridView.builder( + padding: EdgeInsets.zero, + itemCount: advertisementData?.actionButtonsColl!.length, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + String? btnText = AppState().isArabic(context) ? advertisementData?.actionButtonsColl![index].btnTextAr : advertisementData?.actionButtonsColl![index].btnTextEn; + + bool isAcknowledge = advertisementData?.actionButtonsColl![index].actionButtonId == 11; + if (isAcknowledge) { + return Stack( + alignment: Alignment.center, + children: [ + MyVideoProgressIndicator( + _controller, + allowScrubbing: false, + //padding: EdgeInsets.only(left: 60, right: 60), + ), + DefaultButton( + btnText!, + hasTimerEndedBool + ? () async { + Navigator.pop(context); + DashboardApiClient() + .setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, advertisementData?.actionButtonsColl![index].actionValue) + .then((value) { + logger.d(value); + }); + } + : null, + disabledColor: Colors.transparent, + textColor: !hasTimerEndedBool ? Colors.white.withOpacity(.5) : Colors.white, + ).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8), + ], + ); + } + return DefaultButton( + btnText!, + () async { + Navigator.pop(context); + DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, advertisementData?.actionButtonsColl![index].actionValue).then((value) { + logger.d(value); + }); }, - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1, - childAspectRatio: (7.0), - ), - ), - ], + ).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8); + }, + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 1, + childAspectRatio: (7.0), + ), ); // Row( // mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/AnimatedProgressBar.dart b/lib/widgets/AnimatedProgressBar.dart new file mode 100644 index 0000000..c0bf3d1 --- /dev/null +++ b/lib/widgets/AnimatedProgressBar.dart @@ -0,0 +1,176 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +/// Animated progress bar. Behaves like implicitly animated widget. +/// Check basic implicit animated Flutter widgets like [AnimatedContainer] +/// It animates [value] changes. +/// Requires [duration] to set filling duration timer +/// [onEnd] callback to trigger additional actions (e.g. another animation) +/// at the end of the current animation +/// [color] or [gradient] to fill the progress bar. Only one parameter is allowed. +/// Optional [backgroundColor], defaults to transparent +/// Optional [width] defaults to 200.0 +/// Optional [height] defaults to 10.0 +/// Optional [curve] defaults to [Curves.linear] +class AnimatedProgressBar extends ImplicitlyAnimatedWidget { + const AnimatedProgressBar({ + key, + required duration, + required this.value, + this.width = 200.0, + this.height = 10.0, + this.color, + this.gradient, + this.backgroundColor = Colors.transparent, + curve = Curves.linear, + onEnd, + }) : super(key: key, duration: duration, curve: curve, onEnd: onEnd); + + ///progress bar width + final double width; + + ///progress bar height + final double height; + + ///current progress value + final double? value; + + ///progress bar gradient parameter + final Gradient? gradient; + + ///progress bar color parameter + final Color? color; + + ///progress bar color parameter + final Color backgroundColor; + + @override + AnimatedWidgetBaseState createState() => _AnimatedBarState(); +} + +class _AnimatedBarState extends AnimatedWidgetBaseState { + Tween? _progressValue; + + @override + void forEachTween(TweenVisitor visitor) { + _progressValue = visitor(_progressValue, widget.value, (value) => Tween(begin: value)) as Tween?; + } + + @override + Widget build(BuildContext context) { + return ProgressBar( + value: _progressValue?.evaluate(animation), + width: widget.width, + height: widget.height, + gradient: widget.gradient, + color: widget.color, + backgroundColor: widget.backgroundColor, + ); + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder description) { + super.debugFillProperties(description); + description.add(DiagnosticsProperty('progressValue', _progressValue, showName: false, defaultValue: null)); + } +} + +class ProgressBar extends StatelessWidget { + const ProgressBar({ + Key? key, + required this.value, + this.width = 200.0, + this.height = 10.0, + this.color, + this.backgroundColor = Colors.transparent, + this.gradient, + }) : assert( + gradient == null || color == null, + 'Cannot provide both a color and a gradient', + ), + assert( + gradient != null || color != null, + 'Need to provide color or gradient', + ), + super(key: key); + + ///progress bar width + final double width; + + ///progress bar height + final double height; + + ///current progress value + final double? value; + + ///progress bar gradient parameter + final Gradient? gradient; + + ///progress bar color parameter + final Color? color; + + ///progress bar color parameter + final Color backgroundColor; + + @override + Widget build(BuildContext context) { + return CustomPaint( + size: Size(width, height), + foregroundPainter: ProgressPainter( + value: value!, + color: color, + gradient: gradient, + ), + painter: BackgroundPainter( + backgroundColor: backgroundColor, + ), + ); + } +} + +class BackgroundPainter extends CustomPainter { + const BackgroundPainter({required this.backgroundColor}); + + ///progress bar backgroundColor + final Color backgroundColor; + + @override + void paint(Canvas canvas, Size size) { + Paint paint = Paint()..color = backgroundColor; + canvas.drawRRect(RRect.fromRectAndRadius(Offset.zero & size, Radius.circular(6)), paint); + } + + @override + bool shouldRepaint(covariant BackgroundPainter oldDelegate) => false; +} + +class ProgressPainter extends CustomPainter { + const ProgressPainter({required this.value, this.gradient, this.color}); + + ///current progress bar value + final double value; + + ///progress bar gradient infill + final Gradient? gradient; + + ///progress bar gradient color + final Color? color; + + @override + void paint(Canvas canvas, Size size) { + Paint paint = Paint(); + if (gradient != null) { + paint.shader = gradient?.createShader(Offset.zero & size); + } + if (color != null) { + paint.color = color!; + } + canvas.clipRRect(RRect.fromRectAndRadius(Offset.zero & size, Radius.circular(6))); + canvas.drawRRect(RRect.fromRectAndRadius(Rect.fromLTRB(0, 0, size.width * value, size.height), Radius.circular(6)), paint); + } + + @override + bool shouldRepaint(covariant ProgressPainter oldDelegate) { + return value != oldDelegate.value; + } +} diff --git a/lib/widgets/button/default_button.dart b/lib/widgets/button/default_button.dart index 338a13d..ba15fad 100644 --- a/lib/widgets/button/default_button.dart +++ b/lib/widgets/button/default_button.dart @@ -47,28 +47,21 @@ class DefaultButton extends StatelessWidget { decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), gradient: onPress == null - ? const LinearGradient( + ? LinearGradient( colors: [ - Color(0xffEAEAEA), - Color(0xffEAEAEA), + disabledColor ?? Color(0xffEAEAEA), + disabledColor ?? Color(0xffEAEAEA), ], ) : color == MyColors.yellowColorII ? const LinearGradient( - colors: [ - MyColors.yellowColorII, - MyColors.yellowColorII, - ], + colors: [MyColors.yellowColorII, MyColors.yellowColorII], ) : LinearGradient( transform: const GradientRotation(.83), begin: Alignment.topRight, end: Alignment.bottomLeft, - colors: colors ?? - [ - MyColors.gradiantEndColor, - MyColors.gradiantStartColor, - ], + colors: colors ?? [MyColors.gradiantEndColor, MyColors.gradiantStartColor], ), ), child: Row( diff --git a/lib/widgets/my_video_progress_indicator.dart b/lib/widgets/my_video_progress_indicator.dart index a6e9172..3593115 100644 --- a/lib/widgets/my_video_progress_indicator.dart +++ b/lib/widgets/my_video_progress_indicator.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/widgets/AnimatedProgressBar.dart'; import 'package:video_player/video_player.dart'; class MyVideoProgressIndicator extends StatefulWidget { @@ -68,36 +70,63 @@ class _VideoProgressIndicatorState extends State { progressIndicator = Stack( fit: StackFit.passthrough, children: [ - LinearProgressIndicator( - value: maxBuffering / duration, - valueColor: AlwaysStoppedAnimation(colors.bufferedColor), - backgroundColor: colors.backgroundColor, - minHeight: 8, - ), - LinearProgressIndicator( + // LinearProgressIndicator( + // value: maxBuffering / duration, + // valueColor: AlwaysStoppedAnimation(colors.bufferedColor), + // backgroundColor: colors.backgroundColor, + // minHeight: 8, + // ), + // LinearProgressIndicator( + // value: position / duration, + // valueColor: AlwaysStoppedAnimation(colors.playedColor), + // backgroundColor: Colors.transparent, + // minHeight: 8, + // ), + + AnimatedProgressBar( value: position / duration, - valueColor: AlwaysStoppedAnimation(colors.playedColor), - backgroundColor: Colors.transparent, - minHeight: 8, + duration: const Duration(seconds: 2), + height: 43, + width: MediaQuery.of(context).size.width - 120, + gradient: const LinearGradient( + transform: GradientRotation(.83), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ], + ), + backgroundColor: Colors.grey.withOpacity(0.6), ), ], ); } else { - progressIndicator = LinearProgressIndicator( - valueColor: AlwaysStoppedAnimation(colors.playedColor), - backgroundColor: colors.backgroundColor, - minHeight: 8, + // progressIndicator = LinearProgressIndicator( + // valueColor: AlwaysStoppedAnimation(colors.playedColor), + // backgroundColor: colors.backgroundColor, + // minHeight: 8, + // ); + progressIndicator = AnimatedProgressBar( + value: 1, + duration: const Duration(seconds: 2), + height: 43, + width: MediaQuery.of(context).size.width - 120, + gradient: const LinearGradient( + transform: GradientRotation(.83), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ], + ), + backgroundColor: Colors.grey.withOpacity(0.6), ); } - Widget paddedProgressIndicator = Padding( - padding: widget.padding, - child: progressIndicator, - ); + Widget paddedProgressIndicator = Padding(padding: widget.padding, child: progressIndicator); if (widget.allowScrubbing) { - return VideoScrubber( - controller: controller, - child: paddedProgressIndicator, - ); + return VideoScrubber(controller: controller, child: paddedProgressIndicator); } else { return paddedProgressIndicator; } From 5d0091fe5b2311c0d721428fca758a7a072f4236 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 22 Dec 2024 12:33:48 +0300 Subject: [PATCH 12/39] Unsafe device check implemented --- lib/app_state/app_state.dart | 2 +- lib/classes/consts.dart | 4 ++-- lib/ui/login/login_screen.dart | 2 ++ lib/ui/unsafe_device_screen.dart | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 7b22836..aea9251 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.2, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.3, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 7103dfd..170762c 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // 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://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 diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index c71ae7f..3a35222 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -8,6 +8,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + // import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:mohem_flutter_app/api/login_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; @@ -31,6 +32,7 @@ import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/input_widget.dart'; import 'package:safe_device/safe_device.dart'; + // import 'package:safe_device/safe_device.dart'; import 'package:wifi_iot/wifi_iot.dart'; diff --git a/lib/ui/unsafe_device_screen.dart b/lib/ui/unsafe_device_screen.dart index dca8748..c8e1243 100644 --- a/lib/ui/unsafe_device_screen.dart +++ b/lib/ui/unsafe_device_screen.dart @@ -32,7 +32,7 @@ class _UnsafeDeviceScreenState extends State { 50.height, "Sorry".toText24(isBold: true), 21.height, - "You are using Mohemm app on an unsafe device. To be able to use the app with all it's features, Please make sure that the below points are considered: " + "You are using MoheM app on an unsafe device. To be able to use the app with all it's features, Please make sure that the below points are considered: " .toText14(isCenter: true) .paddingOnly(left: 20.0, right: 20.0), 48.height, From c1503cc23602930a2e8d66c54900967b3c386742 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 22 Dec 2024 15:55:20 +0300 Subject: [PATCH 13/39] updates & fixes --- lib/classes/consts.dart | 2 +- .../itg/its_add_screen_video_image.dart | 13 ++++++------ lib/ui/login/verify_last_login_screen.dart | 21 +++++++------------ 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 170762c..5e6a6ca 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -7,7 +7,7 @@ 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://hmgwebservices.com"; // Live server + // static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrl = "https://mohemm.hmg.com"; // New Live server diff --git a/lib/ui/landing/itg/its_add_screen_video_image.dart b/lib/ui/landing/itg/its_add_screen_video_image.dart index db6ba3e..6e1358c 100644 --- a/lib/ui/landing/itg/its_add_screen_video_image.dart +++ b/lib/ui/landing/itg/its_add_screen_video_image.dart @@ -197,7 +197,7 @@ class _ITGAdsScreenState extends State { valueListenable: hasTimerEnded, builder: (context, val, child) { // if (hasTimerEndedBool) { - return GridView.builder( + return ListView.builder( padding: EdgeInsets.zero, itemCount: advertisementData?.actionButtonsColl!.length, shrinkWrap: true, @@ -205,7 +205,8 @@ class _ITGAdsScreenState extends State { itemBuilder: (context, index) { String? btnText = AppState().isArabic(context) ? advertisementData?.actionButtonsColl![index].btnTextAr : advertisementData?.actionButtonsColl![index].btnTextEn; - bool isAcknowledge = advertisementData?.actionButtonsColl![index].actionButtonId == 11; + // bool isAcknowledge = advertisementData?.actionButtonsColl![index].actionButtonId == 11; + bool isAcknowledge = advertisementData?.actionButtonsColl![index].actionButtonId == 17; if (isAcknowledge) { return Stack( alignment: Alignment.center, @@ -243,10 +244,10 @@ class _ITGAdsScreenState extends State { }, ).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8); }, - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1, - childAspectRatio: (7.0), - ), + // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + // crossAxisCount: 1, + // childAspectRatio: (7.0), + // ), ); // Row( // mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index d6d041d..13c9b0c 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -57,14 +57,10 @@ class _VerifyLastLoginScreenState extends State { @override Widget build(BuildContext context) { - if(ModalRoute.of(context)!.settings.arguments != null) { - mobileLoginInfoListModel ??= ModalRoute - .of(context)! - .settings - .arguments as GetMobileLoginInfoListModel; + if (ModalRoute.of(context)!.settings.arguments != null) { + mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments as GetMobileLoginInfoListModel; // String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!; String empName = mobileLoginInfoListModel!.employeeName!; - } return Scaffold( @@ -140,7 +136,7 @@ class _VerifyLastLoginScreenState extends State { LocaleKeys.pleaseVerify.tr().toText16(), if (isNeedVerifyWithFaceIDAndBiometrics) LocaleKeys.pleaseVerifyForBio.tr().toText12(), GridView( - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: MediaQuery.of(context).size.width > 400 ? 3 : 2, crossAxisSpacing: 8.5, mainAxisSpacing: 9), physics: const NeverScrollableScrollPhysics(), padding: const EdgeInsets.only(top: 9), shrinkWrap: true, @@ -295,7 +291,7 @@ class _VerifyLastLoginScreenState extends State { width: 38, color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null, ), - _title.toText16(height: 20/16) + _title.toText16(height: 20 / 16) ], ), ), @@ -397,12 +393,10 @@ class _VerifyLastLoginScreenState extends State { Utils.hideLoading(context); Utils.handleException(ex, context, null); dynamic errorCode = ex; - if(errorCode.error.errorStatusCode ==699){ - Future.delayed(const Duration(seconds: 2), () - { + if (errorCode.error.errorStatusCode == 699) { + Future.delayed(const Duration(seconds: 2), () { Navigator.pop(context); - Navigator.pushNamedAndRemoveUntil( - context, AppRoutes.login, (Route route) => false); + Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route route) => false); }); } } @@ -419,5 +413,4 @@ class _VerifyLastLoginScreenState extends State { // // isLoading = isTrue; // }); // } - } From 9f89f7530d78f3386f07965a0a82b286df05bd69 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 23 Dec 2024 12:41:55 +0300 Subject: [PATCH 14/39] Update to stores VersionID 8.5 --- lib/ui/login/verify_last_login_screen.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index 13c9b0c..8604baf 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -136,7 +136,7 @@ class _VerifyLastLoginScreenState extends State { LocaleKeys.pleaseVerify.tr().toText16(), if (isNeedVerifyWithFaceIDAndBiometrics) LocaleKeys.pleaseVerifyForBio.tr().toText12(), GridView( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: MediaQuery.of(context).size.width > 400 ? 3 : 2, crossAxisSpacing: 8.5, mainAxisSpacing: 9), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), physics: const NeverScrollableScrollPhysics(), padding: const EdgeInsets.only(top: 9), shrinkWrap: true, diff --git a/pubspec.yaml b/pubspec.yaml index a12c83a..9740e7d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.7.98+1 +version: 3.7.98+3 environment: sdk: ">=2.16.0 <3.0.0" From 3e19508c5e4a0b2245ed18b38ddbca2cac3aada2 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 25 Dec 2024 10:28:48 +0300 Subject: [PATCH 15/39] child education assistance added. --- lib/api/my_attendance_api_client.dart | 45 ++++++++++++++ lib/classes/consts.dart | 4 +- lib/config/routes.dart | 8 +-- lib/models/generic_response_model.dart | 42 +++++++++---- .../get_eit_transaction_list_model.dart | 60 +++++++++++++------ .../dynamic_screens/dynamic_input_screen.dart | 29 +++++++-- .../dynamic_listview_screen.dart | 19 ++++-- .../services_menu_list_screen.dart | 2 + .../child_education_assistance.dart | 58 ++++++++++++++++++ 9 files changed, 220 insertions(+), 47 deletions(-) create mode 100644 lib/ui/screens/child_education/child_education_assistance.dart diff --git a/lib/api/my_attendance_api_client.dart b/lib/api/my_attendance_api_client.dart index 24cf6c0..74e9855 100644 --- a/lib/api/my_attendance_api_client.dart +++ b/lib/api/my_attendance_api_client.dart @@ -29,6 +29,21 @@ class MyAttendanceApiClient { }, url, postParams); } + Future?> getCeiTransaction(String pFunctionName, int? relationID) async { + String url = "${ApiConsts.erpRest}GET_CEI_TRANSACTIONS"; + Map postParams = {"P_PAGE_LIMIT": 50, "P_PAGE_NUM": 1, "P_FUNCTION_NAME": pFunctionName}; + postParams.addAll(AppState().postParamsJson); + if (relationID != null) postParams["P_CONTACT_RELATIONSHIP_ID"] = relationID; + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + if (responseData.getCEITransactionList?.isNotEmpty ?? false) { + return responseData.getCEITransactionList!.map((e) => GetEITTransactionList(collectionTransaction: e.collectionTransaction)).toList(); + } else { + return []; + } + }, url, postParams); + } + Future getEitDffStructure(String pFunctionName, String? empID) async { String url = "${ApiConsts.erpRest}GET_EIT_DFF_STRUCTURE"; Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_FUNCTION_NAME": pFunctionName}; @@ -40,6 +55,17 @@ class MyAttendanceApiClient { }, url, postParams); } + Future getCEIDffStructure(String pFunctionName, String? empID) async { + String url = "${ApiConsts.erpRest}GET_CEI_DFF_STRUCTURE"; + Map postParams = {"P_FUNCTION_NAME": pFunctionName}; + 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; + }, url, postParams); + } + Future> getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list, {String? empID, String? parentValue, bool hasParent = false}) async { String url = "${ApiConsts.erpRest}GET_VALUE_SET_VALUES"; @@ -102,6 +128,25 @@ class MyAttendanceApiClient { }, url, postParams); } + Future submitCEITransaction(String pDescFlexContextCode, String pFunctionName, List> list, {String? empID, int? pContactRelationID}) async { + String url = "${ApiConsts.erpRest}SUBMIT_CEI_TRANSACTION"; + Map postParams = { + "P_SELECTED_RESP_ID": -999, + "P_MENU_TYPE": "E", + "P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode, + "P_CONTACT_RELATIONSHIP_ID": pContactRelationID, + "P_FUNCTION_NAME": pFunctionName, + "EITTransactionTBL": list, + "EITTransactionTBLModel": list, + }; + 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.submitEITTransactionList!; //ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson()); + }, url, postParams); + } + Future submitEitTransaction(String pDescFlexContextCode, String pFunctionName, List> list, {String? empID}) async { String url = "${ApiConsts.erpRest}SUBMIT_EIT_TRANSACTION"; Map postParams = { diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 5e6a6ca..6442b88 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // 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://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 diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 33559e2..6afc095 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/models/my_documents/employee_documents_list_model.dart'; import 'package:mohem_flutter_app/ui/app_update_screen.dart'; import 'package:mohem_flutter_app/ui/attendance/add_vacation_rule_screen.dart'; import 'package:mohem_flutter_app/ui/attendance/monthly_attendance_screen.dart'; @@ -33,7 +32,6 @@ import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/services_menu_list_screen.dart'; - // import 'package:mohem_flutter_app/ui/my_attendance/my_attendance_screen.dart'; import 'package:mohem_flutter_app/ui/my_team/create_request.dart'; import 'package:mohem_flutter_app/ui/my_team/employee_details.dart'; @@ -55,7 +53,7 @@ import 'package:mohem_flutter_app/ui/profile/personal_info.dart'; import 'package:mohem_flutter_app/ui/profile/profile_screen.dart'; import 'package:mohem_flutter_app/ui/screens/announcements/announcement_details.dart'; import 'package:mohem_flutter_app/ui/screens/announcements/announcements.dart'; - +import 'package:mohem_flutter_app/ui/screens/child_education/child_education_assistance.dart'; // import 'package:mohem_flutter_app/ui/my_attendance/work_from_home_screen.dart'; import 'package:mohem_flutter_app/ui/screens/eit/add_eit.dart'; import 'package:mohem_flutter_app/ui/screens/items_for_sale/add_new_item_for_sale.dart'; @@ -64,7 +62,6 @@ import 'package:mohem_flutter_app/ui/screens/items_for_sale/items_for_sale_home. import 'package:mohem_flutter_app/ui/screens/mowadhafhi/mowadhafhi_home.dart'; import 'package:mohem_flutter_app/ui/screens/mowadhafhi/mowadhafhi_hr_request.dart'; import 'package:mohem_flutter_app/ui/screens/mowadhafhi/request_details.dart'; -import 'package:mohem_flutter_app/ui/screens/my_documents/my_document_detail_screen.dart'; import 'package:mohem_flutter_app/ui/screens/my_documents/my_documents_screen.dart'; import 'package:mohem_flutter_app/ui/screens/my_requests/my_requests.dart'; import 'package:mohem_flutter_app/ui/screens/my_requests/new_request.dart'; @@ -198,6 +195,7 @@ class AppRoutes { static const String manageGroup = "/manageGroup"; static const String groupMembers = "/groupmembers"; static const String groupChatDetailed = "/groupChatDetailed"; + //Marathon static const String marathonIntroScreen = "/marathonIntroScreen"; static const String marathonScreen = "/marathonScreen"; @@ -208,6 +206,7 @@ class AppRoutes { static const String unsafeDeviceScreen = "/unsafeDeviceScreen"; static const String appUpdateScreen = "/appUpdateScreen"; + static const String childEducation = "/childEducation"; static final Map routes = { login: (BuildContext context) => LoginScreen(), @@ -325,5 +324,6 @@ class AppRoutes { unsafeDeviceScreen: (BuildContext context) => const UnsafeDeviceScreen(), appUpdateScreen: (BuildContext context) => const AppUpdateScreen(), + childEducation: (BuildContext context) => ChildEducationAssistance(), }; } diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index e9daeb4..4175e7f 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -185,8 +185,8 @@ class GenericResponseModel { List? getBasicDetDffStructureList; List? getBasicDetNtfBodyList; List? getCEICollectionNotificationBodyList; - List? getCEIDFFStructureList; - List? getCEITransactionList; + List? getCEIDFFStructureList; + List? getCEITransactionList; List? getCcpTransactionsList; List? getContactColsStructureList; @@ -226,6 +226,7 @@ class GenericResponseModel { List? getOrganizationsSalariesList; List? getPaymentInformationList; List? getPayslipList; + // List? getPendingReqDetailsList; // List? getPendingReqFunctionsList; List? getPerformanceAppraisalList; @@ -503,7 +504,7 @@ class GenericResponseModel { this.getPoItemHistoryList, this.getPoNotificationBodyList, this.getPrNotificationBodyList, - this.getPaymentNotificationBodyList, + this.getPaymentNotificationBodyList, this.getPRInformationList, this.getQuotationAnalysisList, this.getRFCEmployeeListList, @@ -700,7 +701,7 @@ class GenericResponseModel { cancelHRTransactionLIst = json['CancelHRTransactionLIst'] != null ? new CancelHRTransactionLIst.fromJson(json['CancelHRTransactionLIst']) : null; if (json['GetTermNotificationBodyList'] != null) { - getTermNotificationBodyList = []; + getTermNotificationBodyList = []; json['GetTermNotificationBodyList'].forEach((v) { getTermNotificationBodyList!.add(TerminationNotificationBody.fromJson(v)); }); @@ -845,8 +846,21 @@ class GenericResponseModel { } getCEICollectionNotificationBodyList = json['GetCEICollectionNotificationBodyList']; - getCEIDFFStructureList = json['GetCEIDFFStructureList']; - getCEITransactionList = json['GetCEITransactionList']; + + if (json['GetCEIDFFStructureList'] != null) { + getCEIDFFStructureList = []; + json['GetCEIDFFStructureList'].forEach((v) { + getCEIDFFStructureList!.add(GetEITDFFStructureList.fromJson(v)); + }); + } + + if (json['GetCEITransactionList'] != null) { + getCEITransactionList = []; + json['GetCEITransactionList'].forEach((v) { + getCEITransactionList!.add(GetCEITransactionList.fromJson(v)); + }); + } + getCcpTransactionsList = json['GetCcpTransactionsList']; getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]); if (json['GetContactColsStructureList'] != null) { @@ -1028,7 +1042,6 @@ class GenericResponseModel { getPrNotificationBodyList = json['GetPrNotificationBodyList'] != null ? GetPrNotificationBodyList.fromJson(json['GetPrNotificationBodyList']) : null; getPaymentNotificationBodyList = json['Pay_ReqNotificationBody'] != null ? GetPaymentNotificationBodyList.fromJson(json['Pay_ReqNotificationBody']) : null; - getPRInformationList = json['PR_Information_List'] != null ? GetPRInformationList.fromJson(json['PR_Information_List']) : null; if (json['GetQuotationAnalysisList'] != null) { getQuotationAnalysisList = []; @@ -1106,8 +1119,6 @@ class GenericResponseModel { }); } - - if (json['GetTimeCardSummaryList'] != null) { getTimeCardSummaryList = []; json['GetTimeCardSummaryList'].forEach((v) { @@ -1544,8 +1555,15 @@ class GenericResponseModel { } data['GetCEICollectionNotificationBodyList'] = this.getCEICollectionNotificationBodyList; - data['GetCEIDFFStructureList'] = this.getCEIDFFStructureList; - data['GetCEITransactionList'] = this.getCEITransactionList; + + + if (this.getCEIDFFStructureList != null) { + data['GetCEIDFFStructureList'] = this.getCEIDFFStructureList!.map((v) => v.toJson()).toList(); + } + + if (this.getCEITransactionList != null) { + data['GetCEITransactionList'] = this.getCEITransactionList!.map((v) => v.toJson()).toList(); + } data['GetCcpTransactionsList'] = this.getCcpTransactionsList; if (this.getContactDetailsList != null) { data['GetContactDetailsList'] = this.getContactDetailsList!.map((v) => v.toJson()).toList(); @@ -1628,7 +1646,7 @@ class GenericResponseModel { data['GetNotificationReassignModeList'] = getNotificationReassignModeList!.map((v) => v.toJson()).toList(); } - if(getTermNotificationBodyList !=null){ + if (getTermNotificationBodyList != null) { data['GetTermNotificationBodyList'] = getTermNotificationBodyList!.map((v) => v.toJson()).toList(); } data['GetObjectValuesList'] = this.getObjectValuesList; diff --git a/lib/models/get_eit_transaction_list_model.dart b/lib/models/get_eit_transaction_list_model.dart index d8c39c9..c459bbd 100644 --- a/lib/models/get_eit_transaction_list_model.dart +++ b/lib/models/get_eit_transaction_list_model.dart @@ -15,8 +15,30 @@ class GetEITTransactionList { Map toJson() { Map data = new Map(); if (this.collectionTransaction != null) { - data['Collection_Transaction'] = - this.collectionTransaction!.map((v) => v.toJson()).toList(); + data['Collection_Transaction'] = this.collectionTransaction!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class GetCEITransactionList { + List? collectionTransaction; + + GetCEITransactionList({this.collectionTransaction}); + + GetCEITransactionList.fromJson(Map json) { + if (json['Collection_Transaction'] != null) { + collectionTransaction = []; + json['Collection_Transaction'].forEach((v) { + collectionTransaction!.add(new CollectionTransaction.fromJson(v)); + }); + } + } + + Map toJson() { + Map data = new Map(); + if (this.collectionTransaction != null) { + data['Collection_Transaction'] = this.collectionTransaction!.map((v) => v.toJson()).toList(); } return data; } @@ -43,22 +65,22 @@ class CollectionTransaction { CollectionTransaction( {this.aPPLICATIONCOLUMNNAME, - this.dATATYPE, - this.dATEVALUE, - this.dESCFLEXCONTEXTCODE, - this.dESCFLEXNAME, - this.dISPLAYFLAG, - this.fROMROWNUM, - this.nOOFROWS, - this.nUMBERVALUE, - this.rOWNUM, - this.sEGMENTNAME, - this.sEGMENTPROMPT, - this.sEGMENTSEQNUM, - this.sEGMENTVALUEDSP, - this.tOROWNUM, - this.tRANSACTIONNUMBER, - this.vARCHAR2VALUE}); + this.dATATYPE, + this.dATEVALUE, + this.dESCFLEXCONTEXTCODE, + this.dESCFLEXNAME, + this.dISPLAYFLAG, + this.fROMROWNUM, + this.nOOFROWS, + this.nUMBERVALUE, + this.rOWNUM, + this.sEGMENTNAME, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.sEGMENTVALUEDSP, + this.tOROWNUM, + this.tRANSACTIONNUMBER, + this.vARCHAR2VALUE}); CollectionTransaction.fromJson(Map json) { aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; @@ -101,4 +123,4 @@ class CollectionTransaction { data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE; return data; } -} \ No newline at end of file +} diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index ef88e11..73f05bc 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -46,10 +46,17 @@ class _DynamicInputScreenState extends State { void getTransactionsStructure() async { try { Utils.showLoading(context); - genericResponseModel = await MyAttendanceApiClient().getEitDffStructure(dynamicParams!.dynamicId, dynamicParams!.selectedEmp); + if (dynamicParams?.pContactRelationshipId == null) { + genericResponseModel = await MyAttendanceApiClient().getEitDffStructure(dynamicParams!.dynamicId, dynamicParams!.selectedEmp); + getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + } else { + genericResponseModel = await MyAttendanceApiClient().getCEIDffStructure(dynamicParams!.dynamicId, null); + getEitDffStructureList = genericResponseModel?.getCEIDFFStructureList ?? []; + } + dESCFLEXCONTEXTCODE = genericResponseModel!.pDESCFLEXCONTEXTCODE ?? ""; descFlexConTextTitle = genericResponseModel!.pDESCFLEXCONTEXTNAME ?? ""; - getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); Utils.hideLoading(context); setState(() {}); @@ -90,11 +97,21 @@ class _DynamicInputScreenState extends State { }).toList(); values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson()); - values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); - values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); - genericResponseModel = await MyAttendanceApiClient().validateEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp); - SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp); + if (dynamicParams!.pContactRelationshipId == null) { + values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); + values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); + } else { + values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "CONTACT_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); + values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "CEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); + } + SubmitEITTransactionList submitEITTransactionList; + if (dynamicParams!.pContactRelationshipId == null) { + genericResponseModel = await MyAttendanceApiClient().validateEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp); + submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp); + } else { + submitEITTransactionList = await MyAttendanceApiClient().submitCEITransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, pContactRelationID: dynamicParams!.pContactRelationshipId); + } Utils.hideLoading(context); await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit', diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart index 94a201f..54b250d 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart @@ -24,11 +24,13 @@ class DynamicListViewParams { List? collectionNotificationList; final String? selectedEmp; + final int? pContactRelationshipId; DynamicListViewParams( this.title, this.dynamicId, { this.selectedEmp, + this.pContactRelationshipId, this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', @@ -59,10 +61,14 @@ class _DynamicListViewScreenState extends State { super.initState(); } - void getTransactions() async { + void getTransactions({bool isCei = false}) async { try { Utils.showLoading(context); - getEITTransactionList = await MyAttendanceApiClient().getEitTransaction(dynamicParams!.dynamicId, dynamicParams!.selectedEmp); + if (isCei) { + getEITTransactionList = await MyAttendanceApiClient().getCeiTransaction(dynamicParams!.dynamicId, dynamicParams!.pContactRelationshipId); + } else { + getEITTransactionList = await MyAttendanceApiClient().getEitTransaction(dynamicParams!.dynamicId, dynamicParams!.selectedEmp); + } getEITTransactionList?.forEach((element) { element.collectionTransaction = element.collectionTransaction?.where((elemen) => elemen.dISPLAYFLAG == "Y").toList() ?? []; }); @@ -97,8 +103,13 @@ class _DynamicListViewScreenState extends State { Widget build(BuildContext context) { if (dynamicParams == null) { dynamicParams = ModalRoute.of(context)!.settings.arguments as DynamicListViewParams; - isTicketRequest = dynamicParams!.dynamicId == "HMG_TKT_NEW_EIT_SS"; - getTransactions(); + if (dynamicParams?.pContactRelationshipId == null) { + isTicketRequest = dynamicParams!.dynamicId == "HMG_TKT_NEW_EIT_SS"; + getTransactions(); + } else { + isTicketRequest = false; + getTransactions(isCei: true); + } } Widget dataWidget = ListView( physics: const BouncingScrollPhysics(), diff --git a/lib/ui/my_attendance/services_menu_list_screen.dart b/lib/ui/my_attendance/services_menu_list_screen.dart index 44aac6a..a074cad 100644 --- a/lib/ui/my_attendance/services_menu_list_screen.dart +++ b/lib/ui/my_attendance/services_menu_list_screen.dart @@ -64,6 +64,8 @@ class ServicesMenuListScreen extends StatelessWidget { if (servicesMenuData.list[index].requestType == "EIT") { Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(servicesMenuData.list[index].prompt!, servicesMenuData.list[index].functionName!, selectedEmp: servicesMenuData.selectedEmp)); + } else if (servicesMenuData.list[index].requestType == "CEI") { + Navigator.pushNamed(context, AppRoutes.childEducation, arguments: servicesMenuData.list[index]); } else { if (servicesMenuData.list[index].requestType == "TERMINATION") { Navigator.pushNamed(context, AppRoutes.endEmploymentScreen, diff --git a/lib/ui/screens/child_education/child_education_assistance.dart b/lib/ui/screens/child_education/child_education_assistance.dart new file mode 100644 index 0000000..283dab3 --- /dev/null +++ b/lib/ui/screens/child_education/child_education_assistance.dart @@ -0,0 +1,58 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/profile_api_client.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/config/routes.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/dashboard/menu_entries.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; +import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; + +class ChildEducationAssistance extends StatelessWidget { + ChildEducationAssistance({Key? key}) : super(key: key); + + GetMenuEntriesList? menuEntry; + + @override + Widget build(BuildContext context) { + menuEntry ??= ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList; + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget(context, title: menuEntry!.prompt!), + body: FutureBuilder( + future: ProfileApiClient().getEmployeeContacts(), + builder: (BuildContext cxt, AsyncSnapshot> snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } else if (snapshot.hasData) { + List empContactList = snapshot.data!; + return ListView.separated( + padding: const EdgeInsets.all(21), + separatorBuilder: (BuildContext cxt, int index) => 12.height, + itemCount: empContactList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + "${empContactList[index].cONTACTNAME}".toText16(color: MyColors.grey3AColor), + "${LocaleKeys.dateOfBirth.tr()}: ${empContactList[index].dATEOFBIRTH?.split(" ").first ?? ""}".toText14(color: MyColors.grey3AColor, weight: FontWeight.w400), + "${empContactList[index].rELATIONSHIP}".toText11(color: MyColors.textMixColor), + ], + ).objectContainerView(disablePadding: false, center: false).onPress(() { + Navigator.pushNamed(context, AppRoutes.dynamicScreen, + arguments: DynamicListViewParams(empContactList[index].cONTACTNAME!, menuEntry!.functionName!, pContactRelationshipId: empContactList[index].cONTACTRELATIONSHIPID)); + }); + }); + } else { + return LocaleKeys.noDataAvailable.tr().toText16().center; + } + }, + ), + ); + } +} From e20d6eca3f27fc958618de582b3bb39b8204b8a8 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 30 Dec 2024 10:43:24 +0300 Subject: [PATCH 16/39] Safe device issue fixed --- lib/ui/login/login_screen.dart | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 3a35222..2aa2da3 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -59,8 +59,7 @@ class _LoginScreenState extends State { bool? isAppOpenBySystem; bool isJailBroken = false; - bool isRealDevice = false; - bool isOnExternalStorage = false; + bool isRealDevice = true; bool isDevelopmentModeEnable = false; BasicMemberInformationModel? _basicMemberInformation; @@ -78,16 +77,20 @@ class _LoginScreenState extends State { } } - void checkDeviceSafety() async { + void checkDeviceSafety() { try { - isJailBroken = await SafeDevice.isJailBroken; - isRealDevice = await SafeDevice.isRealDevice; + SafeDevice.isJailBroken.then((bool value) { + isJailBroken = value; + }); + SafeDevice.isRealDevice.then((value) { + isRealDevice = value; + }); + if (Platform.isAndroid) { - isOnExternalStorage = await SafeDevice.isOnExternalStorage; - isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable; - } - if (isJailBroken || !isRealDevice || isOnExternalStorage || isDevelopmentModeEnable) { - Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false); + // isOnExternalStorage = await SafeDevice.isOnExternalStorage; + SafeDevice.isDevelopmentModeEnable.then((value) { + isDevelopmentModeEnable = value; + }); } } catch (error) { print(error); @@ -123,7 +126,14 @@ class _LoginScreenState extends State { firebaseToken = ""; } AppNotifications().init(firebaseToken, context); - checkLoginInfo(); + + if (isJailBroken || !isRealDevice || isDevelopmentModeEnable) { + Utils.hideLoading(context); + Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false); + } else { + checkLoginInfo(); + } + await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); } // }); @@ -201,6 +211,8 @@ class _LoginScreenState extends State { } Utils.saveStringFromPrefs(SharedPrefsConsts.password, password.text); } catch (ex) { + print(ex); + print(ex.toString()); Utils.hideLoading(context); Utils.handleException(ex, context, (msg) { Utils.confirmDialog( From 9362859013be51abae21fe160a2cec8b8980199f Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 31 Dec 2024 17:20:22 +0300 Subject: [PATCH 17/39] CEI notification body added. --- lib/api/my_attendance_api_client.dart | 2 +- lib/api/worklist/worklist_api_client.dart | 14 +++++++++++++ lib/models/generic_response_model.dart | 16 ++++++++------ lib/ui/work_list/worklist_detail_screen.dart | 22 +++++++++++++++++++- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/lib/api/my_attendance_api_client.dart b/lib/api/my_attendance_api_client.dart index 74e9855..37bf9e8 100644 --- a/lib/api/my_attendance_api_client.dart +++ b/lib/api/my_attendance_api_client.dart @@ -143,7 +143,7 @@ class MyAttendanceApiClient { if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID; return await ApiClient().postJsonForObject((json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); - return responseData.submitEITTransactionList!; //ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson()); + return responseData.submitCEITransactionList!; //ESERVICESDV.fromJson(responseData.getDefaultValueList!.toJson()); }, url, postParams); } diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index e08d30b..9667961 100644 --- a/lib/api/worklist/worklist_api_client.dart +++ b/lib/api/worklist/worklist_api_client.dart @@ -534,6 +534,20 @@ class WorkListApiClient { }, 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, + }; + postParams.addAll(AppState().postParamsJson); + 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 = { diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 4175e7f..e87c3e0 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -184,7 +184,7 @@ class GenericResponseModel { List? getBasicDetColsStructureList; List? getBasicDetDffStructureList; List? getBasicDetNtfBodyList; - List? getCEICollectionNotificationBodyList; + List? getCEICollectionNotificationBodyList; List? getCEIDFFStructureList; List? getCEITransactionList; List? getCcpTransactionsList; @@ -356,7 +356,7 @@ class GenericResponseModel { StartTermApprovalProcessList? startTermApprovalProcessList; SubmitAddressTransaction? submitAddressTransactionList; SubmitBasicDetailsTransactionList? submitBasicDetTransactionList; - String? submitCEITransactionList; + SubmitEITTransactionList? submitCEITransactionList; SubmitCcpTransactionList? submitCcpTransactionList; SubmitContactTransactionList? submitContactTransactionList; SubmitEITTransactionList? submitEITTransactionList; @@ -845,7 +845,9 @@ class GenericResponseModel { }); } - getCEICollectionNotificationBodyList = json['GetCEICollectionNotificationBodyList']; + getCEICollectionNotificationBodyList = json["GetCEICollectionNotificationBodyList"] == null + ? null + : List.from(json["GetCEICollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x))); if (json['GetCEIDFFStructureList'] != null) { getCEIDFFStructureList = []; @@ -1378,7 +1380,7 @@ class GenericResponseModel { submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null; submitBasicDetTransactionList = json['SubmitBasicDetTransactionList'] != null ? SubmitBasicDetailsTransactionList.fromJson(json['SubmitBasicDetTransactionList']) : null; - submitCEITransactionList = json['SubmitCEITransactionList']; + submitCEITransactionList = json['SubmitCEITransactionList'] != null ? SubmitEITTransactionList.fromJson(json['SubmitCEITransactionList']) : null; submitCcpTransactionList = json['SubmitCcpTransactionList'] != null ? new SubmitCcpTransactionList.fromJson(json['SubmitCcpTransactionList']) : null; submitContactTransactionList = json['SubmitContactTransactionList'] != null ? SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null; submitEITTransactionList = json['SubmitEITTransactionList'] != null ? SubmitEITTransactionList.fromJson(json['SubmitEITTransactionList']) : null; @@ -1553,10 +1555,8 @@ class GenericResponseModel { if (this.getBasicDetNtfBodyList != null) { data['GetBasicDetNtfBodyList'] = this.getBasicDetNtfBodyList!.map((v) => v.toJson()).toList(); } - data['GetCEICollectionNotificationBodyList'] = this.getCEICollectionNotificationBodyList; - if (this.getCEIDFFStructureList != null) { data['GetCEIDFFStructureList'] = this.getCEIDFFStructureList!.map((v) => v.toJson()).toList(); } @@ -1855,6 +1855,10 @@ class GenericResponseModel { } data['SubmitCEITransactionList'] = this.submitCEITransactionList; + + if (this.submitCEITransactionList != null) { + data['SubmitCEITransactionList'] = this.submitCEITransactionList!.toJson(); + } if (this.submitCcpTransactionList != null) { data['SubmitCcpTransactionList'] = this.submitCcpTransactionList!.toJson(); } diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index ee595d1..69c669f 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -142,7 +142,9 @@ class _WorkListDetailScreenState extends State { if (workListData!.iTEMTYPE == "HRSSA") { if (workListData!.rEQUESTTYPE == "EIT") { getEitNotificationBody(); - } else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") { + } else if (workListData!.rEQUESTTYPE == "CEI") { + getCEINotificationBody(); + }else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") { getPhonesNotificationBody(); } else if (workListData!.rEQUESTTYPE == "BASIC_DETAILS") { getBasicDetNtfBody(); @@ -760,6 +762,24 @@ class _WorkListDetailScreenState extends State { } } + void getCEINotificationBody() async { + try { + if (apiCallCount == 0) Utils.showLoading(context); + apiCallCount++; + getEitCollectionNotificationBodyList!.clear(); + getEitCollectionNotificationBodyList = await WorkListApiClient().GetCeiNotificationBody(workListData!.nOTIFICATIONID); + apiCallCount--; + if (apiCallCount == 0) { + Utils.hideLoading(context); + setState(() {}); + } + } catch (ex) { + apiCallCount--; + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + void getEitNotificationBody() async { try { if (apiCallCount == 0) Utils.showLoading(context); From c35074576a8c2c4d04b21a0cc9cee39b9697bf20 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 30 Jan 2025 11:41:44 +0300 Subject: [PATCH 18/39] offer and discount, do not show if api have issue. --- lib/classes/consts.dart | 6 +- lib/provider/dashboard_provider_model.dart | 4 +- lib/ui/landing/dashboard_screen.dart | 188 +++++++++++---------- 3 files changed, 102 insertions(+), 96 deletions(-) diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 6442b88..fea9b75 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // 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://mohemm.hmg.com"; // New Live server + // + // 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 diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 0e18544..e3f6511 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -253,8 +253,10 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { notifyListeners(); } catch (ex) { // Utils.hideLoading(context); + getOffersList=[]; + isOffersLoading = false; notifyListeners(); - Utils.handleException(ex, context, null); + // Utils.handleException(ex, context, null); } } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 333d271..4448ad1 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -3,7 +3,6 @@ import 'dart:io'; import 'dart:ui' as ui; import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -421,103 +420,108 @@ class _DashboardScreenState extends State with WidgetsBindingOb ), ], ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), - Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - LocaleKeys.offers.tr().toText12(), - Row( - children: [ - LocaleKeys.discounts.tr().toText24(isBold: true), - 6.width, - Container( - padding: const EdgeInsets.only(left: 8, right: 8), - decoration: BoxDecoration( - color: MyColors.yellowColor, - borderRadius: BorderRadius.circular(10), - ), - child: LocaleKeys.newString.tr().toText10(isBold: true)), - ], - ), - ], + Consumer(builder: (BuildContext context, DashboardProviderModel model, Widget? child) { + if (!model.isOffersLoading && model.getOffersList.isEmpty) { + return const SizedBox(); + } + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + LocaleKeys.offers.tr().toText12(), + Row( + children: [ + LocaleKeys.discounts.tr().toText24(isBold: true), + 6.width, + Container( + padding: const EdgeInsets.only(left: 8, right: 8), + decoration: BoxDecoration( + color: MyColors.yellowColor, + borderRadius: BorderRadius.circular(10), + ), + child: LocaleKeys.newString.tr().toText10(isBold: true)), + ], + ), + ], + ), ), - ), - LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { - Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); - }) - ], - ).paddingOnly(left: 21, right: 21), - Consumer( - builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - return SizedBox( - height: 103 + 33, - child: ListView.separated( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(left: 21, right: 21, top: 13), - scrollDirection: Axis.horizontal, - itemBuilder: (BuildContext cxt, int index) { - return model.isOffersLoading - ? const OffersShimmerWidget() - : InkWell( - onTap: () { - navigateToDetails(data.getOffersList[index]); - }, - child: SizedBox( - width: 73, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 73, - height: 73, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all( - Radius.circular(100), - ), - border: Border.all(color: MyColors.lightGreyE3Color, width: 1), - ), - child: ClipRRect( - borderRadius: const BorderRadius.all( - Radius.circular(50), + LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { + Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); + }) + ], + ).paddingOnly(left: 21, right: 21), + Consumer( + builder: (BuildContext context, DashboardProviderModel model, Widget? child) { + return SizedBox( + height: 103 + 33, + child: ListView.separated( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.only(left: 21, right: 21, top: 13), + scrollDirection: Axis.horizontal, + itemBuilder: (BuildContext cxt, int index) { + return model.isOffersLoading + ? const OffersShimmerWidget() + : InkWell( + onTap: () { + navigateToDetails(data.getOffersList[index]); + }, + child: SizedBox( + width: 73, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 73, + height: 73, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: const BorderRadius.all( + Radius.circular(100), + ), + border: Border.all(color: MyColors.lightGreyE3Color, width: 1), ), - child: Hero( - tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, - transitionOnUserGestures: true, - child: Image.network( - data.getOffersList[index].logo ?? "", - fit: BoxFit.contain, + child: ClipRRect( + borderRadius: const BorderRadius.all( + Radius.circular(50), + ), + child: Hero( + tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, + transitionOnUserGestures: true, + child: Image.network( + data.getOffersList[index].logo ?? "", + fit: BoxFit.contain, + ), ), ), ), - ), - 4.height, - Expanded( - child: AppState().isArabic(context) - ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) - : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), - ), - ], + 4.height, + Expanded( + child: AppState().isArabic(context) + ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) + : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), + ), + ], + ), ), - ), - ); - }, - separatorBuilder: (BuildContext cxt, int index) => 8.width, - itemCount: 9), - ); - }, - ), - ], - ), + ); + }, + separatorBuilder: (BuildContext cxt, int index) => 8.width, + itemCount: 9), + ); + }, + ), + ], + ); + }), Container( width: double.infinity, padding: const EdgeInsets.only(top: 31), From a33da491f96cb2e709abc8b15f81334a902ee93e Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 30 Jan 2025 15:14:05 +0300 Subject: [PATCH 19/39] description format section seperated in itg forms --- .../request_detail_fragment.dart | 94 ++++++++++++------- lib/widgets/item_detail_view_widget.dart | 8 +- 2 files changed, 64 insertions(+), 38 deletions(-) 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 83f574f..ba67ba4 100644 --- a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart +++ b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart @@ -69,46 +69,70 @@ class RequestDetailFragment extends StatelessWidget { ); } - Widget detailView(List fields) { + Widget detailView(List fieldsF) { + List fields = List.from(fieldsF); + bool isOdd = false; if (fields.length % 2 != 0) { isOdd = true; fields.add(new Fields()); } - return 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), - ), + + 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, diff --git a/lib/widgets/item_detail_view_widget.dart b/lib/widgets/item_detail_view_widget.dart index f6797e8..a98b066 100644 --- a/lib/widgets/item_detail_view_widget.dart +++ b/lib/widgets/item_detail_view_widget.dart @@ -52,8 +52,9 @@ class ItemDetailViewGridItem extends StatelessWidget { final String? value; final String? type; final bool isNeedToShowEmptyDivider; + final int maxLine; - ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.type = ""}) : super(key: key); + ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.type = "", this.maxLine = 6}) : super(key: key); @override Widget build(BuildContext context) { @@ -76,10 +77,11 @@ class ItemDetailViewGridItem extends StatelessWidget { ), ), child: isNeedToShowEmptyDivider - ? Container() + ? SizedBox() : Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, children: [ title != null ? Flexible(child: "$title:".toText12Auto(isBold: true, color: const Color(0xff2BB8A6))) : Container(), 4.width, @@ -87,7 +89,7 @@ class ItemDetailViewGridItem extends StatelessWidget { ? type!.toLowerCase() == "table" ? getStringFromJSON(value!) // : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 5)) - : (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 6) + : (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: maxLine) : Container(), ], ), From 6e3fc55fde6d49b465e28209dbf653d72f49e4b4 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 4 Feb 2025 11:06:03 +0300 Subject: [PATCH 20/39] event activity added - cont --- lib/api/dashboard_api_client.dart | 10 + lib/classes/consts.dart | 4 +- lib/classes/date_uitl.dart | 2 +- lib/models/dashboard/event_activity.dart | 77 +++ lib/models/generic_response_model.dart | 5 + lib/provider/dashboard_provider_model.dart | 28 +- lib/ui/landing/dashboard_screen.dart | 11 + lib/ui/landing/event_activity_banner.dart | 578 +++++++++++++++++++ lib/widgets/glowy_borders/glowy_borders.dart | 150 +++++ 9 files changed, 859 insertions(+), 6 deletions(-) create mode 100644 lib/models/dashboard/event_activity.dart create mode 100644 lib/ui/landing/event_activity_banner.dart create mode 100644 lib/widgets/glowy_borders/glowy_borders.dart diff --git a/lib/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart index bc0fece..89e7d48 100644 --- a/lib/api/dashboard_api_client.dart +++ b/lib/api/dashboard_api_client.dart @@ -105,6 +105,16 @@ class DashboardApiClient { }, 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); + } + //Mark Attendance 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"; diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index fea9b75..c2772b8 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // 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://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 diff --git a/lib/classes/date_uitl.dart b/lib/classes/date_uitl.dart index e27843c..53b6525 100644 --- a/lib/classes/date_uitl.dart +++ b/lib/classes/date_uitl.dart @@ -7,7 +7,7 @@ class DateUtil { /// static DateTime convertStringToDateMarathon(String date) { - // /Date(1585774800000+0300)/ + // return DateTime(2025, 2, 5); if (date != null) { const start = "/Date("; const end = "+0300)"; diff --git a/lib/models/dashboard/event_activity.dart b/lib/models/dashboard/event_activity.dart new file mode 100644 index 0000000..e7e821c --- /dev/null +++ b/lib/models/dashboard/event_activity.dart @@ -0,0 +1,77 @@ +class EventActivityList { + EventActivityList({ + required this.id, + required this.titleEn, + required this.titleAr, + required this.shortDescEn, + required this.shortDescAr, + required this.longDescEn, + required this.longDescAr, + required this.url, + required this.startOn, + required this.endOn, + required this.channel, + required this.isActive, + required this.createdBy, + required this.createdOn, + required this.modifiedBy, + required this.modifiedOn, + }); + + final int? id; + final String? titleEn; + final String? titleAr; + final String? shortDescEn; + final String? shortDescAr; + final String? longDescEn; + final String? longDescAr; + final String? url; + final String? startOn; + final String? endOn; + final int? channel; + final bool? isActive; + final int? createdBy; + final String? createdOn; + final String? modifiedBy; + final String? modifiedOn; + + factory EventActivityList.fromJson(Map json) { + return EventActivityList( + id: json["ID"], + titleEn: json["TitleEn"], + titleAr: json["TitleAr"], + shortDescEn: json["ShortDescEn"], + shortDescAr: json["ShortDescAr"], + longDescEn: json["LongDescEn"], + longDescAr: json["LongDescAr"], + url: json["URL"], + startOn: json["StartOn"], + endOn: json["EndOn"], + channel: json["Channel"], + isActive: json["IsActive"], + createdBy: json["CreatedBy"], + createdOn: json["CreatedOn"], + modifiedBy: json["ModifiedBy"], + modifiedOn: json["ModifiedOn"], + ); + } + + Map toJson() => { + "ID": id, + "TitleEn": titleEn, + "TitleAr": titleAr, + "ShortDescEn": shortDescEn, + "ShortDescAr": shortDescAr, + "LongDescEn": longDescEn, + "LongDescAr": longDescAr, + "URL": url, + "StartOn": startOn, + "EndOn": endOn, + "Channel": channel, + "IsActive": isActive, + "CreatedBy": createdBy, + "CreatedOn": createdOn, + "ModifiedBy": modifiedBy, + "ModifiedOn": modifiedOn, + }; +} diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index e87c3e0..ba48836 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -1,6 +1,7 @@ import 'package:mohem_flutter_app/models/add_att_success_list_model.dart'; import 'package:mohem_flutter_app/models/add_attachment_list_model.dart'; import 'package:mohem_flutter_app/models/basic_member_information_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/event_activity.dart'; import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_open_missing_swipes_list_model.dart'; @@ -214,6 +215,7 @@ class GenericResponseModel { List? getItemTypesList; List? getLookupValuesList; List? getMenuEntriesList; + List? getEventActivityList; List? getMoItemHistoryList; List? getMoNotificationBodyList; List? getNotificationButtonsList; @@ -487,6 +489,7 @@ class GenericResponseModel { this.getItemTypesList, this.getLookupValuesList, this.getMenuEntriesList, + this.getEventActivityList, this.getMoItemHistoryList, this.getMoNotificationBodyList, this.getNotificationButtonsList, @@ -974,6 +977,7 @@ class GenericResponseModel { getItemTypesList = json['GetItemTypesList']; getLookupValuesList = json['GetLookupValuesList']; getMenuEntriesList = json["GetMenuEntriesList"] == null ? null : List.from(json["GetMenuEntriesList"].map((x) => GetMenuEntriesList.fromJson(x))); + getEventActivityList = json["EventActivityList"] == null ? null : List.from(json["EventActivityList"].map((x) => EventActivityList.fromJson(x))); if (json['GetMoItemHistoryList'] != null) { getMoItemHistoryList = []; json['GetMoItemHistoryList'].forEach((v) { @@ -1630,6 +1634,7 @@ class GenericResponseModel { data['GetItemTypesList'] = this.getItemTypesList; data['GetLookupValuesList'] = this.getLookupValuesList; data['GetMenuEntriesList'] = this.getMenuEntriesList; + data['EventActivityList'] = this.getEventActivityList; if (this.getMoItemHistoryList != null) { data['GetMoItemHistoryList'] = this.getMoItemHistoryList!.map((v) => v.toJson()).toList(); } diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index e3f6511..9b57133 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -9,6 +9,7 @@ import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/models/dashboard/drawer_menu_item_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/event_activity.dart'; import 'package:mohem_flutter_app/models/dashboard/get_accrual_balances_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; import 'package:mohem_flutter_app/models/dashboard/get_open_notifications_list.dart'; @@ -20,7 +21,6 @@ import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_respo import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; -import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart'; import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; /// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool @@ -50,9 +50,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { //Menu Entries bool isServicesMenusLoading = true; + bool isEventLoadingLoading = true; List? homeMenus; List? getMenuEntriesList; + EventActivityList? eventActivity; + //Offers And Discounts bool isOffersLoading = true; List getOffersList = []; @@ -99,6 +102,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { ticketBalance = 0; isServicesMenusLoading = true; + isEventLoadingLoading = true; homeMenus = null; getMenuEntriesList = null; isOffersLoading = true; @@ -253,10 +257,28 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { notifyListeners(); } catch (ex) { // Utils.hideLoading(context); - getOffersList=[]; + getOffersList = []; isOffersLoading = false; notifyListeners(); - // Utils.handleException(ex, context, null); + // Utils.handleException(ex, context, null); + } + } + + void fetchEventActivity() async { + try { + GenericResponseModel? genericResponseModel = await DashboardApiClient().getEventActivity(); + List eventList = (genericResponseModel!.getEventActivityList ?? []); + if (eventList.isNotEmpty) { + eventActivity = eventList.first; + } + + isEventLoadingLoading = false; + notifyListeners(); + } catch (ex) { + logger.wtf(ex); + isEventLoadingLoading = false; + notifyListeners(); + Utils.handleException(ex, null, null); } } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 4448ad1..67e748c 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -21,6 +21,7 @@ import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.da import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; +import 'package:mohem_flutter_app/ui/landing/event_activity_banner.dart'; import 'package:mohem_flutter_app/ui/landing/widget/app_drawer.dart'; import 'package:mohem_flutter_app/ui/landing/widget/menus_widget.dart'; import 'package:mohem_flutter_app/ui/landing/widget/services_widget.dart'; @@ -149,6 +150,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb data.fetchMissingSwipe(context); data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchMenuEntries(); + data.fetchEventActivity(); data.getCategoryOffersListAPI(context); marathonProvider.getMarathonDetailsFromApi(); marathonProvider.getMarathonTutorial(); @@ -420,6 +422,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb ), ], ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), + eventActivityWidget(context), Consumer(builder: (BuildContext context, DashboardProviderModel model, Widget? child) { if (!model.isOffersLoading && model.getOffersList.isEmpty) { return const SizedBox(); @@ -706,6 +709,14 @@ class _DashboardScreenState extends State with WidgetsBindingOb ); } + Widget eventActivityWidget(BuildContext context) { + return (context.watch().isEventLoadingLoading) + ? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) + : context.watch().eventActivity == null + ? const SizedBox() + : const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0); + } + void navigateToDetails(OffersListModel offersListModelObj) { List getOffersDetailList = []; getOffersDetailList.clear(); diff --git a/lib/ui/landing/event_activity_banner.dart b/lib/ui/landing/event_activity_banner.dart new file mode 100644 index 0000000..83c58dd --- /dev/null +++ b/lib/ui/landing/event_activity_banner.dart @@ -0,0 +1,578 @@ +import 'dart:math' as math; + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/date_uitl.dart'; +import 'package:mohem_flutter_app/classes/decorations_helper.dart'; +import 'package:mohem_flutter_app/config/routes.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/main.dart'; +import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; +import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart'; +import 'package:mohem_flutter_app/ui/marathon/widgets/countdown_timer_main_screen.dart'; +import 'package:mohem_flutter_app/widgets/glowy_borders/glowy_borders.dart'; +import 'package:provider/provider.dart'; + +// It is used to pass a dummy time to test Marathon +int dummyTime = DateTime.now().millisecondsSinceEpoch + 8690; + +class EventActivityBanner extends StatelessWidget { + const EventActivityBanner({Key? key}) : super(key: key); + + // Widget getUnPrivilegedMarathon(BuildContext context) { + // return Container( + // decoration: MyDecorations.shadowDecoration, + // height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, + // clipBehavior: Clip.antiAlias, + // child: Stack( + // children: [ + // Transform( + // alignment: Alignment.center, + // transform: Matrix4.rotationY( + // AppState().isArabic(context) ? math.pi : 0, + // ), + // child: SvgPicture.asset( + // "assets/images/marathon_banner_bg.svg", + // fit: BoxFit.fill, + // width: double.infinity, + // ), + // ), + // AppState().isArabic(context) + // ? Positioned( + // right: -15, + // top: -10, + // child: Transform.rotate( + // angle: 10, + // child: Container( + // width: isTablet ? 70 : 65, + // height: isTablet ? 40 : 32, + // color: MyColors.darkDigitColor, + // ), + // ), + // ) + // : Positioned( + // left: -20, + // top: -10, + // child: Transform.rotate( + // angle: 15, + // child: Container( + // width: isTablet ? 70 : 65, + // height: isTablet ? 40 : 32, + // color: MyColors.darkDigitColor, + // ), + // ), + // ), + // SizedBox( + // width: double.infinity, + // height: double.infinity, + // child: Row( + // children: [ + // const Expanded( + // flex: 3, + // child: SizedBox( + // width: double.infinity, + // height: double.infinity, + // ), + // ), + // Expanded( + // flex: AppState().isArabic(context) ? 4 : 5, + // child: SizedBox( + // width: double.infinity, + // height: double.infinity, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Column( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + // children: [ + // AppState().isArabic(context) ? 0.height : 5.height, + // Text( + // LocaleKeys.getReadyForContest.tr(), + // style: TextStyle( + // fontSize: isTablet ? 20 : 11, + // fontStyle: FontStyle.italic, + // fontWeight: FontWeight.w600, + // color: MyColors.white.withOpacity(0.83), + // letterSpacing: -0.4, + // ), + // ), + // Text( + // LocaleKeys.brainMarathon.tr(), + // style: TextStyle( + // fontStyle: FontStyle.italic, + // fontSize: isTablet ? 30 : 19, + // fontWeight: FontWeight.bold, + // color: MyColors.white.withOpacity(0.83), + // height: 32 / 22, + // ), + // ), + // ], + // ).paddingOnly( + // left: AppState().isArabic(context) ? 12 : 3, + // right: AppState().isArabic(context) ? 3 : 12, + // ) + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // AppState().isArabic(context) + // ? Align( + // alignment: Alignment.topRight, + // child: SizedBox( + // height: isTablet ? 30 : 20, + // width: isTablet ? 45 : 35, + // child: Transform.rotate( + // angle: math.pi / 4.5, + // child: Text( + // LocaleKeys.brainMarathon.tr(), + // textAlign: TextAlign.center, + // maxLines: 2, + // style: TextStyle( + // color: MyColors.white, + // fontWeight: FontWeight.bold, + // fontSize: isTablet ? 8 : 6, + // height: 1.2, + // ), + // ), + // ), + // ), + // ).paddingOnly(top: 5) + // : Align( + // alignment: Alignment.topLeft, + // child: SizedBox( + // height: isTablet ? 30 : 20, + // width: isTablet ? 45 : 35, + // child: Transform.rotate( + // angle: -math.pi / 4.5, + // child: Text( + // LocaleKeys.brainMarathon.tr(), + // textAlign: TextAlign.center, + // maxLines: 2, + // style: TextStyle( + // color: MyColors.kWhiteColor, + // fontWeight: FontWeight.bold, + // fontSize: isTablet ? 8 : 6, + // height: 1.2, + // ), + // ), + // ), + // ), + // ).paddingOnly(top: 5), + // Container( + // height: double.infinity, + // width: double.infinity, + // color: Colors.black.withOpacity(0.6), + // child: const Icon( + // Icons.lock_rounded, + // color: MyColors.lightGreyIconColor, + // ), + // ), + // ], + // ), + // ); + // } + + Widget getNoUpcomingMarathonWidget(BuildContext context) { + return Container( + decoration: MyDecorations.shadowDecoration, + height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, + clipBehavior: Clip.antiAlias, + child: Stack( + children: [ + Transform( + alignment: Alignment.center, + transform: Matrix4.rotationY( + AppState().isArabic(context) ? math.pi : 0, + ), + child: SvgPicture.asset( + "assets/images/marathon_banner_bg.svg", + fit: BoxFit.fill, + width: double.infinity, + ), + ), + AppState().isArabic(context) + ? Positioned( + right: -15, + top: -10, + child: Transform.rotate( + angle: 10, + child: Container( + width: isTablet ? 70 : 65, + height: isTablet ? 40 : 32, + color: MyColors.darkDigitColor, + ), + ), + ) + : Positioned( + left: -20, + top: -10, + child: Transform.rotate( + angle: 15, + child: Container( + width: isTablet ? 70 : 65, + height: isTablet ? 40 : 32, + color: MyColors.darkDigitColor, + ), + ), + ), + SizedBox( + width: double.infinity, + height: double.infinity, + child: Row( + children: [ + const Expanded( + flex: 3, + child: SizedBox( + width: double.infinity, + height: double.infinity, + ), + ), + Expanded( + flex: AppState().isArabic(context) ? 4 : 5, + child: SizedBox( + width: double.infinity, + height: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + AppState().isArabic(context) ? 0.height : 5.height, + Text( + LocaleKeys.noUpcoming.tr(), + style: TextStyle( + fontSize: isTablet ? 20 : 11, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.w600, + color: MyColors.white.withOpacity(0.83), + letterSpacing: -0.4, + ), + ), + Text( + LocaleKeys.brainMarathon.tr(), + style: TextStyle( + fontStyle: FontStyle.italic, + fontSize: isTablet ? 30 : 19, + fontWeight: FontWeight.bold, + color: MyColors.white.withOpacity(0.83), + height: 32 / 22, + ), + ), + Text( + LocaleKeys.youCanPlayDemo.tr(), + style: TextStyle( + fontSize: isTablet ? 20 : 11, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.w600, + color: MyColors.white.withOpacity(0.83), + letterSpacing: -0.4, + ), + ), + ], + ).paddingOnly( + left: AppState().isArabic(context) ? 12 : 3, + right: AppState().isArabic(context) ? 3 : 12, + ) + ], + ), + ), + ), + ], + ), + ), + AppState().isArabic(context) + ? Align( + alignment: Alignment.topRight, + child: SizedBox( + height: isTablet ? 30 : 20, + width: isTablet ? 45 : 35, + child: Transform.rotate( + angle: math.pi / 4.5, + child: Text( + LocaleKeys.brainMarathon.tr(), + textAlign: TextAlign.center, + maxLines: 2, + style: TextStyle( + color: MyColors.white, + fontWeight: FontWeight.bold, + fontSize: isTablet ? 8 : 6, + height: 1.2, + ), + ), + ), + ), + ).paddingOnly(top: 5) + : Align( + alignment: Alignment.topLeft, + child: SizedBox( + height: isTablet ? 30 : 20, + width: isTablet ? 45 : 35, + child: Transform.rotate( + angle: -math.pi / 4.5, + child: Text( + LocaleKeys.brainMarathon.tr(), + textAlign: TextAlign.center, + maxLines: 2, + style: TextStyle( + color: MyColors.kWhiteColor, + fontWeight: FontWeight.bold, + fontSize: isTablet ? 8 : 6, + height: 1.2, + ), + ), + ), + ), + ).paddingOnly(top: 5), + ], + ), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.marathonIntroScreen); + }); + } + + @override + Widget build(BuildContext context) { + DashboardProviderModel dashboardProvider = context.read(); + + return Container( + // decoration: BoxDecoration( + // color: MyColors.kWhiteColor, + // borderRadius: BorderRadius.circular(8), + // boxShadow: [ + // BoxShadow( + // color: const Color(0xff000000).withOpacity(.05), + // blurRadius: 26, + // offset: const Offset(0, -3), + // ), + // ], + // ), + height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, + child: AnimatedGradientBorder( + borderSize: 3, + stretchAlongAxis: true, + animationTime: 2, + stretchAxis: Axis.vertical, + gradientColors: const [ + Color(0xff0E5A64), + Color(0xff0E5A64), + Color(0xff0E5A64), + Color(0xff91C481), + ], + borderRadius: BorderRadius.circular(10), + child: Container( + decoration: BoxDecoration( + color: const Color(0xff0E5A64), + borderRadius: BorderRadius.circular(8), + ), + // height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, + + child: Stack( + children: [ + // Transform( + // alignment: Alignment.center, + // transform: Matrix4.rotationY( + // AppState().isArabic(context) ? math.pi : 0, + // ), + // child: SvgPicture.asset( + // "assets/images/marathon_banner_bg.svg", + // fit: BoxFit.fill, + // width: double.infinity, + // ), + // ), + // AppState().isArabic(context) + // ? Positioned( + // right: -15, + // top: -10, + // child: Transform.rotate( + // angle: 10, + // child: Container( + // width: isTablet ? 70 : 65, + // height: isTablet ? 40 : 32, + // color: MyColors.darkDigitColor, + // ), + // ), + // ) + // : Positioned( + // left: -20, + // top: -10, + // child: Transform.rotate( + // angle: 15, + // child: Container( + // width: isTablet ? 70 : 65, + // height: isTablet ? 40 : 32, + // color: MyColors.darkDigitColor, + // ), + // ), + // ), + SizedBox( + width: double.infinity, + height: double.infinity, + child: Row( + children: [ + const Expanded( + flex: 3, + child: SizedBox( + width: double.infinity, + height: double.infinity, + ), + ), + Expanded( + flex: AppState().isArabic(context) ? 4 : 5, + child: SizedBox( + width: double.infinity, + height: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + AppState().isArabic(context) ? 0.height : 5.height, + Text( + LocaleKeys.getReadyForContest.tr(), + style: TextStyle( + fontSize: isTablet ? 20 : 11, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.w600, + color: MyColors.white.withOpacity(0.83), + letterSpacing: -0.4, + ), + ), + Flexible( + child: Text( + displayLocalizedContent( + isPhoneLangArabic: AppState().isArabic(context), + selectedLanguage: 3, + englishContent: dashboardProvider.eventActivity?.titleEn ?? "", + arabicContent: dashboardProvider.eventActivity?.titleAr ?? "", + ), + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontStyle: FontStyle.italic, + fontSize: isTablet ? 30 : 19, + fontWeight: FontWeight.bold, + color: MyColors.white.withOpacity(0.83), + height: 32 / 22, + ), + ), + ), + isTablet ? 10.height : 3.height, + CountdownTimerForMainScreen( + timeToMarathon: DateUtil.convertStringToDateMarathon(dashboardProvider.eventActivity!.startOn!).millisecondsSinceEpoch, + provider: context.read(), + ), + ], + ).paddingOnly( + left: AppState().isArabic(context) ? 12 : 3, + right: AppState().isArabic(context) ? 3 : 12, + ) + ], + ), + ), + ), + ], + ), + ), + // AppState().isArabic(context) + // ? Align( + // alignment: Alignment.topRight, + // child: SizedBox( + // height: isTablet ? 30 : 20, + // width: isTablet ? 45 : 35, + // child: Transform.rotate( + // angle: math.pi / 4.5, + // child: Text( + // LocaleKeys.brainMarathon.tr(), + // textAlign: TextAlign.center, + // maxLines: 2, + // style: TextStyle( + // color: MyColors.white, + // fontWeight: FontWeight.bold, + // fontSize: isTablet ? 8 : 6, + // height: 1.2, + // ), + // ), + // ), + // ), + // ).paddingOnly(top: 5) + // : Align( + // alignment: Alignment.topLeft, + // child: SizedBox( + // height: isTablet ? 30 : 20, + // width: isTablet ? 45 : 35, + // child: Transform.rotate( + // angle: -math.pi / 4.5, + // child: Text( + // LocaleKeys.brainMarathon.tr(), + // textAlign: TextAlign.center, + // maxLines: 2, + // style: TextStyle( + // color: MyColors.kWhiteColor, + // fontWeight: FontWeight.bold, + // fontSize: isTablet ? 8 : 6, + // height: 1.2, + // ), + // ), + // ), + // ), + // ).paddingOnly(top: 5), + !AppState().isArabic(context) + ? Positioned( + right: 0, + bottom: 0, + child: RotatedBox( + quarterTurns: 4, + child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), + ).paddingAll(isTablet ? 20 : 15), + ) + : Positioned( + bottom: 0, + left: 0, + child: RotatedBox( + quarterTurns: 2, + child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), + ).paddingAll(isTablet ? 20 : 15), + ), + ], + ).onPress(() async { + // int remainingTimeInMinutes = DateTime.parse(dashboardProvider.eventActivity!.startOn!).difference(DateTime.now()).inMinutes; + // if (remainingTimeInMinutes > 5 && dashboardProvider.eventActivity.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) { + // Utils.showLoading(context); + // try { + // await provider.initializeVideoPlayer().then((_) { + // Utils.hideLoading(context); + // provider.startTimerForSponsorVideo(); + // Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen); + // }); + // } catch (e) { + // if (kDebugMode) { + // log("Error in VideoPlayer: ${e.toString()}"); + // } + // Utils.hideLoading(context); + // Navigator.pushNamed(context, AppRoutes.marathonIntroScreen); + // } + // } else { + // Navigator.pushNamed(context, AppRoutes.marathonIntroScreen); + // } + // provider.updateLanguageAsPerMarathon(context, provider.isUpComingMarathon ? provider.marathonDetailModel : provider.demoMarathonDetailModel); + })), + ), + ); + } +} diff --git a/lib/widgets/glowy_borders/glowy_borders.dart b/lib/widgets/glowy_borders/glowy_borders.dart new file mode 100644 index 0000000..ffdc31b --- /dev/null +++ b/lib/widgets/glowy_borders/glowy_borders.dart @@ -0,0 +1,150 @@ +library glowy_borderspertino.dart; + +import 'dart:math' as math; + +import 'package:flutter/cupertino.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; + +class AnimatedGradientBorder extends StatefulWidget { + const AnimatedGradientBorder( + {Key? key, + required this.child, + required this.gradientColors, + required this.borderRadius, + this.animationTime, + this.borderSize, + this.animationProgress, + this.stretchAlongAxis = false, + this.stretchAxis = Axis.horizontal}); + + final Widget child; + final double? borderSize; + final List gradientColors; + final BorderRadiusGeometry borderRadius; + final int? animationTime; + final double? animationProgress; + final bool stretchAlongAxis; + final Axis stretchAxis; + + @override + State createState() => AnimatedGradientState(); +} + +class AnimatedGradientState extends State with SingleTickerProviderStateMixin { + late AnimationController _controller; + late Animation _angleAnimation; + + @override + void initState() { + super.initState(); + _controller = AnimationController(vsync: this, duration: Duration(seconds: widget.animationTime ?? 2)); + _controller.addListener(() => setState(() {})); + _angleAnimation = Tween(begin: 0.1, end: 2 * math.pi).animate(_controller); + if (widget.animationProgress != null) { + _controller.forward(); + } else { + _controller.repeat(); + } + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + void didUpdateWidget(covariant AnimatedGradientBorder oldWidget) { + super.didUpdateWidget(oldWidget); + double? animateTo = widget.animationProgress; + if (animateTo != null) { + _controller.animateTo(animateTo); + } else { + _controller.repeat(); + } + } + + @override + Widget build(BuildContext context) { + double? negativeMargin = -1.0 * (widget.borderSize ?? 0); + return Container( + padding: EdgeInsets.all(widget.borderSize ?? 0), + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration( + color: MyColors.kWhiteColor, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + child: Stack(alignment: Alignment.center, clipBehavior: Clip.none, children: [ + Positioned( + top: negativeMargin, + left: negativeMargin, + right: negativeMargin, + bottom: negativeMargin, + child: AnimatedGradientContainer( + gradientColors: widget.gradientColors, + borderRadius: widget.borderRadius, + gradientAngle: _angleAnimation.value, + )), + widget.child, + // BackdropFilter( + // filter: ImageFilter.blur(sigmaX: widget.glowSize ?? 0, sigmaY: widget.glowSize ?? 0), + // child: Stack( + // alignment: Alignment.center, + // clipBehavior: Clip.none, + // children: [ + // Positioned( + // top: negativeMargin, + // right: negativeMargin, + // left: negativeMargin, + // bottom: negativeMargin, + // child: AnimatedGradientContainer( + // gradientColors: widget.gradientColors, + // borderRadius: widget.borderRadius, + // gradientAngle: _angleAnimation.value, + // )), + // if (widget.stretchAlongAxis) + // SizedBox( + // width: widget.stretchAxis == Axis.horizontal ? double.infinity : null, + // height: widget.stretchAxis == Axis.vertical ? double.infinity : null, + // child: widget.child, + // ) + // else + // widget.child, + // ], + // ), + // ), + ]), + ); + } +} + +class AnimatedGradientContainer extends StatelessWidget { + const AnimatedGradientContainer({Key? key, required this.gradientColors, required this.gradientAngle, required this.borderRadius}); + + final List gradientColors; + final double gradientAngle; + final BorderRadiusGeometry borderRadius; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + borderRadius: borderRadius, + gradient: SweepGradient( + colors: [...gradientColors, ...gradientColors.reversed], stops: _generateColorStops([...gradientColors, ...gradientColors.reversed]), transform: GradientRotation(gradientAngle)))); + } + + List _generateColorStops(List colors) { + return colors.asMap().entries.map((entry) { + double percentageStop = entry.key / colors.length; + return percentageStop; + }).toList(); + } +} From 75ba1283d3066aa14b1ae28d333021e8f13e4089 Mon Sep 17 00:00:00 2001 From: sultan khan Date: Wed, 5 Feb 2025 10:39:03 +0300 Subject: [PATCH 21/39] event activity page added. --- assets/langs/ar-SA.json | 4 +- assets/langs/en-US.json | 4 +- lib/config/routes.dart | 4 + lib/generated/codegen_loader.g.dart | 8 +- lib/generated/locale_keys.g.dart | 3 +- lib/models/dashboard/event_activity.dart | 11 +- lib/ui/landing/dashboard_screen.dart | 6 +- lib/ui/landing/event_activity_banner.dart | 340 ++++-------------- .../widgets/countdown_timer_main_screen.dart | 18 +- .../event_activity/activity_event_card.dart | 112 ++++++ .../event_activity/activity_footer.dart | 39 ++ .../event_activity/event_activity.dart | 49 +++ 12 files changed, 303 insertions(+), 295 deletions(-) create mode 100644 lib/ui/screens/event_activity/activity_event_card.dart create mode 100644 lib/ui/screens/event_activity/activity_footer.dart create mode 100644 lib/ui/screens/event_activity/event_activity.dart diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 1eb7dde..c4c5f20 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -613,5 +613,7 @@ "manageGroup": "إدارة المجموعة", "members": "الأعضاء", "searchByUserName": "البحث بواسطة اسم المستخدم", - "shareScreen": "مشاركة الشاشة" + "shareScreen": "مشاركة الشاشة", + "start":"يبدأ", + "about":"عن" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 03ae4d6..559b9c9 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -611,5 +611,7 @@ "qtyOrdered": "Qty. Ordered", "qtyReceived": "Qty. Received", "bonusQty": "Bonus Qty.", - "balQty": "Bal. Qty." + "balQty": "Bal. Qty.", + "start":"Start", + "about":"About" } \ No newline at end of file diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 6afc095..4653880 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -56,6 +56,7 @@ import 'package:mohem_flutter_app/ui/screens/announcements/announcements.dart'; import 'package:mohem_flutter_app/ui/screens/child_education/child_education_assistance.dart'; // import 'package:mohem_flutter_app/ui/my_attendance/work_from_home_screen.dart'; import 'package:mohem_flutter_app/ui/screens/eit/add_eit.dart'; +import 'package:mohem_flutter_app/ui/screens/event_activity/event_activity.dart'; import 'package:mohem_flutter_app/ui/screens/items_for_sale/add_new_item_for_sale.dart'; import 'package:mohem_flutter_app/ui/screens/items_for_sale/item_for_sale_detail.dart'; import 'package:mohem_flutter_app/ui/screens/items_for_sale/items_for_sale_home.dart'; @@ -208,6 +209,8 @@ class AppRoutes { static const String appUpdateScreen = "/appUpdateScreen"; static const String childEducation = "/childEducation"; + static const String activityScreen = "/activityScreen"; + static final Map routes = { login: (BuildContext context) => LoginScreen(), verifyLogin: (BuildContext context) => VerifyLoginScreen(), @@ -325,5 +328,6 @@ class AppRoutes { unsafeDeviceScreen: (BuildContext context) => const UnsafeDeviceScreen(), appUpdateScreen: (BuildContext context) => const AppUpdateScreen(), childEducation: (BuildContext context) => ChildEducationAssistance(), + activityScreen:(BuildContext context) => const EventActivityScreen() }; } diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 36d809d..0e2cfbf 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -626,7 +626,9 @@ class CodegenLoader extends AssetLoader{ "manageGroup": "إدارة المجموعة", "members": "الأعضاء", "searchByUserName": "البحث بواسطة اسم المستخدم", - "shareScreen": "مشاركة الشاشة" + "shareScreen": "مشاركة الشاشة", + "start":"يبدأ", + "about":"عن" }; static const Map en_US = { "mohemm": "Mohemm", @@ -1240,7 +1242,9 @@ static const Map en_US = { "qtyOrdered": "Qty. Ordered", "qtyReceived": "Qty. Received", "bonusQty": "Bonus Qty.", - "balQty": "Bal. Qty." + "balQty": "Bal. Qty.", + "start":"Start", + "about":"About" }; static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 851a5cd..f8bc858 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -597,5 +597,6 @@ abstract class LocaleKeys { static const members = 'members'; static const searchByUserName = 'searchByUserName'; static const shareScreen = 'shareScreen'; - + static const start = 'start'; + static const about ='about'; } diff --git a/lib/models/dashboard/event_activity.dart b/lib/models/dashboard/event_activity.dart index e7e821c..4b523d7 100644 --- a/lib/models/dashboard/event_activity.dart +++ b/lib/models/dashboard/event_activity.dart @@ -1,4 +1,4 @@ -class EventActivityList { + class EventActivityList { EventActivityList({ required this.id, required this.titleEn, @@ -16,6 +16,8 @@ class EventActivityList { required this.createdOn, required this.modifiedBy, required this.modifiedOn, + required this.shortImageURL, + required this.detailImageURL }); final int? id; @@ -34,7 +36,8 @@ class EventActivityList { final String? createdOn; final String? modifiedBy; final String? modifiedOn; - + final String? shortImageURL; + final String? detailImageURL; factory EventActivityList.fromJson(Map json) { return EventActivityList( id: json["ID"], @@ -53,6 +56,8 @@ class EventActivityList { createdOn: json["CreatedOn"], modifiedBy: json["ModifiedBy"], modifiedOn: json["ModifiedOn"], + shortImageURL: json["ShortImageURL"], + detailImageURL: json["DetailImageURL"] ); } @@ -73,5 +78,7 @@ class EventActivityList { "CreatedOn": createdOn, "ModifiedBy": modifiedBy, "ModifiedOn": modifiedOn, + "DetailImageURL": detailImageURL, + "ShortImageURL" : shortImageURL }; } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 67e748c..4640c25 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -712,9 +712,9 @@ class _DashboardScreenState extends State with WidgetsBindingOb Widget eventActivityWidget(BuildContext context) { return (context.watch().isEventLoadingLoading) ? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) - : context.watch().eventActivity == null - ? const SizedBox() - : const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0); + : (context.watch().eventActivity != null && context.watch().eventActivity!.isActive ==true) + ? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) + : const SizedBox(); } void navigateToDetails(OffersListModel offersListModelObj) { diff --git a/lib/ui/landing/event_activity_banner.dart b/lib/ui/landing/event_activity_banner.dart index 83c58dd..47c8158 100644 --- a/lib/ui/landing/event_activity_banner.dart +++ b/lib/ui/landing/event_activity_banner.dart @@ -19,170 +19,11 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/countdown_timer_main_scree import 'package:mohem_flutter_app/widgets/glowy_borders/glowy_borders.dart'; import 'package:provider/provider.dart'; -// It is used to pass a dummy time to test Marathon int dummyTime = DateTime.now().millisecondsSinceEpoch + 8690; class EventActivityBanner extends StatelessWidget { const EventActivityBanner({Key? key}) : super(key: key); - // Widget getUnPrivilegedMarathon(BuildContext context) { - // return Container( - // decoration: MyDecorations.shadowDecoration, - // height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, - // clipBehavior: Clip.antiAlias, - // child: Stack( - // children: [ - // Transform( - // alignment: Alignment.center, - // transform: Matrix4.rotationY( - // AppState().isArabic(context) ? math.pi : 0, - // ), - // child: SvgPicture.asset( - // "assets/images/marathon_banner_bg.svg", - // fit: BoxFit.fill, - // width: double.infinity, - // ), - // ), - // AppState().isArabic(context) - // ? Positioned( - // right: -15, - // top: -10, - // child: Transform.rotate( - // angle: 10, - // child: Container( - // width: isTablet ? 70 : 65, - // height: isTablet ? 40 : 32, - // color: MyColors.darkDigitColor, - // ), - // ), - // ) - // : Positioned( - // left: -20, - // top: -10, - // child: Transform.rotate( - // angle: 15, - // child: Container( - // width: isTablet ? 70 : 65, - // height: isTablet ? 40 : 32, - // color: MyColors.darkDigitColor, - // ), - // ), - // ), - // SizedBox( - // width: double.infinity, - // height: double.infinity, - // child: Row( - // children: [ - // const Expanded( - // flex: 3, - // child: SizedBox( - // width: double.infinity, - // height: double.infinity, - // ), - // ), - // Expanded( - // flex: AppState().isArabic(context) ? 4 : 5, - // child: SizedBox( - // width: double.infinity, - // height: double.infinity, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Column( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // AppState().isArabic(context) ? 0.height : 5.height, - // Text( - // LocaleKeys.getReadyForContest.tr(), - // style: TextStyle( - // fontSize: isTablet ? 20 : 11, - // fontStyle: FontStyle.italic, - // fontWeight: FontWeight.w600, - // color: MyColors.white.withOpacity(0.83), - // letterSpacing: -0.4, - // ), - // ), - // Text( - // LocaleKeys.brainMarathon.tr(), - // style: TextStyle( - // fontStyle: FontStyle.italic, - // fontSize: isTablet ? 30 : 19, - // fontWeight: FontWeight.bold, - // color: MyColors.white.withOpacity(0.83), - // height: 32 / 22, - // ), - // ), - // ], - // ).paddingOnly( - // left: AppState().isArabic(context) ? 12 : 3, - // right: AppState().isArabic(context) ? 3 : 12, - // ) - // ], - // ), - // ), - // ), - // ], - // ), - // ), - // AppState().isArabic(context) - // ? Align( - // alignment: Alignment.topRight, - // child: SizedBox( - // height: isTablet ? 30 : 20, - // width: isTablet ? 45 : 35, - // child: Transform.rotate( - // angle: math.pi / 4.5, - // child: Text( - // LocaleKeys.brainMarathon.tr(), - // textAlign: TextAlign.center, - // maxLines: 2, - // style: TextStyle( - // color: MyColors.white, - // fontWeight: FontWeight.bold, - // fontSize: isTablet ? 8 : 6, - // height: 1.2, - // ), - // ), - // ), - // ), - // ).paddingOnly(top: 5) - // : Align( - // alignment: Alignment.topLeft, - // child: SizedBox( - // height: isTablet ? 30 : 20, - // width: isTablet ? 45 : 35, - // child: Transform.rotate( - // angle: -math.pi / 4.5, - // child: Text( - // LocaleKeys.brainMarathon.tr(), - // textAlign: TextAlign.center, - // maxLines: 2, - // style: TextStyle( - // color: MyColors.kWhiteColor, - // fontWeight: FontWeight.bold, - // fontSize: isTablet ? 8 : 6, - // height: 1.2, - // ), - // ), - // ), - // ), - // ).paddingOnly(top: 5), - // Container( - // height: double.infinity, - // width: double.infinity, - // color: Colors.black.withOpacity(0.6), - // child: const Icon( - // Icons.lock_rounded, - // color: MyColors.lightGreyIconColor, - // ), - // ), - // ], - // ), - // ); - // } - Widget getNoUpcomingMarathonWidget(BuildContext context) { return Container( decoration: MyDecorations.shadowDecoration, @@ -348,7 +189,7 @@ class EventActivityBanner extends StatelessWidget { Widget build(BuildContext context) { DashboardProviderModel dashboardProvider = context.read(); - return Container( + return SizedBox( // decoration: BoxDecoration( // color: MyColors.kWhiteColor, // borderRadius: BorderRadius.circular(8), @@ -384,52 +225,46 @@ class EventActivityBanner extends StatelessWidget { children: [ // Transform( // alignment: Alignment.center, - // transform: Matrix4.rotationY( - // AppState().isArabic(context) ? math.pi : 0, - // ), - // child: SvgPicture.asset( - // "assets/images/marathon_banner_bg.svg", - // fit: BoxFit.fill, - // width: double.infinity, - // ), - // ), - // AppState().isArabic(context) - // ? Positioned( - // right: -15, - // top: -10, - // child: Transform.rotate( - // angle: 10, - // child: Container( - // width: isTablet ? 70 : 65, - // height: isTablet ? 40 : 32, - // color: MyColors.darkDigitColor, - // ), - // ), - // ) - // : Positioned( - // left: -20, - // top: -10, - // child: Transform.rotate( - // angle: 15, - // child: Container( - // width: isTablet ? 70 : 65, - // height: isTablet ? 40 : 32, - // color: MyColors.darkDigitColor, - // ), - // ), - // ), + // // transform: Matrix4.rotationY( + // // AppState().isArabic(context) ? math.pi : 0, + // // ), + // child: + // + + AppState().isArabic(context) + ? Positioned( + left: -15, + top: -10, + child: Transform.rotate( + angle: 10, + child: SizedBox( + child: SvgPicture.asset( + "assets/images/light_bulb.svg"), + ), + ), + ) + : Positioned( + right: 0, + top: 10, + child: Opacity( + opacity: .5, + child: SvgPicture.asset( + "assets/images/light_bulb.svg", + ), + )), + SizedBox( width: double.infinity, height: double.infinity, child: Row( children: [ - const Expanded( - flex: 3, - child: SizedBox( - width: double.infinity, - height: double.infinity, - ), - ), + Expanded( + flex: 3, + child: Image.network( + dashboardProvider.eventActivity?.shortImageURL ?? + "", + fit: BoxFit.cover, + )), Expanded( flex: AppState().isArabic(context) ? 4 : 5, child: SizedBox( @@ -444,16 +279,7 @@ class EventActivityBanner extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ AppState().isArabic(context) ? 0.height : 5.height, - Text( - LocaleKeys.getReadyForContest.tr(), - style: TextStyle( - fontSize: isTablet ? 20 : 11, - fontStyle: FontStyle.italic, - fontWeight: FontWeight.w600, - color: MyColors.white.withOpacity(0.83), - letterSpacing: -0.4, - ), - ), + Flexible( child: Text( displayLocalizedContent( @@ -465,17 +291,33 @@ class EventActivityBanner extends StatelessWidget { overflow: TextOverflow.ellipsis, style: TextStyle( fontStyle: FontStyle.italic, - fontSize: isTablet ? 30 : 19, + fontSize: isTablet ? 25 : 16, fontWeight: FontWeight.bold, - color: MyColors.white.withOpacity(0.83), - height: 32 / 22, + color: MyColors.white, + height: 32 / 24, ), ), + ), Text( + displayLocalizedContent( + isPhoneLangArabic: AppState().isArabic(context), + selectedLanguage: 3, + englishContent: dashboardProvider.eventActivity?.shortDescEn ?? "", + arabicContent: dashboardProvider.eventActivity?.shortDescAr ?? "", + ), + style: TextStyle( + fontSize: isTablet ? 20 : 11, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.w600, + color: MyColors.white, + letterSpacing: -0.5, + ), ), - isTablet ? 10.height : 3.height, + + isTablet ? 15.height : 10.height, CountdownTimerForMainScreen( timeToMarathon: DateUtil.convertStringToDateMarathon(dashboardProvider.eventActivity!.startOn!).millisecondsSinceEpoch, provider: context.read(), + isEvent: true, ), ], ).paddingOnly( @@ -489,49 +331,7 @@ class EventActivityBanner extends StatelessWidget { ], ), ), - // AppState().isArabic(context) - // ? Align( - // alignment: Alignment.topRight, - // child: SizedBox( - // height: isTablet ? 30 : 20, - // width: isTablet ? 45 : 35, - // child: Transform.rotate( - // angle: math.pi / 4.5, - // child: Text( - // LocaleKeys.brainMarathon.tr(), - // textAlign: TextAlign.center, - // maxLines: 2, - // style: TextStyle( - // color: MyColors.white, - // fontWeight: FontWeight.bold, - // fontSize: isTablet ? 8 : 6, - // height: 1.2, - // ), - // ), - // ), - // ), - // ).paddingOnly(top: 5) - // : Align( - // alignment: Alignment.topLeft, - // child: SizedBox( - // height: isTablet ? 30 : 20, - // width: isTablet ? 45 : 35, - // child: Transform.rotate( - // angle: -math.pi / 4.5, - // child: Text( - // LocaleKeys.brainMarathon.tr(), - // textAlign: TextAlign.center, - // maxLines: 2, - // style: TextStyle( - // color: MyColors.kWhiteColor, - // fontWeight: FontWeight.bold, - // fontSize: isTablet ? 8 : 6, - // height: 1.2, - // ), - // ), - // ), - // ), - // ).paddingOnly(top: 5), + !AppState().isArabic(context) ? Positioned( right: 0, @@ -551,25 +351,11 @@ class EventActivityBanner extends StatelessWidget { ), ], ).onPress(() async { - // int remainingTimeInMinutes = DateTime.parse(dashboardProvider.eventActivity!.startOn!).difference(DateTime.now()).inMinutes; - // if (remainingTimeInMinutes > 5 && dashboardProvider.eventActivity.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) { - // Utils.showLoading(context); - // try { - // await provider.initializeVideoPlayer().then((_) { - // Utils.hideLoading(context); - // provider.startTimerForSponsorVideo(); - // Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen); - // }); - // } catch (e) { - // if (kDebugMode) { - // log("Error in VideoPlayer: ${e.toString()}"); - // } - // Utils.hideLoading(context); - // Navigator.pushNamed(context, AppRoutes.marathonIntroScreen); - // } - // } else { - // Navigator.pushNamed(context, AppRoutes.marathonIntroScreen); - // } + int remainingTimeInMinutes = DateUtil.convertStringToDateMarathon(dashboardProvider.eventActivity!.startOn!).difference(DateTime.now()).inMinutes; + if (remainingTimeInMinutes < 0) { + Navigator.pushNamed(context, AppRoutes.activityScreen); + + } // provider.updateLanguageAsPerMarathon(context, provider.isUpComingMarathon ? provider.marathonDetailModel : provider.demoMarathonDetailModel); })), ), diff --git a/lib/ui/marathon/widgets/countdown_timer_main_screen.dart b/lib/ui/marathon/widgets/countdown_timer_main_screen.dart index ef828da..e9818c2 100644 --- a/lib/ui/marathon/widgets/countdown_timer_main_screen.dart +++ b/lib/ui/marathon/widgets/countdown_timer_main_screen.dart @@ -13,19 +13,15 @@ import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart'; class CountdownTimerForMainScreen extends StatelessWidget { final int timeToMarathon; final MarathonProvider provider; - + final bool isEvent; CountdownTimerForMainScreen({ Key? key, required this.provider, required this.timeToMarathon, + this.isEvent =false, }) : super(key: key); - final TextStyle styleTextHome = TextStyle( - color: MyColors.white.withOpacity(0.45), - fontStyle: FontStyle.italic, - fontWeight: FontWeight.w800, - letterSpacing: -0.4, - ); + final TextStyle styleDigitHome = TextStyle( height: 22 / 27, @@ -75,7 +71,13 @@ class CountdownTimerForMainScreen extends StatelessWidget { text, minFontSize: 7, maxFontSize: 8, - style: styleTextHome, + style: TextStyle( + color: isEvent ? MyColors.white : MyColors.white.withOpacity(0.45), + fontStyle: FontStyle.italic, + fontWeight: FontWeight.w800, + letterSpacing: -0.4, + ), + ); } diff --git a/lib/ui/screens/event_activity/activity_event_card.dart b/lib/ui/screens/event_activity/activity_event_card.dart new file mode 100644 index 0000000..5c02971 --- /dev/null +++ b/lib/ui/screens/event_activity/activity_event_card.dart @@ -0,0 +1,112 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/classes/decorations_helper.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/main.dart'; +import 'package:mohem_flutter_app/models/marathon/marathon_model.dart'; +import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; +import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart'; +import 'package:provider/provider.dart'; +import 'package:shimmer/shimmer.dart'; + +class ActivityEventDetailsCard extends StatelessWidget { + final DashboardProviderModel model; + + const ActivityEventDetailsCard({Key? key, required this.model}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + decoration: MyDecorations.shadowDecoration, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CachedNetworkImage( + imageUrl: model.eventActivity!.detailImageURL!, + placeholder: (BuildContext context, String url) => const LinearProgressIndicator( + value: 0.7, + minHeight: 200, + valueColor: AlwaysStoppedAnimation(Colors.white), + backgroundColor: Color(0xff196D73), + ).toShimmer(), + fit: BoxFit.cover,width: double.infinity , + ), + + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 20,), + Text( + displayLocalizedContent( + isPhoneLangArabic: AppState().isArabic(context), + selectedLanguage: 3, + englishContent: model.eventActivity?.titleEn ?? "", + arabicContent: model.eventActivity?.titleAr ?? "", + ), + style: TextStyle( + fontStyle: FontStyle.italic, + fontSize: isTablet ? 30 : 20, + fontWeight: FontWeight.bold, + color:const Color(0xff3C3838), + // height: 42 / 30, + ), + + ).paddingOnly(left: 10, right: 10, bottom: 2), + + Row(children:[ + SvgPicture.asset("assets/images/highlight.svg"), + Text( + displayLocalizedContent( + isPhoneLangArabic: AppState().isArabic(context), + selectedLanguage: 3, + englishContent: model.eventActivity?.shortDescEn ?? "", + arabicContent: model.eventActivity?.shortDescAr ?? "", + ), + style: TextStyle( + fontStyle: FontStyle.italic, + fontSize: isTablet ? 20 : 14, + fontWeight: FontWeight.bold, + color:const Color(0xff2BB8A8), + // height: 32 / 24, + ), + + ).paddingOnly(left: 10, right: 10) + ]).paddingOnly(bottom: 25), + + LocaleKeys.about.tr().toText16(color: const Color(0xff3C3838)).paddingOnly(bottom: 5), + Text( + displayLocalizedContent( + isPhoneLangArabic: AppState().isArabic(context), + selectedLanguage: 3, + englishContent: model.eventActivity?.longDescEn ?? "", + arabicContent: model.eventActivity?.longDescAr ?? "", + ), + style: TextStyle( + fontStyle: FontStyle.italic, + fontSize: isTablet ? 18 : 12, + fontWeight: FontWeight.bold, + color:const Color(0xff3C3838), + // height: 32 / 24, + ), + + ).paddingOnly(bottom: 10) + ], + ) + ]); + } +} diff --git a/lib/ui/screens/event_activity/activity_footer.dart b/lib/ui/screens/event_activity/activity_footer.dart new file mode 100644 index 0000000..a5fcd81 --- /dev/null +++ b/lib/ui/screens/event_activity/activity_footer.dart @@ -0,0 +1,39 @@ +// ignore_for_file: always_specify_types + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/colors.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/main.dart'; +import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; +import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class ActivityEventFooter extends StatelessWidget { + final DashboardProviderModel provider; + + const ActivityEventFooter({ + Key? key, + required this.provider, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Column(children: [ + DefaultButton( + LocaleKeys.start.tr(), + () => launchUrl(Uri.parse(provider.eventActivity!.url!)), + color: MyColors.greenColor, + ).insideContainer, + + ]); + + } + + +} diff --git a/lib/ui/screens/event_activity/event_activity.dart b/lib/ui/screens/event_activity/event_activity.dart new file mode 100644 index 0000000..f523eb6 --- /dev/null +++ b/lib/ui/screens/event_activity/event_activity.dart @@ -0,0 +1,49 @@ +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/widget_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; +import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart'; +import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_details_card.dart'; +import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_footer.dart'; +import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_timer_card.dart'; +import 'package:mohem_flutter_app/ui/screens/event_activity/activity_event_card.dart'; +import 'package:mohem_flutter_app/ui/screens/event_activity/activity_footer.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:provider/provider.dart'; + +class EventActivityScreen extends StatelessWidget { + const EventActivityScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + DashboardProviderModel provider = context.read(); + return Scaffold( + appBar: AppBarWidget( + context, + title: LocaleKeys.details.tr(), + onHomeTapped: () { + Navigator.pop(context); + + }, + onBackTapped: () { + Navigator.pop(context); + }, + ), + body: Column( + children: [ + ListView( + padding: const EdgeInsets.all(21), + children: [ + ActivityEventDetailsCard(model: provider), + 20.height, + ], + ).expanded, + 1.divider, + ActivityEventFooter(provider: provider), + ], + ), + ); + } +} From 822a99a2918ae5b573080f305272c04843023bc7 Mon Sep 17 00:00:00 2001 From: sultan khan Date: Wed, 5 Feb 2025 17:38:14 +0300 Subject: [PATCH 22/39] countdown updated. --- lib/ui/landing/event_activity_banner.dart | 6 +- .../event_activity/activity_footer.dart | 63 +++++++++++++++++-- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/lib/ui/landing/event_activity_banner.dart b/lib/ui/landing/event_activity_banner.dart index 47c8158..2e9315f 100644 --- a/lib/ui/landing/event_activity_banner.dart +++ b/lib/ui/landing/event_activity_banner.dart @@ -351,11 +351,11 @@ class EventActivityBanner extends StatelessWidget { ), ], ).onPress(() async { - int remainingTimeInMinutes = DateUtil.convertStringToDateMarathon(dashboardProvider.eventActivity!.startOn!).difference(DateTime.now()).inMinutes; - if (remainingTimeInMinutes < 0) { + // int remainingTimeInMinutes = DateUtil.convertStringToDateMarathon(dashboardProvider.eventActivity!.startOn!).difference(DateTime.now()).inMinutes; + // if (remainingTimeInMinutes < 0) { Navigator.pushNamed(context, AppRoutes.activityScreen); - } + //} // provider.updateLanguageAsPerMarathon(context, provider.isUpComingMarathon ? provider.marathonDetailModel : provider.demoMarathonDetailModel); })), ), diff --git a/lib/ui/screens/event_activity/activity_footer.dart b/lib/ui/screens/event_activity/activity_footer.dart index a5fcd81..8db2175 100644 --- a/lib/ui/screens/event_activity/activity_footer.dart +++ b/lib/ui/screens/event_activity/activity_footer.dart @@ -2,8 +2,10 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/date_uitl.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'; @@ -11,7 +13,9 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart'; +import 'package:mohem_flutter_app/ui/marathon/widgets/countdown_timer_main_screen.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class ActivityEventFooter extends StatelessWidget { @@ -24,12 +28,63 @@ class ActivityEventFooter extends StatelessWidget { @override Widget build(BuildContext context) { + + int remainingTime = DateTime.now().millisecondsSinceEpoch + DateUtil.convertStringToDateMarathon(provider.eventActivity!.startOn!).difference(DateTime.now()).inMilliseconds; + return Column(children: [ - DefaultButton( + CountdownTimer( + endTime: remainingTime, + widgetBuilder: (context, time) { + if (time == null) { + return DefaultButton( + LocaleKeys.start.tr(), + () => launchUrl(Uri.parse(provider.eventActivity!.url!)), + color: MyColors.greenColor, + ).insideContainer; + } + return Container( + height: 58, + padding: const EdgeInsets.only( + top: 15, bottom: 15, right: 30, left: 30), + margin: const EdgeInsets.only(top: 5, bottom: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + gradient: + const LinearGradient( + transform: GradientRotation(.83), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor + ], + ), + ), + child: CountdownTimerForMainScreen( + timeToMarathon: DateUtil + .convertStringToDateMarathon(provider.eventActivity!.startOn!) + .millisecondsSinceEpoch, + provider: context.read(), + isEvent: true, + )); + + }, + onEnd: (){ + + }, + endWidget: DefaultButton( LocaleKeys.start.tr(), - () => launchUrl(Uri.parse(provider.eventActivity!.url!)), - color: MyColors.greenColor, - ).insideContainer, + () => launchUrl(Uri.parse(provider.eventActivity!.url!)), + color: MyColors.greenColor, + ).insideContainer, + + ) + // if (remainingTimeInMinutes < 0) + // + // else + // + // + // , ]); From 29334a9ef01dbde505ca7f04b3e4cd0f8969acff Mon Sep 17 00:00:00 2001 From: sultan khan Date: Thu, 6 Feb 2025 10:38:15 +0300 Subject: [PATCH 23/39] leave balance page fix. --- lib/ui/leave_balance/leave_balance_screen.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ui/leave_balance/leave_balance_screen.dart b/lib/ui/leave_balance/leave_balance_screen.dart index 447767f..85354f9 100644 --- a/lib/ui/leave_balance/leave_balance_screen.dart +++ b/lib/ui/leave_balance/leave_balance_screen.dart @@ -64,7 +64,7 @@ class _LeaveBalanceState extends State { context, title: LocaleKeys.leaveBalance.tr(), ), - body: Column( + body:SingleChildScrollView(child:Column( children: [ Padding( padding: const EdgeInsets.all(21.0), @@ -76,8 +76,10 @@ class _LeaveBalanceState extends State { : (absenceTransList!.isEmpty ? Utils.getNoDataWidget(context).paddingOnly(top: 50) : ListView( - physics: const BouncingScrollPhysics(), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), padding: const EdgeInsets.all(21), + children: [ // BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true, selectedEmp: employeeId, showLoading: false), // 12.height, @@ -113,7 +115,7 @@ class _LeaveBalanceState extends State { ], )), ], - ), + )), floatingActionButton: Container( height: 54, width: 54, From 6e15336cc48b8f0fcc3c391e8b51afb322ad6cc4 Mon Sep 17 00:00:00 2001 From: sultan khan Date: Thu, 6 Feb 2025 11:22:30 +0300 Subject: [PATCH 24/39] image changes. --- lib/ui/landing/event_activity_banner.dart | 5 ++++- lib/ui/screens/event_activity/activity_event_card.dart | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ui/landing/event_activity_banner.dart b/lib/ui/landing/event_activity_banner.dart index 2e9315f..511b0fe 100644 --- a/lib/ui/landing/event_activity_banner.dart +++ b/lib/ui/landing/event_activity_banner.dart @@ -25,6 +25,7 @@ class EventActivityBanner extends StatelessWidget { const EventActivityBanner({Key? key}) : super(key: key); Widget getNoUpcomingMarathonWidget(BuildContext context) { + ; return Container( decoration: MyDecorations.shadowDecoration, height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, @@ -258,13 +259,15 @@ class EventActivityBanner extends StatelessWidget { height: double.infinity, child: Row( children: [ + Expanded( flex: 3, child: Image.network( dashboardProvider.eventActivity?.shortImageURL ?? "", fit: BoxFit.cover, - )), + key: UniqueKey() + ).paddingAll(5)), Expanded( flex: AppState().isArabic(context) ? 4 : 5, child: SizedBox( diff --git a/lib/ui/screens/event_activity/activity_event_card.dart b/lib/ui/screens/event_activity/activity_event_card.dart index 5c02971..56450b5 100644 --- a/lib/ui/screens/event_activity/activity_event_card.dart +++ b/lib/ui/screens/event_activity/activity_event_card.dart @@ -35,13 +35,16 @@ class ActivityEventDetailsCard extends StatelessWidget { children: [ CachedNetworkImage( imageUrl: model.eventActivity!.detailImageURL!, + height: 200, placeholder: (BuildContext context, String url) => const LinearProgressIndicator( value: 0.7, minHeight: 200, + valueColor: AlwaysStoppedAnimation(Colors.white), backgroundColor: Color(0xff196D73), ).toShimmer(), - fit: BoxFit.cover,width: double.infinity , + fit: BoxFit.contain,width: double.infinity , + cacheKey: UniqueKey().toString(), ), ], From 5adc2bc64fe5b1a0c2202bc3b363fb2ab22a79fd Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 6 Feb 2025 11:23:58 +0300 Subject: [PATCH 25/39] updates --- lib/app_state/app_state.dart | 2 +- lib/ui/login/login_screen.dart | 8 ++++---- lib/ui/unsafe_device_screen.dart | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index aea9251..7269cd5 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.3, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.6, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 2aa2da3..13d8853 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -88,9 +88,9 @@ class _LoginScreenState extends State { if (Platform.isAndroid) { // isOnExternalStorage = await SafeDevice.isOnExternalStorage; - SafeDevice.isDevelopmentModeEnable.then((value) { - isDevelopmentModeEnable = value; - }); + // SafeDevice.isDevelopmentModeEnable.then((value) { + // isDevelopmentModeEnable = value; + // }); } } catch (error) { print(error); @@ -127,7 +127,7 @@ class _LoginScreenState extends State { } AppNotifications().init(firebaseToken, context); - if (isJailBroken || !isRealDevice || isDevelopmentModeEnable) { + if (isJailBroken || !isRealDevice) { Utils.hideLoading(context); Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false); } else { diff --git a/lib/ui/unsafe_device_screen.dart b/lib/ui/unsafe_device_screen.dart index c8e1243..dcfe820 100644 --- a/lib/ui/unsafe_device_screen.dart +++ b/lib/ui/unsafe_device_screen.dart @@ -37,10 +37,10 @@ class _UnsafeDeviceScreenState extends State { .paddingOnly(left: 20.0, right: 20.0), 48.height, passwordConstraintsUI("The device is not jailbroken or rooted.", true).paddingOnly(left: 24.0, right: 5.0), - 8.height, - passwordConstraintsUI("The app is not installed on external storage.", true).paddingOnly(left: 24.0, right: 5.0), - 8.height, - passwordConstraintsUI("Development mode is disabled.", true).paddingOnly(left: 24.0, right: 5.0), + // 8.height, + // passwordConstraintsUI("The app is not installed on external storage.", true).paddingOnly(left: 24.0, right: 5.0), + // 8.height, + // passwordConstraintsUI("Development mode is disabled.", true).paddingOnly(left: 24.0, right: 5.0), 21.height, DefaultButton(LocaleKeys.ok.tr(), () async { if (Platform.isAndroid) { From 92a16381aa38f854d699a3efe0c67ae8065aed50 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 6 Feb 2025 12:13:01 +0300 Subject: [PATCH 26/39] Update to stores VersionID 8.6 --- lib/classes/consts.dart | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index c2772b8..fea9b75 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // 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://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 diff --git a/pubspec.yaml b/pubspec.yaml index 9740e7d..e23c069 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.7.98+3 +version: 3.7.992+1 environment: sdk: ">=2.16.0 <3.0.0" From 5db63e571a5bb696e333d0761c05a681f64b0108 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Sun, 9 Feb 2025 15:13:53 +0300 Subject: [PATCH 27/39] WD: flutter upgraded to 3.27.4 --- assets/images/biometrics.svg | 33 ++++++++ lib/classes/notifications.dart | 2 +- lib/dialogs/otp_dialog.dart | 4 +- lib/theme/app_theme.dart | 75 +++++++++++++++---- .../attendance/monthly_attendance_screen.dart | 4 +- lib/ui/chat/chat_home_screen.dart | 2 + lib/ui/login/verify_last_login_screen.dart | 17 +++-- lib/ui/login/verify_login_screen.dart | 38 +++++++++- lib/ui/my_team/view_attendance.dart | 4 +- lib/ui/profile/delete_family_member.dart | 4 +- .../offers_and_discounts_details.dart | 2 +- lib/ui/work_list/item_history_screen.dart | 8 +- lib/widgets/app_bar_widget.dart | 2 + lib/widgets/image_picker.dart | 2 +- lib/widgets/nfc/nfc_reader_sheet.dart | 9 ++- pubspec.yaml | 22 +++--- 16 files changed, 175 insertions(+), 53 deletions(-) create mode 100644 assets/images/biometrics.svg diff --git a/assets/images/biometrics.svg b/assets/images/biometrics.svg new file mode 100644 index 0000000..5d61575 --- /dev/null +++ b/assets/images/biometrics.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/classes/notifications.dart b/lib/classes/notifications.dart index 8f432d7..00b732e 100644 --- a/lib/classes/notifications.dart +++ b/lib/classes/notifications.dart @@ -35,7 +35,7 @@ class AppNotifications { await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions(alert: true, badge: true, sound: true); } else if (Platform.isAndroid) { AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation(); - bool? granted = await androidImplementation?.requestPermission(); + bool? granted = await androidImplementation?.requestNotificationsPermission(); if (granted == false) { if (kDebugMode) { print("-------------------- Permission Granted ------------------------"); diff --git a/lib/dialogs/otp_dialog.dart b/lib/dialogs/otp_dialog.dart index 9f7c82e..7265d97 100644 --- a/lib/dialogs/otp_dialog.dart +++ b/lib/dialogs/otp_dialog.dart @@ -202,11 +202,11 @@ class OtpDialog { ), errorBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), focusedErrorBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), ); } diff --git a/lib/theme/app_theme.dart b/lib/theme/app_theme.dart index 586c3aa..b1a5570 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/theme/colors.dart'; @@ -15,36 +16,84 @@ class AppTheme { }, ), hintColor: Colors.grey[400], - colorScheme: ColorScheme.fromSwatch(accentColor: MyColors.backgroundColor), + colorScheme: ColorScheme.fromSwatch( + accentColor: MyColors.backgroundColor, + errorColor: const Color.fromRGBO(235, 80, 60, 1.0), + ), disabledColor: Colors.grey[300], - errorColor: const Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: MyColors.backgroundColor, textSelectionTheme: const TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), canvasColor: Colors.white, - backgroundColor: const Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: primaryColor, primaryColorDark: primaryColor, - buttonColor: Colors.black, - toggleableActiveColor: secondaryColor, + buttonTheme: ButtonThemeData( + buttonColor: Colors.black, + ), + switchTheme: SwitchThemeData( + thumbColor: MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.disabled)) { + return null; + } + if (states.contains(MaterialState.selected)) { + return secondaryColor; + } + return null; + }), + trackColor: MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.disabled)) { + return null; + } + if (states.contains(MaterialState.selected)) { + return secondaryColor; + } + return null; + }), + ), + radioTheme: RadioThemeData( + fillColor: MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.disabled)) { + return null; + } + if (states.contains(MaterialState.selected)) { + return secondaryColor; + } + return null; + }), + ), + checkboxTheme: CheckboxThemeData( + fillColor: MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.disabled)) { + return null; + } + if (states.contains(MaterialState.selected)) { + return secondaryColor; + } + return null; + }), + ), indicatorColor: secondaryColor, bottomSheetTheme: const BottomSheetThemeData( backgroundColor: Color(0xFFE0E0E0), ), - primaryTextTheme: const TextTheme( - bodyText2: TextStyle(color: Colors.white), - ), iconTheme: const IconThemeData(color: MyColors.darkIconColor), textTheme: const TextTheme( - bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6), - headline1: TextStyle(color: Colors.white, letterSpacing: 0.6), - headline2: TextStyle(color: Colors.white, letterSpacing: 0.6), + bodyMedium: TextStyle(color: Colors.black, letterSpacing: 0.6), + headlineSmall: TextStyle(color: Colors.white, letterSpacing: 0.6), + headlineMedium: TextStyle(color: Colors.white, letterSpacing: 0.6), ), floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2), - appBarTheme: AppBarTheme( + + appBarTheme: AppBarTheme( + systemOverlayStyle: const SystemUiOverlayStyle( + statusBarBrightness: Brightness.light, + ), color: const Color(0xff515A5D), - brightness: Brightness.light, elevation: 0.0, actionsIconTheme: IconThemeData( color: Colors.grey[800], diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 65f101b..cb1e784 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -16,7 +16,7 @@ import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model. import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; -import 'package:month_picker_dialog_2/month_picker_dialog_2.dart'; +import 'package:month_picker_dialog/month_picker_dialog.dart'; import 'package:pie_chart/pie_chart.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; @@ -117,8 +117,6 @@ class _MonthlyAttendanceScreenState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - confirmText: Text(LocaleKeys.confirm.tr()), - cancelText: Text(LocaleKeys.cancel.tr()), ).then((selectedDate) { if (selectedDate != null) { searchMonth = getMonth(selectedDate.month); diff --git a/lib/ui/chat/chat_home_screen.dart b/lib/ui/chat/chat_home_screen.dart index 04d7c2e..2f392f3 100644 --- a/lib/ui/chat/chat_home_screen.dart +++ b/lib/ui/chat/chat_home_screen.dart @@ -214,6 +214,8 @@ class _ChatHomeScreenState extends State { }, ), floatingActionButton: FloatingActionButton( + backgroundColor: Colors.transparent, + elevation: 0, child: Container( width: 60, height: 60, diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index 8604baf..9970206 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -4,8 +4,9 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; +import 'package:local_auth_android/local_auth_android.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; import 'package:mohem_flutter_app/api/login_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; @@ -69,7 +70,7 @@ class _VerifyLastLoginScreenState extends State { automaticallyImplyLeading: false, title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { - showMDialog(context, child: BusinessCardDialog()); + showMDialog(context, child: const BusinessCardDialog()); }) : Container(), actions: [ @@ -93,7 +94,7 @@ class _VerifyLastLoginScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.welcomeBack.tr().toText12(), - mobileLoginInfoListModel!.employeeName!.toText24(isBold: true), + mobileLoginInfoListModel?.employeeName?.toText24(isBold: true) ?? const SizedBox.shrink(), 10.height, LocaleKeys.wouldYouLikeToLoginWithCurrentUsername.tr().toText16(), Container( @@ -126,7 +127,7 @@ class _VerifyLastLoginScreenState extends State { children: [ LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color), getVerificationType(mobileLoginInfoListModel!.loginType!).toText12(), - Expanded(child: SizedBox()), + const Expanded(child: SizedBox()), DateUtil.formatDateToTime(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!)).toText12(), ], ) @@ -225,7 +226,10 @@ class _VerifyLastLoginScreenState extends State { 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', useErrorDialogs: true, stickyAuth: true, biometricOnly: true, iOSAuthStrings: iosStrings); + 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); @@ -235,7 +239,8 @@ 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))); + bool isDisable = (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) || + _flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.strong)); return InkWell( onTap: isDisable ? null diff --git a/lib/ui/login/verify_login_screen.dart b/lib/ui/login/verify_login_screen.dart index ac3c454..ea8439e 100644 --- a/lib/ui/login/verify_login_screen.dart +++ b/lib/ui/login/verify_login_screen.dart @@ -4,8 +4,9 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; +import 'package:local_auth_android/local_auth_android.dart'; import 'package:mohem_flutter_app/api/login_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; @@ -90,6 +91,7 @@ class _VerifyLoginScreenState extends State { Future _getAvailableBiometrics() async { try { _availableBioMetricType = await auth.getAvailableBiometrics(); + print("the available biometric are ${_availableBioMetricType.length}"); } on PlatformException catch (e) { // AppToast.showErrorToast(message: e.message); print(e); @@ -516,7 +518,14 @@ class _VerifyLoginScreenState extends State { 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', useErrorDialogs: true, stickyAuth: true, biometricOnly: true, iOSAuthStrings: iosStrings); + 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); @@ -526,7 +535,25 @@ class _VerifyLoginScreenState extends State { } Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { - bool isDisable = ((_flag == 3 && !checkBiometricIsAvailable(BiometricType.face)) || (_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint))); + bool isDisable = (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) || + _flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.strong)); + // bool isDisable = false; + // switch (_flag) { + // case 3: + // isDisable = !(checkBiometricIsAvailable(BiometricType.face) || + // checkBiometricIsAvailable(BiometricType.weak)); + // break; + // case 4: + // isDisable = !(checkBiometricIsAvailable(BiometricType.fingerprint) || + // checkBiometricIsAvailable(BiometricType.strong)); + // break; + // } + // // bool isDisable = ((_flag == 3 && + // // (!checkBiometricIsAvailable(BiometricType.face) || + // // !checkBiometricIsAvailable(BiometricType.weak))) || + // // (_flag == 4 && + // // (!checkBiometricIsAvailable(BiometricType.fingerprint) || + // // !checkBiometricIsAvailable(BiometricType.strong)))); return InkWell( onTap: isDisable ? null @@ -596,8 +623,13 @@ class _VerifyLoginScreenState extends State { bool checkBiometricIsAvailable(BiometricType biometricType) { bool isAvailable = false; + print("the given biometric is $biometricType"); + for (int i = 0; i < _availableBioMetricType.length; i++) { + print("the current biometric is ${_availableBioMetricType[i]}"); + if (biometricType == _availableBioMetricType[i]) { + print("the data is available $biometricType"); isAvailable = true; break; } diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index a45f35c..96e673d 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -15,7 +15,7 @@ import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; -import 'package:month_picker_dialog_2/month_picker_dialog_2.dart'; +import 'package:month_picker_dialog/month_picker_dialog.dart'; import 'package:pie_chart/pie_chart.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; @@ -169,8 +169,6 @@ class _ViewAttendanceState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - confirmText: Text(LocaleKeys.confirm.tr()), - cancelText: Text(LocaleKeys.cancel.tr()), ).then( (selectedDate) { if (selectedDate != null) { diff --git a/lib/ui/profile/delete_family_member.dart b/lib/ui/profile/delete_family_member.dart index 3b73512..f478b53 100644 --- a/lib/ui/profile/delete_family_member.dart +++ b/lib/ui/profile/delete_family_member.dart @@ -115,8 +115,8 @@ class _DeleteFamilyMemberState extends State { padding: EdgeInsets.only(left: 50, right: 50), child: TextButton( style: TextButton.styleFrom( - primary: MyColors.white, - onSurface: MyColors.white, + foregroundColor: MyColors.white, + surfaceTintColor: MyColors.white, backgroundColor: MyColors.gradiantEndColor, ), onPressed: () { diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index b4cb242..30a9fa2 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -76,7 +76,7 @@ class _OffersAndDiscountsDetailsState extends State { : getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center, Html( data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", - onLinkTap: (String? url, RenderContext context, Map attributes, _) { + onLinkTap: (String? url, Map attributes, _) { launchUrl(Uri.parse(url!)); }, ), diff --git a/lib/ui/work_list/item_history_screen.dart b/lib/ui/work_list/item_history_screen.dart index 71cea08..92516e8 100644 --- a/lib/ui/work_list/item_history_screen.dart +++ b/lib/ui/work_list/item_history_screen.dart @@ -188,7 +188,7 @@ class _ItemHistoryScreenState extends State { LineChartData drawLineChart(List spots, List reversedList) { return LineChartData( - lineTouchData: LineTouchData(enabled: true, touchTooltipData: LineTouchTooltipData(tooltipBgColor: Colors.grey[300])), + lineTouchData: LineTouchData(enabled: true, touchTooltipData: LineTouchTooltipData()), gridData: FlGridData( show: true, drawHorizontalLine: true, @@ -211,7 +211,7 @@ class _ItemHistoryScreenState extends State { interval: 1, getTitlesWidget: (double value, TitleMeta meta) { return SideTitleWidget( - axisSide: meta.axisSide, + meta: meta, child: Text(reversedList[int.parse(meta.formattedValue)].cREATIONDATE!, style: TextStyle(fontSize: 10)), ); })), @@ -222,7 +222,7 @@ class _ItemHistoryScreenState extends State { interval: 1, getTitlesWidget: (double value, TitleMeta meta) { return SideTitleWidget( - axisSide: meta.axisSide, + meta: meta, child: Text(meta.formattedValue, style: TextStyle(fontSize: 10)), ); })), @@ -233,7 +233,7 @@ class _ItemHistoryScreenState extends State { reservedSize: 15, getTitlesWidget: (double value, TitleMeta meta) { return SideTitleWidget( - axisSide: meta.axisSide, + meta: meta, child: Text("", style: TextStyle(fontSize: 10)), ); })), diff --git a/lib/widgets/app_bar_widget.dart b/lib/widgets/app_bar_widget.dart index 6f9898e..744b7eb 100644 --- a/lib/widgets/app_bar_widget.dart +++ b/lib/widgets/app_bar_widget.dart @@ -15,6 +15,8 @@ AppBar AppBarWidget(BuildContext context, void Function()? onBackTapped}) { return AppBar( leadingWidth: 0, + + automaticallyImplyLeading: false, title: Row( children: [ GestureDetector( diff --git a/lib/widgets/image_picker.dart b/lib/widgets/image_picker.dart index 943d68e..f808d6e 100644 --- a/lib/widgets/image_picker.dart +++ b/lib/widgets/image_picker.dart @@ -159,7 +159,7 @@ class _BottomSheet extends StatelessWidget { Widget build(BuildContext context) { return Container( padding: const EdgeInsets.symmetric(vertical: 12.0), - decoration: BoxDecoration(color: Theme.of(context).backgroundColor, borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), + decoration: BoxDecoration(color: Theme.of(context).scaffoldBackgroundColor, borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), child: SafeArea( top: false, child: Column( diff --git a/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart index b7b97a7..0ecc5e8 100644 --- a/lib/widgets/nfc/nfc_reader_sheet.dart +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -78,9 +78,11 @@ class _NfcLayoutState extends State { } Widget scanNfc() { - return Container( - key: ValueKey(1), + return SizedBox( + width: MediaQuery.sizeOf(context).width, child: Column( + key: ValueKey(1), + mainAxisSize: MainAxisSize.min, children: [ SizedBox( @@ -138,8 +140,9 @@ class _NfcLayoutState extends State { Widget doneNfc() { return Container( - key: ValueKey(2), + width: MediaQuery.sizeOf(context).width, child: Column( + key: ValueKey(2), mainAxisSize: MainAxisSize.min, children: [ SizedBox( diff --git a/pubspec.yaml b/pubspec.yaml index 9740e7d..08a6251 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.0.0" + sdk: ">=2.16.0 <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 @@ -40,13 +40,13 @@ dependencies: injector: ^2.0.0 provider: ^6.0.1 easy_localization: ^3.0.0 - http: ^0.13.4 + http: ^1.3.0 permission_handler: ^10.2.0 flutter_svg: any sizer: ^2.0.15 - local_auth: ^1.1.9 + local_auth: ^2.3.0 fluttertoast: ^8.0.8 - syncfusion_flutter_calendar: ^19.4.48 + syncfusion_flutter_calendar: ^28.2.4 # flutter_calendar_carousel: ^2.1.0 pie_chart: ^5.1.0 shared_preferences: ^2.0.12 @@ -60,12 +60,12 @@ dependencies: # android_id: ^0.1.3+1 platform_device_id: ^1.0.1 image_picker: ^0.8.5+3 - file_picker: 5.2.5 + file_picker: ^8.3.1 geolocator: ^9.0.2 - month_year_picker: ^0.2.0+1 - month_picker_dialog_2: ^0.5.5 + month_year_picker: ^0.4.0+1 + month_picker_dialog: ^6.0.3 # open_file: ^3.2.1 - open_filex: ^4.4.0 + open_filex: ^4.6.0 wifi_iot: ^0.3.19+1 flutter_html: ^3.0.0-alpha.6 # flutter_barcode_scanner: ^2.0.0 @@ -76,7 +76,7 @@ dependencies: flutter_rating_bar: ^4.0.1 auto_size_text: ^3.0.0 pull_to_refresh: ^2.0.0 - fl_chart: ^0.62.0 + fl_chart: ^0.70.2 # lottie json animations lottie: any # Marathon Card Swipe @@ -93,7 +93,7 @@ dependencies: swipe_to: ^1.0.2 flutter_webrtc: ^0.9.17 camera: ^0.10.3 - flutter_local_notifications: ^10.0.0 + flutter_local_notifications: ^18.0.1 #firebase_analytics: any #Chat Voice Message Recoding & Play @@ -116,7 +116,7 @@ dependencies: firebase_crashlytics: ^2.9.0 #Items for sale Image Carousel Slider - carousel_slider: ^4.2.1 + carousel_slider: ^5.0.0 #Huawei Specified # store_checker: ^1.1.0 From 7c3f6a508f7acc3619801db200a281bc68964154 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 25 Feb 2025 10:41:52 +0300 Subject: [PATCH 28/39] updates & fixes --- lib/classes/date_uitl.dart | 8 ++-- .../approval_level_fragment.dart | 39 ++++++++++++++++--- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/lib/classes/date_uitl.dart b/lib/classes/date_uitl.dart index 53b6525..8714b40 100644 --- a/lib/classes/date_uitl.dart +++ b/lib/classes/date_uitl.dart @@ -38,12 +38,12 @@ class DateUtil { return DateTime.now(); } - static DateTime convertSimpleStringDateToDate(String date) { + static DateTime convertSimpleStringDateToDate(String date, {bool isITG = false}) { // print(date.toUpperCase()); - return getDateTimeFromString(date.split(" ")[0], date.toUpperCase().split(" ")[1] + " " + date.toUpperCase().split(" ")[2]); + return getDateTimeFromString(date.split(" ")[0], date.toUpperCase().split(" ")[1] + " " + date.toUpperCase().split(" ")[2], isITG: isITG); } - static DateTime getDateTimeFromString(String date, String time) { + static DateTime getDateTimeFromString(String date, String time, {bool isITG = false}) { var hours = num.parse(time.split(":")[0]); var mins = time.split(":")[1]; var secs = time.split(":")[2].split(" ")[0]; @@ -60,7 +60,7 @@ class DateUtil { } } date = date + " $hours:$mins:$secs"; - DateTime returnDate = DateFormat("MM/dd/yyyy HH:mm:ss", "en_US").parse(date); + DateTime returnDate = isITG ? DateFormat("dd/MM/yyyy HH:mm:ss", "en_US").parse(date) : DateFormat("MM/dd/yyyy HH:mm:ss", "en_US").parse(date); return returnDate; } diff --git a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart index 09e44d4..e617511 100644 --- a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart +++ b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/date_uitl.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'; @@ -28,7 +29,7 @@ class ApprovalLevelfragment extends StatelessWidget { itemCount: wFHistory.length, padding: const EdgeInsets.all(21), itemBuilder: (context, index) { - return showItem(context, wFHistory[index]); + return showItem(context, wFHistory[index], index); }, separatorBuilder: (BuildContext context, int index) { return 12.height; @@ -37,7 +38,7 @@ class ApprovalLevelfragment extends StatelessWidget { ); } - Widget showItem(BuildContext context, WFHistory history) { + Widget showItem(BuildContext context, WFHistory history, int index) { return Container( width: double.infinity, decoration: BoxDecoration( @@ -89,7 +90,9 @@ class ApprovalLevelfragment extends StatelessWidget { 8.width, if (history.date!.isNotEmpty) history.date!.toText12(color: MyColors.lightTextColor), ], - ) + ), + 10.height, + getActionDuration(index).toText11(maxLine: 1, color: const Color(0xff1FA269)) ], ), ) @@ -143,8 +146,34 @@ class ApprovalLevelfragment extends StatelessWidget { ); } + String getActionDuration(int index) { + if (wFHistory[index].action!.toLowerCase() == "submit" || wFHistory[index].action!.toLowerCase() == "submitted") { + return ""; + // DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!); + // Duration duration = DateTime.now().difference(dateTimeFrom); + // return "Action duration: " + DateUtil.formatDuration(duration); + } + else if (wFHistory[index].employeeID == AppState().memberInformationList?.eMPLOYEENUMBER) { + // if (wFHistory[index + 1].date!.isEmpty) { + // return ""; + // } + DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!, isITG: true); + Duration duration = DateTime.now().difference(dateTimeFrom); + return "Action duration: " + DateUtil.formatDuration(duration); + } else { + if (wFHistory[index].date!.isEmpty || wFHistory[index].action!.toLowerCase() == "NO ACTION") { + return ""; + } else { + DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!); + DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!); + Duration duration = dateTimeTo.difference(dateTimeFrom); + return "Action duration: " + DateUtil.formatDuration(duration); + } + } + } + Color getStatusColor(String code) { - if (code.toLowerCase() == "submit") { + if (code.toLowerCase() == "submit" || code.toLowerCase() == "submitted") { return MyColors.grey3AColor; } else if (code.toLowerCase() == "pending") { return MyColors.yellowColor; @@ -152,7 +181,7 @@ class ApprovalLevelfragment extends StatelessWidget { return MyColors.redColor; } else if (code.toLowerCase() == "approved" || code.toLowerCase() == "auto-approve" || code.toLowerCase() == "auto-approved" || code.toLowerCase() == "doable" || code.toLowerCase() == "answer") { return MyColors.greenColor; - } else if (code.toLowerCase() == "requested information" || code.toLowerCase() == "assign" || code.toLowerCase() == "reassign") { + } else if (code.toLowerCase() == "requested information" || code.toLowerCase() == "request information" || code.toLowerCase() == "assign" || code.toLowerCase() == "reassign") { return MyColors.orange; } else { return MyColors.whiteColor; From be46dcb9b1c1a0f0753093d03de70d6507c0e755 Mon Sep 17 00:00:00 2001 From: sultan khan Date: Thu, 6 Mar 2025 16:15:49 +0300 Subject: [PATCH 29/39] employee search work in progress --- android/build.gradle | 3 +- android/gradle.properties | 1 + .../gradle/wrapper/gradle-wrapper.properties | 4 +- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Runner.xcodeproj/project.pbxproj | 3 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- ios/Runner/AppDelegate.swift | 2 +- .../get_eit_dff_structure_list_model.dart | 8 +- .../dynamic_screens/dynamic_input_screen.dart | 82 +++++++++++-------- pubspec.yaml | 2 +- 10 files changed, 63 insertions(+), 46 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index abef75b..2c90dbd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.8.20' + ext.kotlin_version = '1.9.10' repositories { google() mavenCentral() @@ -11,6 +11,7 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.8' classpath 'com.huawei.agconnect:agcp:1.8.0.300' + classpath "com.android.tools:r8:8.2.33" } } diff --git a/android/gradle.properties b/android/gradle.properties index 2260f45..56359bf 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,4 @@ org.gradle.jvmargs=-Xmx1836M android.useAndroidX=true android.enableJetifier=true +org.gradle.java.home=/Users/user/Library/Java/JavaVirtualMachines/jbr-17.0.12/Contents/Home/ \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 2f8758c..1e830b7 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Thu Mar 06 11:40:30 AST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip \ No newline at end of file diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 9625e10..7c56964 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 1eb87d0..32f5090 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -160,7 +160,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -232,6 +232,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..5e31d3d 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ json) { aLPHANUMERICALLOWEDFLAG = json['ALPHANUMERIC_ALLOWED_FLAG']; @@ -148,6 +150,7 @@ class GetEITDFFStructureList { uSEDFLAG = json['USED_FLAG']; vALIDATIONTYPE = json['VALIDATION_TYPE']; vALIDATIONTYPEDSP = json['VALIDATION_TYPE_DSP']; + vSSRCHFLAG = json['VS_SRCH_FLAG']; } Map toJson() { @@ -203,6 +206,7 @@ class GetEITDFFStructureList { data['USED_FLAG'] = this.uSEDFLAG; data['VALIDATION_TYPE'] = this.vALIDATIONTYPE; data['VALIDATION_TYPE_DSP'] = this.vALIDATIONTYPEDSP; + data['VS_SRCH_FLAG'] =this.vSSRCHFLAG; return data; } diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 73f05bc..f5cae16 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -684,42 +684,52 @@ class _DynamicInputScreenState extends State { ).paddingOnly(bottom: 12); } } else { - return PopupMenuButton( - child: DynamicTextFieldWidget( - (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), - model.eSERVICESDV?.pVALUECOLUMNNAME ?? "", - isEnable: false, - isPopup: true, - isInputTypeNum: true, - isReadOnly: model.rEADONLY == "Y", - ).paddingOnly(bottom: 12), - itemBuilder: (_) => >[ - if (model.rEADONLY != "Y") - for (int i = 0; i < model.eSERVICESVS!.length; i++) - PopupMenuItem( - value: i, - child: Column( - children: [ - Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), - const PopupMenuDivider(), - ], - )), - ], - onSelected: (int popipIndex) async { - ESERVICESDV eservicesdv = ESERVICESDV( - pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME, - pRETURNMSG: "null", - pRETURNSTATUS: "null", //getEitDffStructureList![popipIndex].dEFAULTVALUE, - pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME); - getEitDffStructureList![index].eSERVICESDV = eservicesdv; - setState(() {}); - if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { - await calGetValueSetValues(model); - } - if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) { - await getDefaultValues(model); - } - }); + //condition need to be added here. + if(model.vSSRCHFLAG =='Y'){ + + + }else { + return PopupMenuButton( + child: DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pVALUECOLUMNNAME ?? "", + isEnable: false, + isPopup: true, + isInputTypeNum: true, + isReadOnly: model.rEADONLY == "Y", + ).paddingOnly(bottom: 12), + itemBuilder: (_) => + >[ + if (model.rEADONLY != "Y") + for (int i = 0; i < model.eSERVICESVS!.length; i++) + PopupMenuItem( + value: i, + child: Column( + children: [ + Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), + const PopupMenuDivider(), + ], + )), + ], + onSelected: (int popipIndex) async { + ESERVICESDV eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME, + pRETURNMSG: "null", + pRETURNSTATUS: "null", + //getEitDffStructureList![popipIndex].dEFAULTVALUE, + pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex] + .vALUECOLUMNNAME); + getEitDffStructureList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + await calGetValueSetValues(model); + } + if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) { + await getDefaultValues(model); + } + }); + } } } else { return const SizedBox(); diff --git a/pubspec.yaml b/pubspec.yaml index 08a6251..13708ea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -91,7 +91,7 @@ dependencies: signalr_netcore: ^1.3.3 logging: ^1.0.1 swipe_to: ^1.0.2 - flutter_webrtc: ^0.9.17 + flutter_webrtc: ^0.12.11 camera: ^0.10.3 flutter_local_notifications: ^18.0.1 #firebase_analytics: any From c26b2d9a5f5fbe728c3b9c7878c9714a5b6e3ca8 Mon Sep 17 00:00:00 2001 From: sultan khan Date: Fri, 7 Mar 2025 18:30:19 +0300 Subject: [PATCH 30/39] search employee inprogress --- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- android/gradle.properties | 2 +- ios/Runner.xcodeproj/project.pbxproj | 21 ++++ lib/api/dashboard_api_client.dart | 1 + lib/api/my_attendance_api_client.dart | 26 ++++- .../get_set_values_request_model.dart | 8 +- .../get_eit_dff_structure_list_model.dart | 6 +- lib/provider/chat_provider_model.dart | 2 +- lib/ui/chat/common.dart | 4 +- .../dynamic_screens/dynamic_input_screen.dart | 109 +++++++++++++++++- lib/ui/termination/end_employement.dart | 42 ++++++- .../search_employee_bottom_sheet.dart | 23 +++- lib/widgets/location/Location.dart | 2 +- 14 files changed, 229 insertions(+), 21 deletions(-) diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 50ab38d..11decc3 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="hmg.cloudSolutions.mohem"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d018fec..8edb0f0 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="hmg.cloudSolutions.mohem"> diff --git a/android/gradle.properties b/android/gradle.properties index 56359bf..54e1a43 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx1836M +org.gradle.jvmargs=-Xmx2048M android.useAndroidX=true android.enableJetifier=true org.gradle.java.home=/Users/user/Library/Java/JavaVirtualMachines/jbr-17.0.12/Contents/Home/ \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 32f5090..97a5b37 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -144,6 +144,7 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, C4CFBC4C5CAC00182015ACD5 /* [CP] Embed Pods Frameworks */, + EF29CE25BB57F5AA48CE1136 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -273,6 +274,23 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + EF29CE25BB57F5AA48CE1136 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -363,6 +381,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; @@ -501,6 +520,7 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; @@ -531,6 +551,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; diff --git a/lib/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart index 89e7d48..ad6696a 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'; class DashboardApiClient { diff --git a/lib/api/my_attendance_api_client.dart b/lib/api/my_attendance_api_client.dart index 37bf9e8..3978c2d 100644 --- a/lib/api/my_attendance_api_client.dart +++ b/lib/api/my_attendance_api_client.dart @@ -91,7 +91,31 @@ class MyAttendanceApiClient { return responseData.getValueSetValuesList ?? []; }, url, postParams); } - + Future> getValueSetValuesSearch(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list, + {String? empID, String? parentValue, bool hasParent = false}) async { + String url = "${ApiConsts.erpRest}GET_VALUE_SET_VALUES_SRCH"; + Map postParams = { + "P_SELECTED_RESP_ID": -999, + "P_MENU_TYPE": "E", + "P_PAGE_LIMIT": 1000, + "P_PAGE_NUM": 1, + "P_PARENT_VALUE": hasParent + ? parentValue + : empID != null + ? parentValue + : null, + "P_SEGMENT_NAME": pSegmentName, + "P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode, + "P_DESC_FLEX_NAME": pDescFlexName, + "GetValueSetValuesTBL": list, + }; + 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.getValueSetValuesList ?? []; + }, url, postParams); + } Future getDefaultValue(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list, {String? empID}) async { String url = "${ApiConsts.erpRest}GET_DEFAULT_VALUE"; Map postParams = { diff --git a/lib/models/dyanmic_forms/get_set_values_request_model.dart b/lib/models/dyanmic_forms/get_set_values_request_model.dart index 07c840a..9f1c52c 100644 --- a/lib/models/dyanmic_forms/get_set_values_request_model.dart +++ b/lib/models/dyanmic_forms/get_set_values_request_model.dart @@ -4,13 +4,15 @@ class GetSetValuesRequestModel { String? dESCRIPTION; String? iDCOLUMNNAME; String? fLEXVALUESETNAME; - + String? pSRCHVALUECOLUMNNAME; GetSetValuesRequestModel( {this.sEGMENTNAME, this.vALUECOLUMNNAME, this.dESCRIPTION, this.iDCOLUMNNAME, - this.fLEXVALUESETNAME}); + this.fLEXVALUESETNAME, + this.pSRCHVALUECOLUMNNAME, + }); GetSetValuesRequestModel.fromJson(Map json) { sEGMENTNAME = json['SEGMENT_NAME']; @@ -18,6 +20,7 @@ class GetSetValuesRequestModel { dESCRIPTION = json['DESCRIPTION']; iDCOLUMNNAME = json['ID_COLUMN_NAME']; fLEXVALUESETNAME = json['FLEX_VALUE_SET_NAME']; + pSRCHVALUECOLUMNNAME = json['P_SRCH_VALUE_COLUMN_NAME']; } Map toJson() { @@ -27,6 +30,7 @@ class GetSetValuesRequestModel { data['DESCRIPTION'] = this.dESCRIPTION; data['ID_COLUMN_NAME'] = this.iDCOLUMNNAME; data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME; + data['P_SRCH_VALUE_COLUMN_NAME'] =this.pSRCHVALUECOLUMNNAME; return data; } } diff --git a/lib/models/get_eit_dff_structure_list_model.dart b/lib/models/get_eit_dff_structure_list_model.dart index 05a1535..59736d3 100644 --- a/lib/models/get_eit_dff_structure_list_model.dart +++ b/lib/models/get_eit_dff_structure_list_model.dart @@ -218,14 +218,15 @@ class ESERVICESDV { dynamic pRETURNMSG; String? pRETURNSTATUS; dynamic pVALUECOLUMNNAME; - - ESERVICESDV({this.pIDCOLUMNNAME, this.pRETURNMSG, this.pRETURNSTATUS, this.pVALUECOLUMNNAME}); + dynamic pSRCHVALUECOLUMNNAME; + ESERVICESDV({this.pIDCOLUMNNAME, this.pRETURNMSG, this.pRETURNSTATUS, this.pVALUECOLUMNNAME, this.pSRCHVALUECOLUMNNAME}); ESERVICESDV.fromJson(Map json) { pIDCOLUMNNAME = json['P_ID_COLUMN_NAME']; pRETURNMSG = json['P_RETURN_MSG']; pRETURNSTATUS = json['P_RETURN_STATUS']; pVALUECOLUMNNAME = json['P_VALUE_COLUMN_NAME']; + pSRCHVALUECOLUMNNAME = json['P_SRCH_VALUE_COLUMN_NAME']; } Map toJson() { @@ -234,6 +235,7 @@ class ESERVICESDV { data['P_RETURN_MSG'] = pRETURNMSG; data['P_RETURN_STATUS'] = pRETURNSTATUS; data['P_VALUE_COLUMN_NAME'] = pVALUECOLUMNNAME; + data['P_SRCH_VALUE_COLUMN_NAME'] =pSRCHVALUECOLUMNNAME; return data; } } diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 380278d..474fb51 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -1685,7 +1685,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { File file = File(path!); file.readAsBytesSync(); path = file.path; - await playerController.preparePlayer(file.path, 1.0); + await playerController.preparePlayer(file.path, 1.0); _timer?.cancel(); notifyListeners(); } diff --git a/lib/ui/chat/common.dart b/lib/ui/chat/common.dart index e0cb4d0..daaeca9 100644 --- a/lib/ui/chat/common.dart +++ b/lib/ui/chat/common.dart @@ -170,7 +170,7 @@ class WaveBubble extends StatelessWidget { padding: EdgeInsets.zero, margin: EdgeInsets.zero, enableSeekGesture: true, - density: 1, + // density: 1, playerWaveStyle: const PlayerWaveStyle( fixedWaveColor: Colors.white, liveWaveColor: MyColors.greenColor, @@ -178,7 +178,7 @@ class WaveBubble extends StatelessWidget { showBottom: true, waveCap: StrokeCap.round, seekLineThickness: 2, - visualizerHeight: 4, + // visualizerHeight: 4, backgroundColor: Colors.transparent, ), ), diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index f5cae16..00453b2 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -21,6 +21,8 @@ import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart' import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; +import 'package:mohem_flutter_app/widgets/bottom_sheets/search_employee_bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; @@ -37,7 +39,7 @@ class _DynamicInputScreenState extends State { GenericResponseModel? genericResponseModel; List? getEitDffStructureList; DynamicListViewParams? dynamicParams; - + String? selectedReplacementEmployee; @override void initState() { super.initState(); @@ -686,7 +688,51 @@ class _DynamicInputScreenState extends State { } else { //condition need to be added here. if(model.vSSRCHFLAG =='Y'){ + return DynamicTextFieldWidget( + LocaleKeys.selectEmployee.tr(), + "", + // selectedReplacementEmployee == null ? LocaleKeys.searchForEmployee + // .tr() : selectedReplacementEmployee!.employeeDisplayName ?? "", + isEnable: false, + onTap: () { + showMyBottomSheet( + context, + + callBackFunc: () {}, + child: SearchEmployeeBottomSheet( + title: LocaleKeys.searchForEmployee.tr(), + apiMode: LocaleKeys.delegate.tr(), + fromDynamicScreen: true, + fromChat: false, + onSelectEmployee: (_selectedEmployee) { + // Navigator.pop(context); + // selectedReplacementEmployee = _selectedEmployee; + ESERVICESDV eservicesdv = ESERVICESDV( + pIDCOLUMNNAME:_selectedEmployee.userName, + pRETURNMSG: "null", + pRETURNSTATUS: "null", //getEitDffStructureList![popipIndex].dEFAULTVALUE, + pVALUECOLUMNNAME:_selectedEmployee.employeeDisplayName); + getEitDffStructureList![index].eSERVICESDV = eservicesdv; + + setState(() {}); + }, + onSearchClick: (String empID) async{ + ESERVICESDV eservicesdv = + ESERVICESDV(pSRCHVALUECOLUMNNAME: empID, pRETURNMSG: "null", pRETURNSTATUS: "null", pVALUECOLUMNNAME: ""); + getEitDffStructureList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + await calGetValueSetValuesSearch(model, empID); + } + if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) { + await getDefaultValues(model); + } + }, + ), + ); + }, + ); }else { return PopupMenuButton( @@ -924,4 +970,65 @@ class _DynamicInputScreenState extends State { } return time; } + Future calGetValueSetValuesSearch(GetEITDFFStructureList structureList,String userID, {bool showLoading = true}) async { + try { + if (showLoading) Utils.showLoading(context); + for (int i = 0; i < (structureList.cHILDSEGMENTSVSSplited?.length ?? 0); i++) { + List> values = []; + String segmentId = structureList.cHILDSEGMENTSVSSplited![i]; + + if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!; + List filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVSSplited!.contains(segmentId)).toList() ?? []; + + if (filteredList.isEmpty && structureList.cHILDSEGMENTSVSSplited!.isNotEmpty) { + segmentId = structureList.cHILDSEGMENTSVSSplited![0]; + filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVSSplited!.contains(segmentId)).toList() ?? []; + } + values = filteredList + .map((e) => GetSetValuesRequestModel( + sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME, pSRCHVALUECOLUMNNAME: userID ) + .toJson()) + .toList(); + + String? selectedEmp = dynamicParams!.selectedEmp; + bool hasParentId = false; + + if (segmentId.isNotEmpty && selectedEmp == null) { + for (var element in getEitDffStructureList!) { + try { + if (element.sEGMENTNAME == segmentId && selectedEmp == null) { + var selectedElement = element; + if (selectedElement.vALIDATIONTYPE == "Y" || selectedElement.vALIDATIONTYPE == "D") { + hasParentId = true; + break; + } + } + } catch (ex) { + print("err:$ex"); + } + } + } + + List eServicesResponseModel = await MyAttendanceApiClient().getValueSetValuesSearch(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values, + empID: selectedEmp, parentValue: structureList.eSERVICESDV!.pVALUECOLUMNNAME, hasParent: hasParentId); + List abc = genericResponseModel?.getEITDFFStructureList ?? []; + getEitDffStructureList = abc; + int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId); + getEitDffStructureList![index].eSERVICESVS!.clear(); + getEitDffStructureList![index].eSERVICESDV = ESERVICESDV(); + if (eServicesResponseModel.isNotEmpty) getEitDffStructureList![index].eSERVICESVS!.addAll(eServicesResponseModel); + // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); + } + if (showLoading) { + await Future.delayed(const Duration(seconds: 1)); + Utils.hideLoading(context); + } + + setState(() {}); + } catch (ex) { + if (showLoading) Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } } diff --git a/lib/ui/termination/end_employement.dart b/lib/ui/termination/end_employement.dart index 8837806..18ae916 100644 --- a/lib/ui/termination/end_employement.dart +++ b/lib/ui/termination/end_employement.dart @@ -18,9 +18,12 @@ import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart' import 'package:mohem_flutter_app/models/submit_term_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/termination/get_term_cols_structure_list_model.dart'; import 'package:mohem_flutter_app/models/termination/get_term_dff_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart'; import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; +import 'package:mohem_flutter_app/widgets/bottom_sheets/search_employee_bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; @@ -37,7 +40,7 @@ class _EndEmploymentScreenState extends State { List? termColsList; List? termDffList; DynamicListViewParams? dynamicParams; - + ReplacementList? selectedReplacementEmployee; @override void initState() { super.initState(); @@ -413,9 +416,40 @@ class _EndEmploymentScreenState extends State { await calGetValueSetValues(model); } }, - ).paddingOnly(bottom: 12); + ); } } else { + if(model.sEGMENTNAME =='REPLACEMENT_PERSON') { + return DynamicTextFieldWidget( + LocaleKeys.selectEmployee.tr(), + selectedReplacementEmployee == null ? LocaleKeys.searchForEmployee + .tr() : selectedReplacementEmployee!.employeeDisplayName ?? "", + isEnable: false, + onTap: () { + showMyBottomSheet( + context, + callBackFunc: () {}, + child: SearchEmployeeBottomSheet( + title: LocaleKeys.searchForEmployee.tr(), + apiMode: LocaleKeys.delegate.tr(), + fromChat: false, + onSelectEmployee: (_selectedEmployee) { + // Navigator.pop(context); + selectedReplacementEmployee = _selectedEmployee; + ESERVICESDV eservicesdv = ESERVICESDV( + pIDCOLUMNNAME:_selectedEmployee.userName, + pRETURNMSG: "null", + pRETURNSTATUS: "null", //getEitDffStructureList![popipIndex].dEFAULTVALUE, + pVALUECOLUMNNAME:_selectedEmployee.employeeDisplayName); + termDffList![index].eSERVICESDV = eservicesdv; + + setState(() {}); + }, + ), + ); + }, + ); + }else{ return PopupMenuButton( child: DynamicTextFieldWidget( (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), @@ -436,11 +470,13 @@ class _EndEmploymentScreenState extends State { pRETURNSTATUS: "null", //getEitDffStructureList![popipIndex].dEFAULTVALUE, pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME); termDffList![index].eSERVICESDV = eservicesdv; + print(eservicesdv); setState(() {}); if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { await calGetValueSetValues(model); } }); + } } } else { return const SizedBox(); @@ -455,7 +491,7 @@ class _EndEmploymentScreenState extends State { isPopup: true, isInputTypeNum: true, isReadOnly: model.rEADONLY == "Y", - ).paddingOnly(bottom: 12), + ), itemBuilder: (_) => >[ if (model.rEADONLY != "Y") for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem(value: i, child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!)), diff --git a/lib/widgets/bottom_sheets/search_employee_bottom_sheet.dart b/lib/widgets/bottom_sheets/search_employee_bottom_sheet.dart index d810457..f2f362a 100644 --- a/lib/widgets/bottom_sheets/search_employee_bottom_sheet.dart +++ b/lib/widgets/bottom_sheets/search_employee_bottom_sheet.dart @@ -30,8 +30,9 @@ class SearchEmployeeBottomSheet extends StatefulWidget { String title, apiMode; List? actionHistoryList; Function(ReplacementList) onSelectEmployee; + Function(String)? onSearchClick; bool fromChat; - + bool? fromDynamicScreen; SearchEmployeeBottomSheet({ required this.title, required this.apiMode, @@ -39,6 +40,8 @@ class SearchEmployeeBottomSheet extends StatefulWidget { this.actionHistoryList, required this.onSelectEmployee, required this.fromChat, + this.fromDynamicScreen =false, + this.onSearchClick, }); @override @@ -152,7 +155,12 @@ class _SearchEmployeeBottomSheetState extends State { 21.height, "Search".toText16(), 11.height, - Row( + widget.fromDynamicScreen! ? Row( + children: [ + radioOption( "UserId" , 0, _selectedSearchIndex), + + ], + ) : Row( children: [ radioOption(widget.fromChat ? "UserId" : "Name", 0, _selectedSearchIndex), radioOption("User Name", 1, _selectedSearchIndex), @@ -164,7 +172,7 @@ class _SearchEmployeeBottomSheetState extends State { children: [ DynamicTextFieldWidget( "Search", - "Search By Username", + widget.fromDynamicScreen! ? "Search By UserID" : "Search By Username", inputAction: TextInputAction.done, suffixIconData: Icons.search, onChange: (text) { @@ -175,8 +183,13 @@ class _SearchEmployeeBottomSheetState extends State { IconButton( constraints: const BoxConstraints(), onPressed: () async { - await SystemChannels.textInput.invokeMethod('TextInput.hide'); - widget.fromChat ? fetchChatUser() : fetchUserByInput(); + if(widget.onSearchClick !=null){ + widget.onSearchClick!(searchText); + }else { + await SystemChannels.textInput.invokeMethod( + 'TextInput.hide'); + widget.fromChat ? fetchChatUser() : fetchUserByInput(); + } }, icon: const Icon(Icons.search), ) diff --git a/lib/widgets/location/Location.dart b/lib/widgets/location/Location.dart index 47babca..23ad0cc 100644 --- a/lib/widgets/location/Location.dart +++ b/lib/widgets/location/Location.dart @@ -44,7 +44,7 @@ class Location { AppPermissions.location((granted) { if (granted) { - Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: const Duration(seconds: 5)).then((value) { + Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.lowest, timeLimit: const Duration(seconds: 10)).then((value) { done(value); }).catchError((err) { errorCallBack(); From 54aa6108566415f06284545d761d037ef24b9580 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 17 Mar 2025 15:46:17 +0300 Subject: [PATCH 31/39] long text field changed to separate field. --- .../request_detail_fragment.dart | 42 ++++++++++++------- lib/widgets/item_detail_view_widget.dart | 5 ++- 2 files changed, 29 insertions(+), 18 deletions(-) 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..d4d7e07 100644 --- a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart +++ b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart @@ -40,6 +40,7 @@ class RequestDetailFragment extends StatelessWidget { ? LocaleKeys.noDataAvailable.tr().toText16().center : ListView( shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), children: uiList, ), ), @@ -73,26 +74,29 @@ class RequestDetailFragment extends StatelessWidget { List fields = List.from(fieldsF); bool isOdd = false; + + List longValueFields = []; + + longValueFields = fields + .where((Fields element) => (element.value?.length ?? 0) > 120) + .toList() + .map((Fields descriptionFormat) => ItemDetailViewGridItem( + 2, + descriptionFormat.title, + descriptionFormat.value == null ? (descriptionFormat.multipleValue?.join(", ") ?? "") : descriptionFormat.value ?? "", + type: descriptionFormat.type, + showSpaceAfterLine: true, + maxLine: 0, + )) + .toList(); + + fields.removeWhere((element) => (element.value?.length ?? 0) > 120); + 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: [ @@ -131,7 +135,13 @@ class RequestDetailFragment extends StatelessWidget { childAspectRatio: (itemWidth / itemHeight), ), ), - if (descriptionFormatView != null) descriptionFormatView, + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + padding: EdgeInsets.zero, + itemBuilder: (cxt, index) => longValueFields[index], + separatorBuilder: (cxt, index) => 16.height, + itemCount: longValueFields.length), ], ).objectContainerView(); return ListView.separated( diff --git a/lib/widgets/item_detail_view_widget.dart b/lib/widgets/item_detail_view_widget.dart index a98b066..64bbd01 100644 --- a/lib/widgets/item_detail_view_widget.dart +++ b/lib/widgets/item_detail_view_widget.dart @@ -53,8 +53,9 @@ class ItemDetailViewGridItem extends StatelessWidget { final String? type; final bool isNeedToShowEmptyDivider; final int maxLine; + final bool showSpaceAfterLine; - ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.type = "", this.maxLine = 6}) : super(key: key); + ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.showSpaceAfterLine = false, this.type = "", this.maxLine = 6}) : super(key: key); @override Widget build(BuildContext context) { @@ -92,7 +93,7 @@ class ItemDetailViewGridItem extends StatelessWidget { : (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: maxLine) : Container(), ], - ), + ).paddingOnly(top: showSpaceAfterLine ? 16 : 0), ); } } From 72c178382f62ea85029d5bedf3db88c8cc16752d Mon Sep 17 00:00:00 2001 From: Aamir Muhammad Date: Thu, 1 May 2025 21:22:52 +0300 Subject: [PATCH 32/39] 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/ From 49e520ea4b3c630f793378b7e21ae0a6be0c0574 Mon Sep 17 00:00:00 2001 From: Haroon Amjad <> Date: Thu, 1 May 2025 21:41:53 +0300 Subject: [PATCH 33/39] update --- .../offers_and_discounts/offers_and_discounts_details.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index b4cb242..30a9fa2 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -76,7 +76,7 @@ class _OffersAndDiscountsDetailsState extends State { : getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center, Html( data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", - onLinkTap: (String? url, RenderContext context, Map attributes, _) { + onLinkTap: (String? url, Map attributes, _) { launchUrl(Uri.parse(url!)); }, ), From e91b33805e06dbdb2cf5199afdb0760a4042b414 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 5 May 2025 12:00:08 +0300 Subject: [PATCH 34/39] fixes & updates, Time sheet changes, Update to stores VersionID 8.7 --- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 4 ++-- ios/Runner/Info.plist | 2 +- lib/app_state/app_state.dart | 2 +- lib/provider/dashboard_provider_model.dart | 2 +- lib/ui/landing/dashboard_screen.dart | 2 +- .../offers_and_discounts_details.dart | 2 +- lib/ui/work_list/itg_detail_screen.dart | 6 +++++- lib/widgets/location/Location.dart | 2 +- pubspec.yaml | 14 +++++++------- 10 files changed, 21 insertions(+), 17 deletions(-) diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 11decc3..50ab38d 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.mohem_flutter_app"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8edb0f0..d6d528d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + package="com.mohem_flutter_app"> - + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index cb62b88..01197de 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - MOHEMM + MoheM CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 7269cd5..a2959ec 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.6, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.7, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 36a9f81..e644aa0 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -279,7 +279,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { logger.wtf(ex); isEventLoadingLoading = false; notifyListeners(); - Utils.handleException(ex, null, null); + // Utils.handleException(ex, null, null); } } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 4640c25..9a7c1ee 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -712,7 +712,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb Widget eventActivityWidget(BuildContext context) { return (context.watch().isEventLoadingLoading) ? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) - : (context.watch().eventActivity != null && context.watch().eventActivity!.isActive ==true) + : (context.watch().eventActivity != null && context.watch().eventActivity!.isActive == true) ? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) : const SizedBox(); } diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index 30a9fa2..37680f0 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -76,7 +76,7 @@ class _OffersAndDiscountsDetailsState extends State { : getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center, Html( data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", - onLinkTap: (String? url, Map attributes, _) { + onLinkTap: (String? url, context, Map attributes, _) { launchUrl(Uri.parse(url!)); }, ), diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index dec413f..930cfe6 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -105,7 +105,11 @@ class _ItgDetailScreenState extends State { } catch (ex) { setState(() {}); Utils.hideLoading(context); - Utils.handleException(ex, context, null); + // 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.handleException(ex, context, null); } } diff --git a/lib/widgets/location/Location.dart b/lib/widgets/location/Location.dart index 23ad0cc..fe4e976 100644 --- a/lib/widgets/location/Location.dart +++ b/lib/widgets/location/Location.dart @@ -44,7 +44,7 @@ class Location { AppPermissions.location((granted) { if (granted) { - Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.lowest, timeLimit: const Duration(seconds: 10)).then((value) { + Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: const Duration(seconds: 10)).then((value) { done(value); }).catchError((err) { errorCallBack(); diff --git a/pubspec.yaml b/pubspec.yaml index ecaa799..4b1df68 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.7.992+1 +version: 3.5.9+300069 environment: sdk: ">=2.16.0 <3.0.0" @@ -61,11 +61,11 @@ dependencies: platform_device_id: ^1.0.1 image_picker: ^0.8.5+3 file_picker: 5.2.5 - geolocator: ^9.0.2 + geolocator: ^11.1.0 month_year_picker: ^0.2.0+1 month_picker_dialog_2: ^0.5.5 -# open_file: ^3.2.1 - open_filex: ^4.6.0 + # open_file: ^3.2.1 + open_filex: ^4.4.0 wifi_iot: ^0.3.19+1 flutter_html: ^3.0.0-alpha.6 # flutter_barcode_scanner: ^2.0.0 @@ -110,13 +110,13 @@ dependencies: #Huawei Dependencies # huawei_hmsavailability: ^6.6.0+300 -# huawei_location: 6.0.0+302 + # huawei_location: 6.0.0+302 huawei_location: ^6.11.0+301 huawei_push: ^6.7.0+300 firebase_crashlytics: ^2.9.0 #Items for sale Image Carousel Slider - carousel_slider: ^5.0.0 + carousel_slider: ^4.2.1 #Huawei Specified # store_checker: ^1.1.0 @@ -228,4 +228,4 @@ flutter: # see https://flutter.dev/custom-fonts/#from-packages -# Adding this to test the push from iMac +# Adding this to test the push from iMac \ No newline at end of file From 0e7bac455750976c1c810faf7f22480ea45d0e07 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 8 May 2025 12:08:32 +0300 Subject: [PATCH 35/39] ITG Timesheet & Approval level fixes --- lib/ui/work_list/itg_detail_screen.dart | 5 ++++- .../itg_fragments/approval_level_fragment.dart | 18 +++++++++--------- .../itg_fragments/request_detail_fragment.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index 930cfe6..bbe4c3e 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -88,8 +88,9 @@ class _ItgDetailScreenState extends State { 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 ?? ""); + dynamic data = await WorkListApiClient().getITGTimeCardDetails("Timesheet Request", formattedString, itgRequest!.fieldGoups![0].fields![1].value ?? ""); if (data != null) { var decodedDta = jsonDecode(data); // var decodedDta = jsonDecode( @@ -97,6 +98,8 @@ class _ItgDetailScreenState extends State { // ); timeCardSummaryData = ItgTimeCardSummaryData.fromJson(decodedDta); } + } else { + timeCardSummaryData = ItgTimeCardSummaryData(); } Utils.hideLoading(context); setState(() { diff --git a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart index e617511..d7d9c7e 100644 --- a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart +++ b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart @@ -152,16 +152,16 @@ class ApprovalLevelfragment extends StatelessWidget { // DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!); // Duration duration = DateTime.now().difference(dateTimeFrom); // return "Action duration: " + DateUtil.formatDuration(duration); - } - else if (wFHistory[index].employeeID == AppState().memberInformationList?.eMPLOYEENUMBER) { - // if (wFHistory[index + 1].date!.isEmpty) { - // return ""; - // } - DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!, isITG: true); - Duration duration = DateTime.now().difference(dateTimeFrom); - return "Action duration: " + DateUtil.formatDuration(duration); + } else if (wFHistory[index].employeeID == AppState().memberInformationList?.eMPLOYEENUMBER) { + if (wFHistory[index + 1].date!.isEmpty || wFHistory[index + 1].date! == "") { + return ""; + } else { + DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!, isITG: true); + Duration duration = DateTime.now().difference(dateTimeFrom); + return "Action duration: " + DateUtil.formatDuration(duration); + } } else { - if (wFHistory[index].date!.isEmpty || wFHistory[index].action!.toLowerCase() == "NO ACTION") { + if (wFHistory[index].date!.isEmpty || wFHistory[index].action!.toLowerCase() == "NO ACTION" || wFHistory[index + 1].date! == "") { return ""; } else { DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!); 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 f16d69c..6cd3ea5 100644 --- a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart +++ b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart @@ -1 +1 @@ -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 +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, mainAxisAlignment: MainAxisAlignment.spaceBetween, 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)]), Expanded(child: SizedBox(),), ] 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)]), Expanded(child: SizedBox(),), 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/pubspec.yaml b/pubspec.yaml index 4b1df68..511ce1a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.5.9+300069 +version: 3.6.1+300071 environment: sdk: ">=2.16.0 <3.0.0" From 9b683235c9065ab203b56de666af10e1078a4c4b Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 11 May 2025 12:36:42 +0300 Subject: [PATCH 36/39] request information added, --- lib/api/api_client.dart | 1 + lib/ui/work_list/worklist_detail_screen.dart | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index e3cbee1..446905f 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -86,6 +86,7 @@ class ApiClient { var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes, isFormData: isFormData); try { if (!kReleaseMode) { + logger.i("Url: " + url); logger.i("res: " + response.body); } diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 69c669f..35c0078 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -144,7 +144,7 @@ class _WorkListDetailScreenState extends State { getEitNotificationBody(); } else if (workListData!.rEQUESTTYPE == "CEI") { getCEINotificationBody(); - }else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") { + } else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") { getPhonesNotificationBody(); } else if (workListData!.rEQUESTTYPE == "BASIC_DETAILS") { getBasicDetNtfBody(); @@ -679,10 +679,12 @@ class _WorkListDetailScreenState extends State { } void performAction(String actionMode, {String? title}) { + GetActionHistoryList? object = actionHistoryList.firstWhere((element) => element.aCTIONCODE == "REQUEST_INFO"); + String question = "${object.aCTION}: ${object.nOTE}"; showDialog( context: context, builder: (BuildContext cxt) => AcceptRejectInputDialog( - message: title != null ? null : LocaleKeys.requestedItems.tr(), + message: question, title: title, notificationGetRespond: notificationNoteInput, actionMode: actionMode, @@ -1102,7 +1104,7 @@ class _WorkListDetailScreenState extends State { try { isAttachmentLoaded = false; getAttachmentList.clear(); - List _getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); + List _getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); if (!isAttachmentLoaded) { getAttachmentList = _getAttachmentList; } From 4e2a774086204497429332f88598174bba7fe13b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 12 May 2025 12:14:44 +0300 Subject: [PATCH 37/39] App update to stores, Version ID 8.8 --- lib/app_state/app_state.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index a2959ec..459a8e9 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.7, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.8, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { From d4b7550bab843b633ccd930e51d0f6fa1cd12eea Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 May 2025 15:51:35 +0300 Subject: [PATCH 38/39] Worklist actions buttons updates --- lib/api/api_client.dart | 6 ++ lib/ui/work_list/worklist_detail_screen.dart | 97 +++++++++++--------- 2 files changed, 58 insertions(+), 45 deletions(-) diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index 446905f..fb415d4 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -94,6 +94,12 @@ class ApiClient { if (jsonData["IsAuthenticated"] != null) { AppState().setIsAuthenticated = jsonData["IsAuthenticated"]; } + + // if(url.contains("GetOfferDiscountsConfigData")) { + // jsonData["ErrorMessage"] = "Service Not Available"; + // jsonData["ErrorEndUserMessage"] = "Service Not Available"; + // } + if (jsonData["ErrorMessage"] == null) { return factoryConstructor(jsonData); } else { diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 35c0078..45ecd4d 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -297,50 +297,52 @@ class _WorkListDetailScreenState extends State { ], ).expanded, 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), + SafeArea( + child: 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), + ), + ), + child: Row( + children: [ + if (isRejectAvailable) + DefaultButton( + LocaleKeys.reject.tr(), + () => performAction(rejectAction), + colors: const [Color(0xffE47A7E), Color(0xffDE6D71)], + ).expanded, + if (isApproveAvailable && isRejectAvailable) 8.width, + if (isApproveAvailable) + DefaultButton( + LocaleKeys.approve.tr(), + () => performAction(approveAction), + 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, + ), + child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), + ).onPress(() { + setState(() { + showFabOptions = true; + }); + }) + ], ), - ), - child: Row( - children: [ - if (isRejectAvailable) - DefaultButton( - LocaleKeys.reject.tr(), - () => performAction(rejectAction), - colors: const [Color(0xffE47A7E), Color(0xffDE6D71)], - ).expanded, - if (isApproveAvailable && isRejectAvailable) 8.width, - if (isApproveAvailable) - DefaultButton( - LocaleKeys.approve.tr(), - () => performAction(approveAction), - 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, - ), - child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), - ).onPress(() { - setState(() { - showFabOptions = true; - }); - }) - ], ), ) ], @@ -679,8 +681,13 @@ class _WorkListDetailScreenState extends State { } void performAction(String actionMode, {String? title}) { - GetActionHistoryList? object = actionHistoryList.firstWhere((element) => element.aCTIONCODE == "REQUEST_INFO"); - String question = "${object.aCTION}: ${object.nOTE}"; + String question = ""; + if (actionMode == "ANSWER_INFO") { + List list = actionHistoryList.where((element) => element.aCTIONCODE == "REQUEST_INFO").toList(); + if (list.isNotEmpty) { + question = "${list.first.aCTION}: ${list.first.nOTE}"; + } + } showDialog( context: context, builder: (BuildContext cxt) => AcceptRejectInputDialog( From aaa4f134934821df865fb0ba82fbfe3fbd465ffc Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 May 2025 16:03:23 +0300 Subject: [PATCH 39/39] App update to stores, Version ID 8.9 --- lib/app_state/app_state.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 459a8e9..f8ee060 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.8, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.9, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { diff --git a/pubspec.yaml b/pubspec.yaml index 511ce1a..f4f08b1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.6.1+300071 +version: 3.6.3+300073 environment: sdk: ">=2.16.0 <3.0.0"