diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d018fec..d6d528d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ xmlns:tools="http://schemas.android.com/tools" package="com.mohem_flutter_app"> - + diff --git a/android/build.gradle b/android/build.gradle index 23ea6ba..2c90dbd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.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..69c440c 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +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/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/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/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/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 5a27f0b..d840a9b 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": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", @@ -545,6 +548,36 @@ "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "open": "يفتح", +<<<<<<< HEAD +======= + "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": "عام", +>>>>>>> master "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", "prepareEmpNum":"إعداد رقم الموظف", "supplierInfo" : "معلومات المورد", @@ -558,5 +591,36 @@ "patientName" : "اسم المريض", "invoiceDate" : "تاريخ الفاتورة", "refundInvoice" :"فاتورة الاسترجاع", +<<<<<<< HEAD "hospitalClinic" : "عيادة المستشفى" +======= + "hospitalClinic" : "عيادة المستشفى", + "graphicalAnalysis": "التحليل الرسومي", + "itemHistoryAnalysis": "تحليل تاريخ العنصر", + "pOno": "امر شراء #", + "oprUnit": "وحدة التشغيل", + "qtyOrdered": "الكمية المطلوبة", + "qtyReceived": "الكمية المستلمة", + "bonusQty": "كمية المكافأة", + "balQty": "كمية التوازن", + "videoCall": "مكالمة فيديو", + "addUsers": "إضافة مستخدمين إلى المجموعة", + "admin": "مشرف", + "areYouSureWantTodelete": "هل أنت متأكد أنك تريد الحذف؟", + "Attendance": "الحضور", + "audioCall": "مكالمة صوتية", + "editGroups": "تعديل المجموعة", + "enterGroupName": "يرجى إدخال اسم المجموعة الصحيح", + "enterGroupNamePlease": "يرجى إدخال اسم المجموعة", + "groupMembers": "أعضاء المجموعة", + "groupName": "اسم المجموعة", + "groupNameshouldbe": "يجب أن يتكون اسم المجموعة من 10 أحرف على الأقل", + "manage": "إدارة", + "manageGroup": "إدارة المجموعة", + "members": "الأعضاء", + "searchByUserName": "البحث بواسطة اسم المستخدم", + "shareScreen": "مشاركة الشاشة", + "start":"يبدأ", + "about":"عن" +>>>>>>> master } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 2a9ece6..2ab3649 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -303,6 +303,7 @@ "section": "Section", "topic": "Topic", "actionBy": "Action By", + "pending": "Pending", "pendingTransactions": "Pending Transactions", "selectRequestType": "Please select request type", "dateFrom": "Date From", @@ -565,6 +566,34 @@ "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", +<<<<<<< HEAD +======= + "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", +>>>>>>> master "prepareEmpNum":"Prepare Employee Num", "supplierInfo" : "Supplier Information", "supplierAcNo": "Supplier Account No", @@ -577,5 +606,19 @@ "patientName" : "Patient Name", "invoiceDate" : "Invoice Date", "refundInvoice" :"Refund Invoice", +<<<<<<< HEAD "hospitalClinic" : "Hospital Clinic" +======= + "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.", + "start":"Start", + "about":"About" +>>>>>>> master } \ 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..98a3328 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 = ( @@ -362,6 +363,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"; @@ -500,6 +502,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"; @@ -530,6 +533,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/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 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - MOHEMM + MoheM CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index e3cbee1..fb415d4 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); } @@ -93,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/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart index bc0fece..145b039 100644 --- a/lib/api/dashboard_api_client.dart +++ b/lib/api/dashboard_api_client.dart @@ -13,6 +13,8 @@ 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 { @@ -26,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 { @@ -67,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 @@ -88,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 @@ -99,14 +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, + ); } //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 @@ -121,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 @@ -146,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 @@ -159,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 @@ -179,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 { @@ -196,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 { @@ -213,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/my_attendance_api_client.dart b/lib/api/my_attendance_api_client.dart index 78742a3..3978c2d 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,14 +55,55 @@ class MyAttendanceApiClient { }, url, postParams); } - Future> getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list, {String? empID, String? parentValue}) async { + 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"; 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, + "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> 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, @@ -60,7 +116,6 @@ class MyAttendanceApiClient { 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 = { @@ -97,6 +152,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.submitCEITransactionList!; //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/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index e08d30b..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,198 +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, + ); + } + + 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.getEITCollectionNotificationBodyList; - }, 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, @@ -693,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 5bc445c..428c831 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,6 +9,21 @@ class ApiConsts { // static String baseUrl = "https://webservices.hmg.com"; // PreProd static String baseUrl = "https://mohemm.hmg.com"; // static String baseUrl = "https://hmgwebservices.com"; // Live server + + // 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://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 + // static String baseUrl = "https://mohemm.hmg.com"; + // static String baseUrl = "https://hmgwebservices.com"; // Live server + static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/classes/date_uitl.dart b/lib/classes/date_uitl.dart index e27843c..8714b40 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)"; @@ -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/config/routes.dart b/lib/config/routes.dart index 33559e2..4653880 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,16 +53,16 @@ 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/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'; 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 +196,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 +207,9 @@ class AppRoutes { static const String unsafeDeviceScreen = "/unsafeDeviceScreen"; static const String appUpdateScreen = "/appUpdateScreen"; + static const String childEducation = "/childEducation"; + + static const String activityScreen = "/activityScreen"; static final Map routes = { login: (BuildContext context) => LoginScreen(), @@ -325,5 +327,7 @@ 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/dialogs/otp_dialog.dart b/lib/dialogs/otp_dialog.dart index 6c7529a..da2611e 100644 --- a/lib/dialogs/otp_dialog.dart +++ b/lib/dialogs/otp_dialog.dart @@ -205,9 +205,14 @@ class OtpDialog { borderRadius: const BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(color: Colors.red), ), + // focusedErrorBorder: OutlineInputBorder( + // borderRadius: const BorderRadius.all(Radius.circular(10.0)), + // borderSide: BorderSide(color: Colors.red), + // // borderSide: BorderSide(color: Theme.of(context).colorScheme.error), + // ), focusedErrorBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.red), + borderSide: BorderSide(color: Theme.of(context).colorScheme.error), ), ); } diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 2fb8722..afdf1a8 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -1,6 +1,6 @@ // 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'; @@ -10,7 +10,7 @@ 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()]); } @@ -20,7 +20,10 @@ class CodegenLoader extends AssetLoader { "arabic": "عربي", "login": "تسجيل الدخول", "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", + "userId": "UserID", "username": "اسم المستخدم", + "userName": "اسم المستخدم", + "userSearch": "User Search", "password": "كلمة المرور", "welcomeBack": "مرحبا بعودتك", "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", @@ -446,7 +449,11 @@ class CodegenLoader extends AssetLoader { "CorrectAddress": "تصحيح أو تعديل هذا العنوان", "SelectChangeWantToMake": " حدد نوع التغيير الذي تريد القيام به.", "profile": { - "reset_password": {"label": "Reset Password", "username": "Username", "password": "password"}, + "reset_password": { + "label": "Reset Password", + "username": "Username", + "password": "password" + }, "profileCompletionPer": "استكمال الملف الشخصي", "completeProfile": "الملف الشخصي الكامل", "personalInformation": "معلومات شخصية", @@ -468,7 +475,10 @@ class CodegenLoader extends AssetLoader { "gender": { "male": "Hi man ;) ", "female": "Hello girl :)", - "with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"} + "with_arg": { + "male": "Hi man ;) {}", + "female": "Hello girl :) {}" + } }, "reset_locale": "إعادة ضبط اللغة", "chat": "دردشة", @@ -549,37 +559,640 @@ class CodegenLoader extends AssetLoader { "expiredDocuments": "المستندات منتهية الصلاحية", "missingDocuments": "مستندات مفقودة", "uploadedDocuments": "المستندات التي تم تحميلها", + "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.", + "open": "يفتح", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", - "paymentRequest":"طلب الدفع", - - "paymentDetails":"تفاصيل الدفع", - "requestNo":"رقم الطلب", - "requesterEmpNum":"رقم الموظف الذي قدم الطلب", - "requesterEmpName":"اسم الموظف مقدم الطلب", - "prepareEmpName":"إعداد اسم الموظف", - "prepareEmpNum":"إعداد رقم الموظف", - "requesterPositionName":"اسم الوظيفة لمقدم الطلب", - "preparePositionName":"إعداد اسم الوظيفة", - "requesterPayrollName":"اسم مقدم الطلب", - "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", - "payingORGName":"اسم المنظمة الدافعة", - "requestAmount":"مبلغ الطلب", - "typeofPayment":"نوع الدفع", - "beneficiaryDetails":"تفاصيل المستفيد", - "beneficiaryName":"اسم المستفيد", - "idIqama":"الهوية السعودية / الإقامة", - "beneficiaryBankName":"اسم البنك المستفيد", - "sadadNumber":"رقم سداد", - "beneficiaryIBAN":"رقم IBAN للمستفيد", - "purchaseOrders":"طلبات الشراء", - "approvalDate":"تاريخ الموافقة", - "pOAmount":"مبلغ الطلب", - "versionStatus":"حالة الإصدار", - "supplierNo":"رقم المورد", - "general":"عام", "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": "معلومات المورد", + "supplierAcNo": "رقم حساب المورد", + "supplierAcName": "اسم حساب المورد", + "supplierIBAN": "رقم IBAN للمورد", + "supplierCRNo": "رقم السجل التجاري", + "suppliedAcNo": "رقم الحساب المقدم", + "patientRefundInvoice": "فاتورة استرداد الأموال للمريض", + "patientNumber": "رقم المريض", + "patientName": "اسم المريض", + "invoiceDate": "تاريخ الفاتورة", + "refundInvoice": "فاتورة الاسترجاع", + "hospitalClinic": "عيادة المستشفى", + "graphicalAnalysis": "التحليل الرسومي", + "itemHistoryAnalysis": "تحليل تاريخ العنصر", + "pOno": "امر شراء #", + "oprUnit": "وحدة التشغيل", + "qtyOrdered": "الكمية المطلوبة", + "qtyReceived": "الكمية المستلمة", + "bonusQty": "كمية المكافأة", + "balQty": "كمية التوازن", + "videoCall": "مكالمة فيديو", + "addUsers": "إضافة مستخدمين إلى المجموعة", + "admin": "مشرف", + "areYouSureWantTodelete": "هل أنت متأكد أنك تريد الحذف؟", + "Attendance": "الحضور", + "audioCall": "مكالمة صوتية", + "editGroups": "تعديل المجموعة", + "enterGroupName": "يرجى إدخال اسم المجموعة الصحيح", + "enterGroupNamePlease": "يرجى إدخال اسم المجموعة", + "groupMembers": "أعضاء المجموعة", + "groupName": "اسم المجموعة", + "groupNameshouldbe": "يجب أن يتكون اسم المجموعة من 10 أحرف على الأقل", + "manage": "إدارة", + "manageGroup": "إدارة المجموعة", + "members": "الأعضاء", + "searchByUserName": "البحث بواسطة اسم المستخدم", + "shareScreen": "مشاركة الشاشة", + "start": "يبدأ", + "about": "عن" }; + // 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", + // "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", + // "pending": "Pending", + // "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" + // }, + // "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": "المستندات التي تم تحميلها", + // "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", + // "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", + // "paymentRequest": "طلب الدفع", + // + // "paymentDetails": "تفاصيل الدفع", + // "requestNo": "رقم الطلب", + // "requesterEmpNum": "رقم الموظف الذي قدم الطلب", + // "requesterEmpName": "اسم الموظف مقدم الطلب", + // "prepareEmpName": "إعداد اسم الموظف", + // "prepareEmpNum": "إعداد رقم الموظف", + // "requesterPositionName": "اسم الوظيفة لمقدم الطلب", + // "preparePositionName": "إعداد اسم الوظيفة", + // "requesterPayrollName": "اسم مقدم الطلب", + // "requesterOperatingUnit": "وحدة تشغيل مقدم الطلب", + // "payingORGName": "اسم المنظمة الدافعة", + // "requestAmount": "مبلغ الطلب", + // "typeofPayment": "نوع الدفع", + // "beneficiaryDetails": "تفاصيل المستفيد", + // "beneficiaryName": "اسم المستفيد", + // "idIqama": "الهوية السعودية / الإقامة", + // "beneficiaryBankName": "اسم البنك المستفيد", + // "sadadNumber": "رقم سداد", + // "beneficiaryIBAN": "رقم IBAN للمستفيد", + // "purchaseOrders": "طلبات الشراء", + // "approvalDate": "تاريخ الموافقة", + // "pOAmount": "مبلغ الطلب", + // "versionStatus": "حالة الإصدار", + // "supplierNo": "رقم المورد", + // "general": "عام", + // "generate": "يولد", + // }; + static const Map en_US = { "mohemm": "Mohemm", "english": "English", @@ -1176,6 +1789,20 @@ class CodegenLoader extends AssetLoader { "invoiceDate" : 'Invoice Date', "refundInvoice" : 'Refund Invoice', "hospitalClinic" : 'Hospital Clinic', + + "profileCompletionPer": "Profile Completion", + "completeProfile": "Complete Profile", + "personalInformation": "Personal Information", + "basicDetails": "Basic Details", + + "contactDetails": "Contact Details", + "familyDetails": "Family Members", + "effectiveDate": "Effective Date", + "country": "Country" + }; + +// static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; +// } static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; -} +} \ No newline at end of file diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 72bbfc1..01a085a 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'; @@ -403,7 +406,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,7 +529,6 @@ 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'; @@ -544,9 +545,9 @@ abstract class LocaleKeys { 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 userSearch ='userSearch'; + // static const userName ='userName'; + // static const userId ='userId'; static const addAtLeastOneAttachment ='addAtLeastOneAttachment'; static const pleaseClickButtonToJoinMarathon ='pleaseClickButtonToJoinMarathon'; static const youCannotJoinTheMarathon ='youCannotJoinTheMarathon'; @@ -589,4 +590,17 @@ abstract class LocaleKeys { static const invoiceDate = 'Invoice Date'; static const refundInvoice = 'Refund Invoice'; static const hospitalClinic = 'Hospital Clinic'; + static const paymentRequest = 'paymentRequest'; + 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'; + static const Attendance = 'Attendance'; + static const start = 'start'; + static const about ='about'; + } 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/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/dashboard/event_activity.dart b/lib/models/dashboard/event_activity.dart new file mode 100644 index 0000000..4b523d7 --- /dev/null +++ b/lib/models/dashboard/event_activity.dart @@ -0,0 +1,84 @@ + 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, + required this.shortImageURL, + required this.detailImageURL + }); + + 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; + final String? shortImageURL; + final String? detailImageURL; + 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"], + shortImageURL: json["ShortImageURL"], + detailImageURL: json["DetailImageURL"] + ); + } + + 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, + "DetailImageURL": detailImageURL, + "ShortImageURL" : shortImageURL + }; +} 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/generic_response_model.dart b/lib/models/generic_response_model.dart index e9daeb4..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'; @@ -184,9 +185,9 @@ class GenericResponseModel { List? getBasicDetColsStructureList; List? getBasicDetDffStructureList; List? getBasicDetNtfBodyList; - List? getCEICollectionNotificationBodyList; - List? getCEIDFFStructureList; - List? getCEITransactionList; + List? getCEICollectionNotificationBodyList; + List? getCEIDFFStructureList; + List? getCEITransactionList; List? getCcpTransactionsList; List? getContactColsStructureList; @@ -214,6 +215,7 @@ class GenericResponseModel { List? getItemTypesList; List? getLookupValuesList; List? getMenuEntriesList; + List? getEventActivityList; List? getMoItemHistoryList; List? getMoNotificationBodyList; List? getNotificationButtonsList; @@ -226,6 +228,7 @@ class GenericResponseModel { List? getOrganizationsSalariesList; List? getPaymentInformationList; List? getPayslipList; + // List? getPendingReqDetailsList; // List? getPendingReqFunctionsList; List? getPerformanceAppraisalList; @@ -355,7 +358,7 @@ class GenericResponseModel { StartTermApprovalProcessList? startTermApprovalProcessList; SubmitAddressTransaction? submitAddressTransactionList; SubmitBasicDetailsTransactionList? submitBasicDetTransactionList; - String? submitCEITransactionList; + SubmitEITTransactionList? submitCEITransactionList; SubmitCcpTransactionList? submitCcpTransactionList; SubmitContactTransactionList? submitContactTransactionList; SubmitEITTransactionList? submitEITTransactionList; @@ -486,6 +489,7 @@ class GenericResponseModel { this.getItemTypesList, this.getLookupValuesList, this.getMenuEntriesList, + this.getEventActivityList, this.getMoItemHistoryList, this.getMoNotificationBodyList, this.getNotificationButtonsList, @@ -503,7 +507,7 @@ class GenericResponseModel { this.getPoItemHistoryList, this.getPoNotificationBodyList, this.getPrNotificationBodyList, - this.getPaymentNotificationBodyList, + this.getPaymentNotificationBodyList, this.getPRInformationList, this.getQuotationAnalysisList, this.getRFCEmployeeListList, @@ -700,7 +704,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)); }); @@ -844,9 +848,24 @@ class GenericResponseModel { }); } - getCEICollectionNotificationBodyList = json['GetCEICollectionNotificationBodyList']; - getCEIDFFStructureList = json['GetCEIDFFStructureList']; - getCEITransactionList = json['GetCEITransactionList']; + getCEICollectionNotificationBodyList = json["GetCEICollectionNotificationBodyList"] == null + ? null + : List.from(json["GetCEICollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x))); + + 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) { @@ -958,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) { @@ -1028,7 +1048,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 +1125,6 @@ class GenericResponseModel { }); } - - if (json['GetTimeCardSummaryList'] != null) { getTimeCardSummaryList = []; json['GetTimeCardSummaryList'].forEach((v) { @@ -1367,7 +1384,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; @@ -1542,10 +1559,15 @@ class GenericResponseModel { if (this.getBasicDetNtfBodyList != null) { data['GetBasicDetNtfBodyList'] = this.getBasicDetNtfBodyList!.map((v) => v.toJson()).toList(); } - 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(); @@ -1612,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(); } @@ -1628,7 +1651,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; @@ -1837,6 +1860,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/models/get_eit_dff_structure_list_model.dart b/lib/models/get_eit_dff_structure_list_model.dart index 3aed98c..59736d3 100644 --- a/lib/models/get_eit_dff_structure_list_model.dart +++ b/lib/models/get_eit_dff_structure_list_model.dart @@ -39,7 +39,7 @@ class GetEITDFFStructureList { String? vALIDATIONTYPE; String? vALIDATIONTYPEDSP; String? fieldAnswer; - + String? vSSRCHFLAG; GetEITDFFStructureList( {this.aLPHANUMERICALLOWEDFLAG, this.aPPLICATIONCOLUMNNAME, @@ -80,7 +80,9 @@ class GetEITDFFStructureList { this.uSEDFLAG, this.vALIDATIONTYPE, this.vALIDATIONTYPEDSP, - this.fieldAnswer}); + this.fieldAnswer, + this.vSSRCHFLAG + }); GetEITDFFStructureList.fromJson(Map 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; } @@ -214,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() { @@ -230,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/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/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/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; diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 1ca52af..084e8e4 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -1691,7 +1691,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/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 0e18544..e644aa0 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; @@ -162,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); + }, + ), ); }); } @@ -253,8 +258,28 @@ 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); + } + } + + 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); } } @@ -291,6 +316,8 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { return res; } + + void notify() { notifyListeners(); } diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 153c999..cce9d3b 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -117,8 +117,6 @@ class _MonthlyAttendanceScreenState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - // confirmWidget: Text(LocaleKeys.confirm.tr()), - // cancelWidget: 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 68cc7fb..846f19d 100644 --- a/lib/ui/chat/chat_home_screen.dart +++ b/lib/ui/chat/chat_home_screen.dart @@ -214,8 +214,13 @@ class _ChatHomeScreenState extends State { }, ), floatingActionButton: FloatingActionButton( +// <<<<<<< HEAD +// elevation: 0, +// backgroundColor : Colors.transparent, +// ======= + backgroundColor: Colors.transparent, elevation: 0, - backgroundColor : Colors.transparent, + child: Container( width: 60, height: 60, 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/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 90e5ef5..bce1f0e 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'; @@ -22,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'; @@ -151,6 +151,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(); @@ -422,103 +423,109 @@ 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)), - ], - ), - ], + eventActivityWidget(context), + 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), @@ -703,6 +710,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 && context.watch().eventActivity!.isActive == true) + ? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) + : const SizedBox(); + } + 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..511b0fe --- /dev/null +++ b/lib/ui/landing/event_activity_banner.dart @@ -0,0 +1,367 @@ +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'; + +int dummyTime = DateTime.now().millisecondsSinceEpoch + 8690; + +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, + 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 SizedBox( + // 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: + // + + 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: [ + + 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( + 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, + + 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 ? 25 : 16, + fontWeight: FontWeight.bold, + 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 ? 15.height : 10.height, + CountdownTimerForMainScreen( + timeToMarathon: DateUtil.convertStringToDateMarathon(dashboardProvider.eventActivity!.startOn!).millisecondsSinceEpoch, + provider: context.read(), + isEvent: true, + ), + ], + ).paddingOnly( + left: AppState().isArabic(context) ? 12 : 3, + right: AppState().isArabic(context) ? 3 : 12, + ) + ], + ), + ), + ), + ], + ), + ), + + !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 = 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/landing/itg/its_add_screen_video_image.dart b/lib/ui/landing/itg/its_add_screen_video_image.dart index cf2d92b..6e1358c 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,33 @@ 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 +186,103 @@ 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 { + // if (hasTimerEndedBool) { + return ListView.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; + bool isAcknowledge = advertisementData?.actionButtonsColl![index].actionButtonId == 17; + 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); }); - }).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(); - } + }, + ).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(); + // } }, ), 20.height, diff --git a/lib/ui/leave_balance/leave_balance_screen.dart b/lib/ui/leave_balance/leave_balance_screen.dart index 9fb925c..85354f9 100644 --- a/lib/ui/leave_balance/leave_balance_screen.dart +++ b/lib/ui/leave_balance/leave_balance_screen.dart @@ -64,47 +64,58 @@ 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:SingleChildScrollView(child: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( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + 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..13d8853 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'; @@ -30,6 +31,8 @@ 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'; @@ -56,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; @@ -70,26 +72,30 @@ 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() { + try { + SafeDevice.isJailBroken.then((bool value) { + isJailBroken = value; + }); + SafeDevice.isRealDevice.then((value) { + isRealDevice = value; + }); + + if (Platform.isAndroid) { + // isOnExternalStorage = await SafeDevice.isOnExternalStorage; + // SafeDevice.isDevelopmentModeEnable.then((value) { + // isDevelopmentModeEnable = value; + // }); + } + } catch (error) { + print(error); + } + } @override void dispose() { @@ -120,7 +126,14 @@ class _LoginScreenState extends State { firebaseToken = ""; } AppNotifications().init(firebaseToken, context); - checkLoginInfo(); + + if (isJailBroken || !isRealDevice) { + Utils.hideLoading(context); + Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false); + } else { + checkLoginInfo(); + } + await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); } // }); @@ -198,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( diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index b0ef955..2cabedc 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -58,14 +58,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( @@ -75,15 +71,17 @@ class _VerifyLastLoginScreenState extends State { automaticallyImplyLeading: false, title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { - showMDialog(context, child: BusinessCardDialog(),backgroundColor: Colors.white); + showMDialog(context, child: const BusinessCardDialog()); }) : Container(), actions: [ Center( - child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { - showMDialog(context, child: EmployeeDigitialIdDialog(),backgroundColor: Colors.white); - })), - 21.width + + child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { + showMDialog(context, child: EmployeeDigitialIdDialog()); + }), + ), + 21.width, ], ), body: Column( @@ -99,7 +97,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( @@ -107,24 +105,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, @@ -132,10 +120,10 @@ 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(), ], - ) + ), ], ), ), @@ -146,15 +134,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( @@ -192,12 +175,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, ], ), ); @@ -227,7 +207,16 @@ 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( @@ -247,6 +236,7 @@ class _VerifyLastLoginScreenState extends State { } Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { +// <<<<<<< HEAD bool isDisable = false; if(_flag >= 3 && _flag <= 4) { bool isFaceEnabled = (_flag == 3 && (checkBiometricIsAvailable(BiometricType.face) || @@ -258,6 +248,10 @@ class _VerifyLastLoginScreenState extends State { isDisable = !(isFaceEnabled || isThumbEnabled); } +// ======= +// bool isDisable = (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) || +// _flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.face)); +// // >>>>>>> master return InkWell( onTap: isDisable ? null @@ -306,15 +300,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)], ), ), ); @@ -358,8 +344,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); @@ -372,9 +362,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); }, @@ -390,14 +378,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) { @@ -415,12 +404,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); }); } } @@ -437,5 +424,4 @@ class _VerifyLastLoginScreenState extends State { // // isLoading = isTrue; // }); // } - } diff --git a/lib/ui/login/verify_login_screen.dart b/lib/ui/login/verify_login_screen.dart index 4358190..e0015e0 100644 --- a/lib/ui/login/verify_login_screen.dart +++ b/lib/ui/login/verify_login_screen.dart @@ -91,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); @@ -611,8 +612,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/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/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 4f67c62..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(); @@ -46,10 +48,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,14 +99,25 @@ 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',isAttachmentMandatory: dynamicParams!.isAttachmentMandatory)); + arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit', + isAttachmentMandatory: dynamicParams!.isAttachmentMandatory)); if (!AppState().cancelRequestTrancsection) { return; } @@ -133,8 +153,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); @@ -647,42 +686,96 @@ 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'){ + 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( + 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(); @@ -862,9 +955,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) { @@ -878,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/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/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index cadc11d..96e673d 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -169,8 +169,6 @@ class _ViewAttendanceState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - // confirmWidget: Text(LocaleKeys.confirm.tr()), - // cancelWidget: 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 d2c8c94..f478b53 100644 --- a/lib/ui/profile/delete_family_member.dart +++ b/lib/ui/profile/delete_family_member.dart @@ -115,8 +115,9 @@ class _DeleteFamilyMemberState extends State { padding: EdgeInsets.only(left: 50, right: 50), child: TextButton( style: TextButton.styleFrom( - backgroundColor: MyColors.white, foregroundColor: MyColors.white, + surfaceTintColor: MyColors.white, + backgroundColor: MyColors.gradiantEndColor, ), onPressed: () { deleteFamilyMember(datePar); 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; + } + }, + ), + ); + } +} 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..56450b5 --- /dev/null +++ b/lib/ui/screens/event_activity/activity_event_card.dart @@ -0,0 +1,115 @@ +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!, + height: 200, + placeholder: (BuildContext context, String url) => const LinearProgressIndicator( + value: 0.7, + minHeight: 200, + + valueColor: AlwaysStoppedAnimation(Colors.white), + backgroundColor: Color(0xff196D73), + ).toShimmer(), + fit: BoxFit.contain,width: double.infinity , + cacheKey: UniqueKey().toString(), + ), + + ], + ), + ), + 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..8db2175 --- /dev/null +++ b/lib/ui/screens/event_activity/activity_footer.dart @@ -0,0 +1,94 @@ +// ignore_for_file: always_specify_types + +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'; +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 { + final DashboardProviderModel provider; + + const ActivityEventFooter({ + Key? key, + required this.provider, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + + int remainingTime = DateTime.now().millisecondsSinceEpoch + DateUtil.convertStringToDateMarathon(provider.eventActivity!.startOn!).difference(DateTime.now()).inMilliseconds; + + return Column(children: [ + 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, + + ) + // if (remainingTimeInMinutes < 0) + // + // else + // + // + // , + + ]); + + } + + +} 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), + ], + ), + ); + } +} 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..ef54e65 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 @@ -77,6 +77,7 @@ class _OffersAndDiscountsDetailsState extends State { Html( data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", onLinkTap: (String? url, Map attributes, _) { + launchUrl(Uri.parse(url!)); }, ), 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/ui/unsafe_device_screen.dart b/lib/ui/unsafe_device_screen.dart index dca8748..dcfe820 100644 --- a/lib/ui/unsafe_device_screen.dart +++ b/lib/ui/unsafe_device_screen.dart @@ -32,15 +32,15 @@ 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, 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) { diff --git a/lib/ui/work_list/item_history_screen.dart b/lib/ui/work_list/item_history_screen.dart index 7490d38..4bc6579 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()), + 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/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index 2381b70..fdfe19c 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,28 +76,65 @@ 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"); } - Utils.hideLoading(context); - setState(() { - controller.jumpToPage(0); - }); + + 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, itgRequest!.fieldGoups![0].fields![1].value ?? ""); + 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); + Future.delayed(Duration.zero); + setState(() { + controller.jumpToPage(0); + }); + Utils.hideLoading(context); + } + } else { + timeCardSummaryData = ItgTimeCardSummaryData(); + Utils.hideLoading(context); + setState(() { + controller.jumpToPage(0); + }); + } + } 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); } } - 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; providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1; getItgData(); + Utils.hideLoading(context); getItgRequestAttachments(); } } @@ -102,7 +142,6 @@ class _ItgDetailScreenState extends State { @override Widget build(BuildContext context) { getDataFromState(); - return Scaffold( appBar: AppBarWidget(context, title: LocaleKeys.details.tr()), backgroundColor: Colors.white, @@ -110,10 +149,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, @@ -130,27 +166,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( @@ -165,11 +185,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 @@ -181,72 +199,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( @@ -291,21 +266,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, ); } @@ -383,29 +356,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"); @@ -436,18 +413,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); @@ -467,23 +437,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), + ), ], ); } @@ -491,29 +448,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"); @@ -533,6 +498,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); @@ -632,25 +598,18 @@ 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 { 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; }); 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..d7d9c7e 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 || 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" || wFHistory[index + 1].date! == "") { + 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; 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..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,126 +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 fields) { - 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), - ), - ).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, 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/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/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index bd0a8b3..71a87f8 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(); } @@ -146,6 +142,8 @@ class _WorkListDetailScreenState extends State { if (workListData!.iTEMTYPE == "HRSSA") { if (workListData!.rEQUESTTYPE == "EIT") { getEitNotificationBody(); + } else if (workListData!.rEQUESTTYPE == "CEI") { + getCEINotificationBody(); } else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") { getPhonesNotificationBody(); } else if (workListData!.rEQUESTTYPE == "BASIC_DETAILS") { @@ -191,8 +189,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 +222,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 +241,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 +259,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 @@ -319,65 +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; - }); - }) - ], ), ) ], @@ -388,8 +353,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 +362,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 +388,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 +420,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 +499,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 +519,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 +545,7 @@ class _WorkListDetailScreenState extends State { notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList, callBackFunc: reloadWorkList, - getNotificationRespondAttributes: - getNotificationRespondAttributes, + getNotificationRespondAttributes: getNotificationRespondAttributes, )); break; case "FORWARD": @@ -617,8 +557,7 @@ class _WorkListDetailScreenState extends State { notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList, callBackFunc: reloadWorkList, - getNotificationRespondAttributes: - getNotificationRespondAttributes, + getNotificationRespondAttributes: getNotificationRespondAttributes, )); break; case "DEL": @@ -639,8 +578,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 +598,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 +608,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 +626,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, @@ -751,10 +681,17 @@ class _WorkListDetailScreenState extends State { } void performAction(String actionMode, {String? title}) { + 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( - message: title != null ? null : LocaleKeys.requestedItems.tr(), + message: question, title: title, notificationGetRespond: notificationNoteInput, actionMode: actionMode, @@ -764,10 +701,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 }); } @@ -783,10 +717,11 @@ class _WorkListDetailScreenState extends State { actionMode == "APPROVE" || actionMode == "CLOSE" || actionMode == "ANSWER_INFO" || - actionMode == "RFC") { + 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()); @@ -799,8 +734,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; @@ -836,13 +770,30 @@ 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); apiCallCount++; getEitCollectionNotificationBodyList!.clear(); - getEitCollectionNotificationBodyList = await WorkListApiClient() - .GetEitNotificationBody(workListData!.nOTIFICATIONID); + getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -860,8 +811,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); @@ -879,8 +829,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); @@ -898,8 +847,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); @@ -917,8 +865,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); @@ -935,8 +882,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); @@ -953,8 +899,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); @@ -970,8 +915,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) { @@ -989,11 +933,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) { @@ -1011,8 +953,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); @@ -1029,8 +970,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); @@ -1047,8 +987,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); @@ -1065,8 +1004,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); @@ -1083,8 +1021,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); @@ -1102,8 +1039,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; } @@ -1124,25 +1060,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; } @@ -1165,8 +1094,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; }); @@ -1179,8 +1110,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; }); 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/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 2d0794c..73a87f7 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: [ @@ -743,8 +743,8 @@ class InfoFragment extends StatelessWidget { ), 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 ?? ""), ), @@ -763,6 +763,18 @@ class InfoFragment extends StatelessWidget { ItemDetailGrid( ItemDetailViewCol( LocaleKeys.preparePositionName.tr(), data.paymentDetailsList![0].preparePositionName ?? ""), + ItemDetailViewCol( + LocaleKeys.requesterPositionName.tr(), data.paymentDetailsList![0].requesterPositionName ?? ""), + ), + ItemDetailGrid( + 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 ?? "") ), @@ -770,30 +782,30 @@ class InfoFragment extends StatelessWidget { ], ).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( @@ -846,7 +858,7 @@ class InfoFragment extends StatelessWidget { ItemDetailGrid( ItemDetailViewCol(LocaleKeys.supplierNo.tr(), data.purchaseOrdersList![0].supplierNumber?? ""), - Container(), + Container(), ), ], ).objectContainerView(), @@ -899,13 +911,16 @@ class InfoFragment extends StatelessWidget { ItemDetailViewCol(LocaleKeys.invoiceDate.tr(), DateUtil.formatDateToDate( DateUtil.convertStringToDate( data.refundInvoiceList![0].invoicedDate), false)?? ""), + ItemDetailViewCol( LocaleKeys.refundInvoice.tr(), data.refundInvoiceList![0].invoiceNumber ?? "" ), ), ], ).objectContainerView(), + ], + ); } } 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/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/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/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(); + } +} diff --git a/lib/widgets/item_detail_view_widget.dart b/lib/widgets/item_detail_view_widget.dart index 68b245a..64bbd01 100644 --- a/lib/widgets/item_detail_view_widget.dart +++ b/lib/widgets/item_detail_view_widget.dart @@ -52,8 +52,10 @@ class ItemDetailViewGridItem extends StatelessWidget { final String? value; 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 = ""}) : 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) { @@ -76,20 +78,22 @@ 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, 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: maxLine) : Container(), ], - ), + ).paddingOnly(top: showSpaceAfterLine ? 16 : 0), ); } } diff --git a/lib/widgets/location/Location.dart b/lib/widgets/location/Location.dart index 47babca..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.medium, timeLimit: const Duration(seconds: 5)).then((value) { + Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: const Duration(seconds: 10)).then((value) { done(value); }).catchError((err) { errorCallBack(); diff --git a/lib/widgets/my_video_progress_indicator.dart b/lib/widgets/my_video_progress_indicator.dart new file mode 100644 index 0000000..3593115 --- /dev/null +++ b/lib/widgets/my_video_progress_indicator.dart @@ -0,0 +1,134 @@ +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 { + 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, + // ), + + AnimatedProgressBar( + value: position / duration, + 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 = 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); + if (widget.allowScrubbing) { + return VideoScrubber(controller: controller, child: paddedProgressIndicator); + } else { + return paddedProgressIndicator; + } + } +} 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 bf5ea18..69e9595 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.6.3+300073 environment: sdk: ">=2.16.0 <3.5.0" @@ -61,12 +61,11 @@ dependencies: platform_device_id: ^1.0.1 image_picker: ^0.8.5+3 file_picker: 5.2.5 - geolocator: ^9.0.2 month_year_picker: ^0.4.0+1 month_picker_dialog: ^3.0.0 -# open_file: ^3.2.1 + geolocator: ^9.0.2 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 @@ -76,14 +75,16 @@ dependencies: flutter_rating_bar: ^4.0.1 auto_size_text: ^3.0.0 pull_to_refresh: ^2.0.0 + fl_chart: ^0.66.0 # lottie json animations lottie: any # Marathon Card Swipe appinio_swiper: ^1.1.1 expandable: ^5.0.1 + safe_device: ^1.1.9 # networkImage - cached_network_image: ^3.2.2 + #Chat signalr_netcore: ^1.3.3 @@ -108,7 +109,7 @@ 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 @@ -121,7 +122,8 @@ dependencies: google_api_availability: ^3.0.1 google_maps_flutter_web: ^0.5.4 in_app_update: 4.1.0 - + cached_network_image: ^3.3.0 # or newer + flutter_blurhash: ^0.8.0 # #todo its for temporary purpose, later will remove this. dotted_border: ^2.0.0+3 @@ -130,7 +132,7 @@ dependencies: dependency_overrides: firebase_core_platform_interface: 4.5.1 - + cached_network_image: ^3.2.0 dev_dependencies: flutter_test: @@ -162,6 +164,7 @@ flutter: - assets/ - assets/langs/ - assets/icons/ + - assets/icons/itg/ - assets/lottie/ - assets/audio/ - assets/json/ @@ -225,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