diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..af7c712 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "MPLOYEEIMAGE" + ] +} \ No newline at end of file diff --git a/assets/images/basic-details.svg b/assets/images/basic-details.svg new file mode 100644 index 0000000..215f00b --- /dev/null +++ b/assets/images/basic-details.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/contact-details.svg b/assets/images/contact-details.svg new file mode 100644 index 0000000..c9ac5a5 --- /dev/null +++ b/assets/images/contact-details.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/family-members.svg b/assets/images/family-members.svg new file mode 100644 index 0000000..eca7dd5 --- /dev/null +++ b/assets/images/family-members.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/personal-info.svg b/assets/images/personal-info.svg new file mode 100644 index 0000000..9daf5ad --- /dev/null +++ b/assets/images/personal-info.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/images/user-avatar.png b/assets/images/user-avatar.png new file mode 100644 index 0000000..a16f4d5 Binary files /dev/null and b/assets/images/user-avatar.png differ diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index e8892a8..9efc35d 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -52,6 +52,30 @@ "confirm": "تؤكد", "passwordChangedSuccessfully": "تم تغيير الرقم السري بنجاح", "itemsForSale": "سلع للبيع", + "attendanceDetails": "تفاصيل الحضور", + "order": "الطلبات", + "earlyOut": "الخروج مبكرا", + "shortage": "ساعات التقصير", + "excess": "Excess", + "lateIn": "القدوم المتاخر", + "approvedCheckOut": "وقت الخروج", + "approvedCheckIn": "وقت الدخول", + "actualCheckOut": "وقت الخروج", + "actualCheckIn": "وقت الدخول", + "present": "حضور", + "pres": "حضور", + "shiftTime": "وقت التناوب", + "absent": "غياب", + "attendance": "الحضور", + "scheduleDays": "ايام العمل", + "offDays": "ايام الراحه", + "nonAnalyzed": "لايوجد تحليل", + "shortageHour": "ساعات التقصير", + "stats": "الحاله", + "completed": "تم اكمال", + "msg": "Hello {} in the {} world ", + "msg_named": "{} are written in the {lang} language", + "clickMe": "Click me", "doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة", "atLeastOneLowercase": "حرف صغير واحد على الأقل", "atLeastOneUppercase": "حرف كبير واحد على الأقل", @@ -66,18 +90,172 @@ "whatsapp": "واتس اب", "reject": "يرفض", "approve": "يوافق", - "msg": "Hello {} in the {} world ", - "msg_named": "{} are written in the {lang} language", - "clickMe": "Click me", + "cancel": "إلغاء", + "requestedItems": "العناصر المطلوبة", + "request": "طلب", + "actions": "أجراءات", + "delegate": "مندوب", + "request_info": "اطلب معلومات", + "attachments": "المرفقات", + "info": "معلومات", + "employeeNumber": "رقم الموظف", + "assignmentNumber": "رقم الواجب", + "employeeName": "اسم الموظف", + "scheduleDate": "تاريخ الجدول الزمني", + "shiftType": "نوع التحول", + "shift": "يحول", + "breakText": "استراحة", + "actualSwipeStart": "بدء التمرير الفعلي", + "actualSwipeEnd": "التمرير الفعلي للنهاية", + "approvedSwipeStart": "وافق انتقاد البدء", + "approvedSwipeStartReason": "تمت الموافقة على سبب بدء التمرير السريع", + "approvedSwipeEnd": "تمت الموافقة على تمرير النهاية", + "approvedSwipeEndReason": "الموافقة على سبب إنهاء التمرير", + "from": "من", + "to": "ل", + "sent": "أرسلت", + "closed": "مغلق", + "id": "هوية شخصية", + "responder": "المستجيب", + "jobTitle": "عنوان وظيفي", + "grade": "درجة", + "jobCategory": "تصنيف الوظيفة", + "category": "فئة", + "employeeEmailAddress": "عنوان البريد الإلكتروني للموظف", + "payrollBranch": "فرع الرواتب", + "yourChangeHasBeenSavedSuccessfully": "تم حفظ التغيير الخاص بك بنجاح", + "code": "شفرة", + "unit": "وحدة", + "quantity": "كمية", + "dateRequired": "التاريخ مطلوب", + "lineStatus": "حالة الخط", + "statusDate": "تاريخ الحالة", + "transactionType": "نوع المعاملة", + "operatingUnit": "وحدة التشغيل", + "organizationCode": "كود المنظمة", + "organization": "منظمة", + "fromSubInventory": "من الجرد الفرعي", + "fromLocator": "من محدد المواقع", + "toSubInventory": "إلى الجرد الفرعي", + "toLocator": "إلى محدد المواقع", + "shipToLocator": "شحن إلى محدد المواقع", + "itemHistory": "تاريخ العنصر", + "mfg": "مبدع", + "lineType": "نوع الخط", + "price": "السعر", + "lineAmount": "مبلغ الخط", + "lineDiscount": "خصم الخط٪", + "needByDate": "القادمة إلى الأمام", + "promisedDate": "التسجيل وعد", + "deliverToLocation": "تسليم إلى الموقع", + "requisitionNumber": "رقم الطلب", + "requester": "مقدم الطلب", + "quotationAnalysis": "تحليل الاقتباس", + "subject": "موضوعات", + "description": "وصف", + "supplier": "المورد", + "site": "موقع", + "buyer": "مشتر", + "preparer": "معد", + "creationDate": "تاريخ الإنشاء", + "shipToLocation": "الشحن الى الموقع", + "quotationNumber": "رقم الإقتباس", + "quotationDate": "تاريخ الاقتباس", + "paymentTerms": "شروط الدفع", + "currency": "عملة", + "grossAmount": "المبلغ الإجمالي", + "discountAmount": "مقدار الخصم", + "customDuty": "الرسوم الجمركية", + "shipHandle": "مقبض السفينة", + "otherCharges": "رسوم أخرى", + "totalPOAmountWithVAT": "إجمالي مبلغ الشراء مع ضريبة القيمة المضافة", + "totalPOAmountInWords": "إجمالي مبلغ أمر الشراء بالكلمات", + "requestNumber": "رقم الطلب", + "uom": "UOM", + "operatingCode": "كود التشغيل", + "poNumber": "PO عدد", + "revision": "مراجعة", + "quantityOrdered": "الكمية المطلوبة", + "quantityReceived": "الكمية المستلمة", + "bonusQuantity": "كمية المكافأة", + "purchasePrice": "سعر الشراء", + "discountPer": "خصم ٪", + "balanceQuantity": "كمية التوازن", + "netPrice": "السعر الصافي", + "closureStatus": "حالة الإغلاق", + "quotationNetPrice": "صافي سعر الاقتباس", + "quotationUOM": "اقتباس UOM", + "quotationQty": "اقتباس الكمية", + "itemCode": "رمز الصنف", + "vendorName": "اسم البائع", + "quotationMFGPartNumber": "رقم الجزء MFG الاقتباس", + "quotationDeliveryDate": "تاريخ تسليم عرض الأسعار", + "quotationBonusQuantity": "كمية مكافأة الاقتباس", + "quotationLineTotal": "مجموع خط الاقتباس", + "rfqUOM": "RFQ UOM", + "rfqQty": "RFQ الكمية", + "rfqNumber": "رقم RFQ", "human": "بشري", "resources": "موارد", "details": "تفاصيل", + "noDataAvailable": "لا تتوافر بيانات", + "productName": "اسم المنتج", + "productDescription": "وصف المنتج", + "unitPrice": "سعر الوحده", + "manufacturerName": "اسم المصنع", + "manufacturerPartName": "اسم جزء الشركة المصنعة", + "supplierName": "اسم المورد", + "supplierContact": "الاتصال بالمورد", + "chargeToPatient": "المسؤول عن المريض", + "justification": "التبرير", + "itemDescription": "وصف السلعة", + "groupCode": "كود المجموعة", + "primaryUOM": "UOM الابتدائية", + "subgroupDescription": "وصف المجموعة الفرعية", + "subgroupCode": "رمز المجموعة الفرعية", + "groupDescription": "وصف المجموعة", + "templateName": "اسم القالب", + "itemCreationStatus": "حالة إنشاء العنصر", + "standardizationApprovalStatus": "حالة الموافقة على التقييس", + "standardizationApprovalRejectionReason": "سبب رفض الموافقة على التقييس", + "analyzedBy": "تحليل بواسطة", + "approvedDate": "تاريخ الموافقة", + "itemType": "نوع العنصر", + "relatedTo": "متعلق ب", + "requestDate": "تاريخ الطلب", + "analyzedDate": "تاريخ التحليل", + "urgent": "العاجلة", + "requestDetails": "طلب تفاصيل", + "approvalLevel": "مستوى الموافقة", + "requesterDetails": "تفاصيل مقدم الطلب", + "myAttendance": "حضوري", + "workOnBreak": "العمل على استراحة", + "next": "التالي", + "completingYear": "نحن نقدر لك لاستكمال خدمة", + "year": "سنة", + "month": "شهر", + "day": "يوم", + "address" : "العنوان", + "phoneNumber": "رقم الجوال", + "businessGroup": "مجموعة العمل", + "Payroll": "الراتب", + "civilIdentityNumber": "رقم الهويه", + "dateOfBirth" : "تاريخ الميلاد", + "maritalStatus ": "الحالة الاجتماعية", + "fullName": "الأسم الكامل", + "remove": "حذف", "profile": { "reset_password": { "label": "Reset Password", "username": "Username", "password": "password" - } + }, + "profileCompletionPer": "استكمال الملف الشخصي", + "completeProfile": "الملف الشخصي الكامل", + "personalInformation": "معلومات شخصية", + "basicDetails": "تفاصيل أساسية", + "contactDetails": "بيانات التواصل", + "familyDetails": "تفاصيل عائلية" }, "clicked": { "zero": "You clicked {} times!", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index f5b9b44..9097f9e 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -52,6 +52,27 @@ "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 11", + "pres": "present", + "shiftTime": "Shift Time", + "absent": "ABSENT 10", + "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", @@ -66,18 +87,176 @@ "whatsapp": "Whatsapp", "reject": "Reject", "approve": "Approve", + "cancel": "Cancel", + "requestedItems": "Requested Items", + "request": "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", + "approvedCheckIn": "Approved Check In", + "urgent": "Urgent", + "requestDetails": "Request Details", + "approvalLevel": "Approval Level", + "requesterDetails": "Requester Details", + "myAttendance": "My Attendance", + "workOnBreak": "Work On Break", + "next": "Next", + "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", "profile": { "reset_password": { "label": "Reset Password", "username": "Username", "password": "password" - } + }, + "profileCompletionPer": "Profile Completion", + "completeProfile": "Complete Profile", + "personalInformation": "Personal Information", + "basicDetails": "Basic Details", + "contactDetails": "Contact Details", + "familyDetails": "Family Members" }, "clicked": { "zero": "You clicked {} times!", diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index 17eac0d..3263bf4 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart'; import 'package:http/io_client.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/exceptions/api_exception.dart'; import '../main.dart'; @@ -81,6 +82,9 @@ class ApiClient { logger.i("res: " + response.body); } var jsonData = jsonDecode(response.body); + if (jsonData["IsAuthenticated"] != null) { + AppState().setIsAuthenticated = jsonData["IsAuthenticated"]; + } if (jsonData["ErrorMessage"] == null) { return factoryConstructor(jsonData); } else { @@ -237,4 +241,4 @@ class ApiClient { } Future _post(url, {Map? headers, body, Encoding? encoding}) => _withClient((client) => client.post(url, headers: headers, body: body, encoding: encoding)); - } +} diff --git a/lib/api/eit_api_client.dart b/lib/api/eit_api_client.dart new file mode 100644 index 0000000..e3f78bf --- /dev/null +++ b/lib/api/eit_api_client.dart @@ -0,0 +1,31 @@ +import 'dart:async'; + +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/basic_member_information_model.dart'; +import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; +import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/member_login_list_model.dart'; + +import 'api_client.dart'; + +class EITApiClient { + static final EITApiClient _instance = EITApiClient._internal(); + + EITApiClient._internal(); + + factory EITApiClient() => _instance; + + Future?> getEITTransactions(String functionName) async { + String url = "${ApiConsts.erpRest}GET_EIT_TRANSACTIONS"; + Map postParams = {'P_FUNCTION_NAME': functionName, "P_MENU_TYPE": "E", "P_PAGE_LIMIT": 50, "P_PAGE_NUM": 1}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + List? responseData = GET_EIT_Transactions_Model.fromJson(json['GetEITTransactionList'][0]).collectionTransaction; + return responseData; + }, url, postParams); + } +} diff --git a/lib/api/login_api_client.dart b/lib/api/login_api_client.dart index 070fa27..2761ebe 100644 --- a/lib/api/login_api_client.dart +++ b/lib/api/login_api_client.dart @@ -79,7 +79,7 @@ class LoginApiClient { Future checkActivationCode(bool isDeviceNFC, String? mobileNumber, String activationCode, String? pUserName) async { String url = "${ApiConsts.erpRest}CheckActivationCode"; - Map postParams = {"isDeviceNFC": isDeviceNFC, "MobileNumber": mobileNumber, "activationCode": activationCode, "P_USER_NAME": pUserName}; + Map postParams = {"IsDeviceNFC": isDeviceNFC, "MobileNumber": mobileNumber, "activationCode": activationCode, "P_USER_NAME": pUserName}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); diff --git a/lib/api/monthlyAttendance_api_client.dart b/lib/api/monthlyAttendance_api_client.dart new file mode 100644 index 0000000..4f6aca7 --- /dev/null +++ b/lib/api/monthlyAttendance_api_client.dart @@ -0,0 +1,72 @@ + +import 'dart:async'; + +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart'; +import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; +import 'api_client.dart'; + +class MonthlyAttendanceApiClient { + static final MonthlyAttendanceApiClient _instance = MonthlyAttendanceApiClient._internal(); + + MonthlyAttendanceApiClient._internal(); + + factory MonthlyAttendanceApiClient() => _instance; + + + Future getTimeCardSummary(String month, int year) async { + String url = "${ApiConsts.erpRest}GET_TIME_CARD_SUMMARY"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + "SearchMonth": month, + "SearchYear": year, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return (responseData.getTimeCardSummaryList?.length ?? 0) > 0 ? responseData.getTimeCardSummaryList!.first : null; + }, url, postParams); + } + + Future> getDayHoursTypeDetails(String month, int year) async { + String url = "${ApiConsts.erpRest}GET_DAY_HOURS_TYPE_DETAILS"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_PAGE_LIMIT": 100, + "P_PAGE_NUM": 1, + "P_SELECTED_RESP_ID": -999, + "SearchMonth": month, + "SearchYear": year, + }; + postParams.addAll(AppState().postParamsJson); + // postParams["DeviceToken"] = deviceToken; + // postParams["DeviceType"] = deviceType; + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + print("Response Data______"); + print(responseData.getDayHoursTypeDetailsList!.length); + return responseData.getDayHoursTypeDetailsList ?? []; + }, url, postParams); + } + + + Future getScheduleShiftsDetails(int pRTPID) async { + String url = "${ApiConsts.erpRest}GET_SCHEDULE_SHIFTS_DETAILS"; + Map postParams = { + "P_PAGE_LIMIT": 10, + "P_PAGE_NUM": 1, + "P_RTP_ID": pRTPID, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return (responseData.getScheduleShiftsDetailsList?.length ?? 0) > 0 ? responseData.getScheduleShiftsDetailsList!.first : null; + }, url, postParams); + } + +} \ No newline at end of file diff --git a/lib/api/my_attendance_api_client.dart b/lib/api/my_attendance_api_client.dart new file mode 100644 index 0000000..f49aa1e --- /dev/null +++ b/lib/api/my_attendance_api_client.dart @@ -0,0 +1,57 @@ +import 'dart:async'; + +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/get_eit_transaction_list_model.dart'; + +import 'api_client.dart'; + +class MyAttendanceApiClient { + static final MyAttendanceApiClient _instance = MyAttendanceApiClient._internal(); + + MyAttendanceApiClient._internal(); + + factory MyAttendanceApiClient() => _instance; + + Future?> getEitTransaction(String pFunctionName) async { + String url = "${ApiConsts.erpRest}GET_EIT_TRANSACTIONS"; + Map postParams = {"P_PAGE_LIMIT": 50, "P_PAGE_NUM": 1, "P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_FUNCTION_NAME": pFunctionName}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getEITTransactionList ?? []; + }, url, postParams); + } + + Future getEitDffStructure(String pFunctionName) async { + String url = "${ApiConsts.erpRest}GET_EIT_DFF_STRUCTURE"; + Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_FUNCTION_NAME": pFunctionName}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData; + }, url, postParams); + } + + Future getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list) 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": null, + "P_SEGMENT_NAME": pSegmentName, + "P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode, + "P_DESC_FLEX_NAME": pDescFlexName, + "GetValueSetValuesTBL": list, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getValueSetValuesList!.first; + }, url, postParams); + } +} diff --git a/lib/api/profile_api_client.dart b/lib/api/profile_api_client.dart new file mode 100644 index 0000000..3e254b4 --- /dev/null +++ b/lib/api/profile_api_client.dart @@ -0,0 +1,135 @@ +import 'dart:async'; + +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_address_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; +import 'package:mohem_flutter_app/models/profile/phone_number_types_modek.dart'; +import 'api_client.dart'; + +class ProfileApiClient { + static final ProfileApiClient _instance = ProfileApiClient._internal(); + + ProfileApiClient._internal(); + + factory ProfileApiClient() => _instance; + + Future> getEmployeeContacts() async { + String url = "${ApiConsts.erpRest}GET_EMPLOYEE_CONTACTS"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getEmployeeContactsList ?? []; + }, url, postParams); + } + + Future> getEmployeeBasicDetails() async { + String url = "${ApiConsts.erpRest}GET_EMPLOYEE_BASIC_DETAILS"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getEmployeeBasicDetailsList ?? []; + }, url, postParams); + } + + Future> getEmployeePhones() async { + String url = "${ApiConsts.erpRest}GET_EMPLOYEE_PHONES"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getEmployeePhonesList ?? []; + }, url, postParams); + } + + Future> getEmployeeAddress() async { + String url = "${ApiConsts.erpRest}GET_EMPLOYEE_ADDRESS"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getEmployeeAddressList ?? []; + }, url, postParams); + } + + Future updateEmpImage(img) async { + String url = "${ApiConsts.erpRest}UPDATE_EMPLOYEE_IMAGE"; + Map postParams = {"P_MENU_TYPE": "E", "P_SELECTED_RESP_ID": -999, "P_IMAGE": img}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + // GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return json['UpdateEmployeeImageList']; + }, url, postParams); + } + + Future getDffStructure(String pFunctionName, String uRL, String requestType) async { + String url = ApiConsts.erpRest + uRL; + Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_FUNCTION_NAME": pFunctionName, "P_REQUEST_TYPE": requestType}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData; + }, url, postParams); + } + + Future getColStructure(String pFunctionName, String uRL, String requestType) async { + String url = ApiConsts.erpRest + uRL; + Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_FUNCTION_NAME": pFunctionName, "P_REQUEST_TYPE": requestType}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData; + }, url, postParams); + } + + Future getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list) 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": null, + "P_SEGMENT_NAME": pSegmentName, + "P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode, + "P_DESC_FLEX_NAME": pDescFlexName, + "GetValueSetValuesTBL": list, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getValueSetValuesList!.first; + }, url, postParams); + } + + Future> getPhoneNumberTypes() async { + String url = "${ApiConsts.erpRest}GET_OBJECT_VALUES"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getObjectValuesList ?? []; + }, url, postParams); + } +} diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index a473ba7..e696054 100644 --- a/lib/api/worklist/worklist_api_client.dart +++ b/lib/api/worklist/worklist_api_client.dart @@ -5,6 +5,21 @@ import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_absence_collection_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_action_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_attachement_list_model.dart'; +import 'package:mohem_flutter_app/models/get_item_creation_ntf_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_mo_Item_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_mo_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_notification_buttons_list_model.dart'; +import 'package:mohem_flutter_app/models/get_po_Item_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_quotation_analysis_list_model.dart'; +import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_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/worklist_response_model.dart'; class WorkListApiClient { @@ -29,7 +44,7 @@ class WorkListApiClient { }, url, postParams); } - Future GetITGTaskCountRequestType() async { + Future getITGTaskCountRequestType() async { String url = "${ApiConsts.cocRest}ITGGetTaskCountRequestType"; Map postParams = {}; postParams.addAll(AppState().postParamsJson); @@ -38,4 +53,246 @@ class WorkListApiClient { 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); + } + + 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); + } + + 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, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getActionHistoryList ?? []; + }, 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); + } + + 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); + } + + 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, + }; + postParams.addAll(AppState().postParamsJson); + 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, + }; + postParams.addAll(AppState().postParamsJson); + postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber; + 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, + }; + postParams.addAll(AppState().postParamsJson); + 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, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getStampNsNotificationBodyList ?? []; + }, url, postParams); + } + + Future> getAbsenceNotificationBody(int pNotificationID, int pTransactionID) async { + String url = "${ApiConsts.erpRest}GET_ABSENCE_NOTIFICATION_BODY"; + 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.getAbsenceCollectionNotificationBodyList ?? []; + }, url, postParams); + } + + 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); + } + + 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, + }; + postParams.addAll(AppState().postParamsJson); + 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, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPoNotificationBodyList; + }, 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, + }; + postParams.addAll(AppState().postParamsJson); + 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, + }; + postParams.addAll(AppState().postParamsJson); + 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, + }; + postParams.addAll(AppState().postParamsJson); + 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, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getItemCreationNtfBodyList; + }, url, postParams); + } + + Future getITGFormDetails(String requestType, int taskId, int itemId, String employeeNumber) async { + String url = "${ApiConsts.cocRest}ITGGetFormDetials"; + Map postParams = { + "RequestType": requestType, + "TaskID": taskId, + "ItemID": itemId, + "EmployeeNumber": "15153", + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, url, postParams); + } } diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 08d2f70..1b0e66d 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -1,8 +1,10 @@ import 'package:easy_localization/easy_localization.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/member_login_list_model.dart'; import 'package:mohem_flutter_app/models/post_params_model.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart'; +import 'package:mohem_flutter_app/models/worklist_response_model.dart'; class AppState { static final AppState _instance = AppState._internal(); @@ -11,6 +13,10 @@ class AppState { factory AppState() => _instance; + bool isAuthenticated = false; + + set setIsAuthenticated(v) => isAuthenticated = v; + bool isLogged = false; set setLogged(v) => isLogged = v; @@ -63,4 +69,20 @@ class AppState { List? get privilegeListModel => _privilegeListModel; set setPrivilegeListModel(List? _privilegeListModel) => this._privilegeListModel = _privilegeListModel; + + List? workList; + + set setWorkList(List? _workList) => workList = _workList; + + int? workListIndex; + + set setWorkListIndex(int? _workListIndex) => workListIndex = _workListIndex; + + List? requestAllList; + + set setRequestAllList(List? _requestAllList) => requestAllList = _requestAllList; + + int? itgWorkListIndex; + + set setItgWorkListIndex(int? _itgWorkListIndex) => itgWorkListIndex = _itgWorkListIndex; } diff --git a/lib/classes/colors.dart b/lib/classes/colors.dart index 0d80b05..5386adf 100644 --- a/lib/classes/colors.dart +++ b/lib/classes/colors.dart @@ -6,10 +6,11 @@ class MyColors { static const Color normalTextColor = Color(0xff5A5A5A); static const Color lightTextColor = Color(0xffBFBFBF); static const Color gradiantStartColor = Color(0xff33c0a5); - static const Color gradiantEndColor = Color(0xff259db7 ); + static const Color gradiantEndColor = Color(0xff259db7); static const Color textMixColor = Color(0xff2BB8A6); static const Color backgroundColor = Color(0xffF8F8F8); static const Color grey57Color = Color(0xff575757); + static const Color grey67Color = Color(0xff676767); static const Color grey77Color = Color(0xff777777); static const Color grey70Color = Color(0xff707070); static const Color greyACColor = Color(0xffACACAC); @@ -26,4 +27,15 @@ class MyColors { static const Color white = Color(0xffffffff); static const Color green = Color(0xffffffff); static const Color borderColor = Color(0xffE8E8E8); + // static const Color grey67Color = Color(0xff676767); + static const Color whiteColor = Color(0xFFEEEEEE); + static const Color greenColor = Color(0xff1FA269); + static const Color lightGreenColor = Color(0xff2AB2AB); + static const Color darkGreyColor = Color(0xff464646); + static const Color greyA5Color = Color(0xffA5A5A5); + static const Color blackColor = Color(0xff000014); + static const Color grey3AColor = Color(0xff2E303A); + static const Color darkColor = Color(0xff000015); + static const Color lightGrayColor = Color(0xff808080); + static const Color DarkRedColor = Color(0xffD02127); } diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index a95e5b4..e9e3c86 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -1,7 +1,7 @@ class ApiConsts { //static String baseUrl = "http://10.200.204.20:2801/"; // Local server static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server - // static String baseUrl = "https://hmgwebservices.com"; // Live server + //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 d0f4b1f..c350cb6 100644 --- a/lib/classes/date_uitl.dart +++ b/lib/classes/date_uitl.dart @@ -23,6 +23,10 @@ class DateUtil { return DateFormat("MM/dd/yyyy hh:mm:ss").parse(date); } + static DateTime convertSimpleStringDateToDateddMMyyyy(String date) { + return DateFormat("MM/dd/yyyy hh:mm:ss").parse(date); + } + static DateTime convertStringToDateNoTimeZone(String date) { // /Date(1585774800000+0300)/ if (date != null) { diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart index fc942c4..4393e8b 100644 --- a/lib/classes/utils.dart +++ b/lib/classes/utils.dart @@ -1,5 +1,10 @@ +import 'dart:convert'; +import 'dart:typed_data'; + import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; // import 'package:fluttertoast/fluttertoast.dart'; import 'package:mohem_flutter_app/exceptions/api_exception.dart'; @@ -68,7 +73,7 @@ class Utils { return await prefs.setString(key, value); } - static void handleException(dynamic exception, Function(String)? onErrorMessage) { + static void handleException(dynamic exception, cxt, Function(String)? onErrorMessage) { String errorMessage; if (exception is APIException) { if (exception.message == APIException.UNAUTHORIZED) { @@ -82,7 +87,19 @@ class Utils { if (onErrorMessage != null) { onErrorMessage(errorMessage); } else { - showToast(errorMessage); + if (!AppState().isAuthenticated) { + showDialog( + context: cxt, + builder: (cxt) => ConfirmDialog( + message: errorMessage, + onTap: () { + Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route route) => false); + }, + ), + ); + } else { + showToast(errorMessage); + } } } @@ -94,4 +111,21 @@ class Utils { ), ); } + + static getPostBytes(img) { + try { + var b64 = img.replaceFirst('data:image/png;base64,', ''); + if (img != null && Utils.isBase64(b64)) return Utils.dataFromBase64String(b64); + } catch (e) {} + return null; + } + + static bool isBase64(String str) { + RegExp _base64 = RegExp(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$'); + return _base64.hasMatch(str); + } + + static Uint8List dataFromBase64String(String base64String) { + return base64Decode(base64String); + } } diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 3eba985..e377b8a 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -6,8 +6,26 @@ import 'package:mohem_flutter_app/ui/login/login_screen.dart'; import 'package:mohem_flutter_app/ui/login/new_password_screen.dart'; import 'package:mohem_flutter_app/ui/login/verify_last_login_screen.dart'; import 'package:mohem_flutter_app/ui/login/verify_login_screen.dart'; -import 'package:mohem_flutter_app/ui/work_list/missing_swipe/missing_swipe_screen.dart'; +import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart'; +import 'package:mohem_flutter_app/ui/my_attendance/my_attendance_screen.dart'; +import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_profile_screen.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/profile/profile_screen.dart'; +import 'package:mohem_flutter_app/ui/screens/submenu_screen.dart'; +import 'package:mohem_flutter_app/ui/profile/family_members.dart'; +import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; +import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart'; +import 'package:mohem_flutter_app/ui/work_list/itg_detail_screen.dart'; +import 'package:mohem_flutter_app/ui/work_list/worklist_detail_screen.dart'; import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart'; +import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart'; +import 'package:mohem_flutter_app/ui/attendance/monthly_attendance.dart'; +import 'package:mohem_flutter_app/ui/profile/profile.dart'; +import 'package:mohem_flutter_app/ui/profile/personal_info.dart'; +import 'package:mohem_flutter_app/ui/profile/basic_details.dart'; +import 'package:mohem_flutter_app/ui/profile/contact_details.dart'; +import 'package:mohem_flutter_app/ui/profile/family_members.dart'; class AppRoutes { static const String splash = "/splash"; @@ -21,23 +39,76 @@ class AppRoutes { static const String loginVerification = "/loginVerification"; static const String dashboard = "/dashboard"; static const String todayAttendance = "/todayAttendance"; + static const String subMenuScreen = "/submenuScreen"; + static const String addEitScreen = "/addeitScreen"; static const String initialRoute = login; //Work List static const String workList = "/workList"; - static const String missingSwipe = "/missingSwipe"; + static const String workListDetail = "/workListDetail"; + static const String itgDetail = "/itgDetail"; + static const String itemHistory = "/itemHistory"; + + static const String myAttendance = "/myAttendance"; + static const String dynamicScreen = "/dynamicScreen"; + static const String addDynamicInput = "/addDynamicInput"; + + //profile + + static const String addDynamicInputProfile = 'addDynamicInputProfile'; + //Attendance + static const String attendance = "/attendance"; + static const String monthlyAttendance = "/monthlyAttendance"; + + //Bottom Sheet + static const String attendanceDetailsBottomSheet = "/attendanceDetailsBottomSheet"; + + //Profile + static const String profile = "/profile"; + static const String personalInfo = "/personalInfo"; + static const String basicDetails = "/basicDetails"; + static const String contactDetails = "/contactDetails"; + static const String familyMembers = "/familyMembers"; static final Map routes = { login: (context) => LoginScreen(), verifyLogin: (context) => VerifyLoginScreen(), verifyLastLogin: (context) => VerifyLastLoginScreen(), dashboard: (context) => DashboardScreen(), + + subMenuScreen: (context) => SubMenuScreen(), newPassword: (context) => NewPasswordScreen(), forgotPassword: (context) => ForgotPasswordScreen(), todayAttendance: (context) => TodayAttendanceScreen(), + //eit + + addEitScreen: (context) => AddEITScreen(), //Work List workList: (context) => WorkListScreen(), - missingSwipe: (context) => MissingSwipeScreen(), + workListDetail: (context) => WorkListDetailScreen(), + itgDetail: (context) => ItgDetailScreen(), + itemHistory: (context) => ItemHistoryScreen(), + + myAttendance: (context) => MyAttendanceScreen(), + // workFromHome: (context) => WorkFromHomeScreen(), + // addWorkFromHome: (context) => AddWorkFromHomeScreen(), + profile: (context) => ProfileScreen(), + //Attendance + monthlyAttendance: (context) => MonthlyAttendance(), + + //Bottom Sheet + attendanceDetailsBottomSheet: (context) => AttendenceDetailsBottomSheet(), + + //Profile + //profile: (context) => Profile(), + //profile: (context) => Profile(), + personalInfo: (context) => PesonalInfo(), + basicDetails: (context) => BasicDetails(), + contactDetails: (context) => ContactDetails(), + familyMembers: (context) => FamilyMembers(), + dynamicScreen: (context) => DynamicListViewScreen(), + addDynamicInput: (context) => DynamicInputScreen(), + addDynamicInputProfile: (context) => DynamicInputScreenProfile(), }; } diff --git a/lib/dialogs/otp_dialog.dart b/lib/dialogs/otp_dialog.dart index d82cf9c..3789980 100644 --- a/lib/dialogs/otp_dialog.dart +++ b/lib/dialogs/otp_dialog.dart @@ -226,3 +226,4 @@ class OtpDialog { // } } } + diff --git a/lib/extensions/int_extensions.dart b/lib/extensions/int_extensions.dart index 9b90b2f..215f8d9 100644 --- a/lib/extensions/int_extensions.dart +++ b/lib/extensions/int_extensions.dart @@ -4,4 +4,6 @@ extension IntExtensions on int { Widget get height => SizedBox(height: toDouble()); Widget get width => SizedBox(width: toDouble()); + + Widget get makeItSquare => SizedBox(width: toDouble(), height: toDouble()); } diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 2db6135..a953734 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -63,6 +63,10 @@ extension EmailValidator on String { this, style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); + Widget toText20({Color? color, bool isBold = false}) => Text( + this, + style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), + ); Widget toText22({Color? color, bool isBold = false}) => Text( this, @@ -79,6 +83,11 @@ extension EmailValidator on String { style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32, letterSpacing: -1.92, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); + Widget toText44({Color? color, bool isBold = false}) => Text( + this, + style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), + ); + Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) { String upper = ""; String lower = ""; diff --git a/lib/extensions/widget_extensions.dart b/lib/extensions/widget_extensions.dart index 5169f19..f511422 100644 --- a/lib/extensions/widget_extensions.dart +++ b/lib/extensions/widget_extensions.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:shimmer/shimmer.dart'; extension WidgetExtensions on Widget { @@ -36,4 +38,30 @@ extension WidgetExtensions on Widget { switchOutCurve: Curves.linearToEaseOut, child: this, ); + + Widget objectContainerView({String title = ""}) { + return Container( + padding: const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (title.isNotEmpty) title.toText16(), + if (title.isNotEmpty) 12.height, + this, + ], + ), + ); + } } diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index f4a2a6c..5e6c80e 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -6,193 +6,583 @@ import 'dart:ui'; import 'package:easy_localization/easy_localization.dart' show AssetLoader; -class CodegenLoader extends AssetLoader { +class CodegenLoader extends AssetLoader{ const CodegenLoader(); @override - Future> load(String fullPath, Locale locale) { + Future> load(String fullPath, Locale locale ) { return Future.value(mapLocales[locale.toString()]); } - static const Map ar_SA = { - "mohemm": "Mohemm", - "english": "English", - "arabic": "Arabic", - "login": "تسجيل الدخول", - "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", - "username": "اسم المستخدم", - "password": "كلمة المرور", - "welcomeBack": "مرحبا بعودتك", - "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", - "lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:", - "verificationType": "نوع التحقق:", - "pleaseVerify": "ارجوك تحقق", - "verifyThroughFace": "تحقق من خلال الوجه", - "verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع", - "verifyThroughSMS": "تحقق من خلال الرسائل القصيرة", - "verifyThroughWhatsapp": "تحقق من خلال Whatsapp", - "useAnotherAccount": "استخدم حسابا آخر", - "pleaseEnterTheVerificationCodeSentTo": "الرجاء إدخال رمز التحقق المرسل إلى ", - "theVerificationCodeWillExpireIn": "ستنتهي صلاحية رمز التحقق في ", - "goodMorning": "صباح الخير", - "markAttendance": "علامة الحضور", - "timeLeftToday": "الوقت المتبقي اليوم", - "checkIn": "تحقق في", - "workList": "قائمة العمل", - "leaveBalance": "رصيد الاجازات", - "missingSwipes": "الضربات الشديدة في عداد المفقودين", - "ticketBalance": "رصيد التذكرة", - "other": "آخر", - "services": "خدمات", - "viewAllServices": "عرض جميع الخدمات", - "monthlyAttendance": "الحضور الشهري", - "workFromHome": "العمل من المنزل", - "ticketRequest": "طلب تذكرة", - "viewAllOffers": "مشاهدة جميع العروض", - "offers": "عروض & ", - "discounts": "الخصومات", - "newString": "جديد", - "setTheNewPassword": "قم بتعيين كلمة المرور الجديدة", - "typeYourNewPasswordBelow": "اكتب كلمة المرور الجديدة أدناه", - "confirmPassword": "تأكيد كلمة المرور", - "update": "تحديث", - "title": "عنوان", - "home": "مسكن", - "mySalary": "راتبي", - "createRequest": "إنشاء طلب", - "forgotPassword": "هل نسيت كلمة السر", - "employeeId": "هوية الموظف", - "loginCodeWillSentToMobileNumber": "الرجاء إدخال معرف الموظف الخاص بك ، وسيتم إرسال رمز تسجيل الدخول إلى رقم هاتفك المحمول", - "changePassword": "تغيير كلمة المرور", - "ok": "موافق", - "confirm": "تؤكد", - "passwordChangedSuccessfully": "تم تغيير الرقم السري بنجاح", - "itemsForSale": "سلع للبيع", - "doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة", - "atLeastOneLowercase": "حرف صغير واحد على الأقل", - "atLeastOneUppercase": "حرف كبير واحد على الأقل", - "atLeastOneNumeric": "رقم واحد على الأقل", - "minimum8Characters": "8 أحرف على الأقل", - "doNotAddRepeatingLetters": "لا تقم بإضافة أحرف متكررة", - "itShouldContainSpecialCharacter": "يجب أن يحتوي على طابع خاص", - "confirmPasswordMustMatch": "يجب أن يتطابق تأكيد كلمة المرور", - "sms": "رسالة قصيرة", - "fingerPrint": "بصمة", - "face": "التعرف على الوجه", - "whatsapp": "واتس اب", - "msg": "Hello {} in the {} world ", - "msg_named": "{} are written in the {lang} language", - "clickMe": "Click me", - "human": "Human", - "resources": "Resources", - "profile": { - "reset_password": {"label": "Reset Password", "username": "Username", "password": "password"} + static const Map ar_SA = { + "mohemm": "Mohemm", + "english": "English", + "arabic": "Arabic", + "login": "تسجيل الدخول", + "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", + "username": "اسم المستخدم", + "password": "كلمة المرور", + "welcomeBack": "مرحبا بعودتك", + "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", + "lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:", + "verificationType": "نوع التحقق:", + "pleaseVerify": "ارجوك تحقق", + "verifyThroughFace": "تحقق من خلال الوجه", + "verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع", + "verifyThroughSMS": "تحقق من خلال الرسائل القصيرة", + "verifyThroughWhatsapp": "تحقق من خلال Whatsapp", + "useAnotherAccount": "استخدم حسابا آخر", + "pleaseEnterTheVerificationCodeSentTo": "الرجاء إدخال رمز التحقق المرسل إلى ", + "theVerificationCodeWillExpireIn": "ستنتهي صلاحية رمز التحقق في ", + "goodMorning": "صباح الخير", + "markAttendance": "علامة الحضور", + "timeLeftToday": "الوقت المتبقي اليوم", + "checkIn": "تحقق في", + "workList": "قائمة العمل", + "leaveBalance": "رصيد الاجازات", + "missingSwipes": "الضربات الشديدة في عداد المفقودين", + "ticketBalance": "رصيد التذكرة", + "other": "آخر", + "services": "خدمات", + "viewAllServices": "عرض جميع الخدمات", + "monthlyAttendance": "الحضور الشهري", + "workFromHome": "العمل من المنزل", + "ticketRequest": "طلب تذكرة", + "viewAllOffers": "مشاهدة جميع العروض", + "offers": "عروض & ", + "discounts": "الخصومات", + "newString": "جديد", + "setTheNewPassword": "قم بتعيين كلمة المرور الجديدة", + "typeYourNewPasswordBelow": "اكتب كلمة المرور الجديدة أدناه", + "confirmPassword": "تأكيد كلمة المرور", + "update": "تحديث", + "title": "عنوان", + "home": "مسكن", + "mySalary": "راتبي", + "createRequest": "إنشاء طلب", + "forgotPassword": "هل نسيت كلمة السر", + "employeeId": "هوية الموظف", + "loginCodeWillSentToMobileNumber": "الرجاء إدخال معرف الموظف الخاص بك ، وسيتم إرسال رمز تسجيل الدخول إلى رقم هاتفك المحمول", + "changePassword": "تغيير كلمة المرور", + "ok": "موافق", + "confirm": "تؤكد", + "passwordChangedSuccessfully": "تم تغيير الرقم السري بنجاح", + "itemsForSale": "سلع للبيع", + "attendanceDetails": "تفاصيل الحضور", + "order": "الطلبات", + "earlyOut": "الخروج مبكرا", + "shortage": "ساعات التقصير", + "excess": "Excess", + "lateIn": "القدوم المتاخر", + "approvedCheckOut": "وقت الخروج", + "approvedCheckIn": "وقت الدخول", + "actualCheckOut": "وقت الخروج", + "actualCheckIn": "وقت الدخول", + "present": "حضور", + "pres": "حضور", + "shiftTime": "وقت التناوب", + "absent": "غياب", + "attendance": "الحضور", + "scheduleDays": "ايام العمل", + "offDays": "ايام الراحه", + "nonAnalyzed": "لايوجد تحليل", + "shortageHour": "ساعات التقصير", + "stats": "الحاله", + "completed": "تم اكمال", + "msg": "Hello {} in the {} world ", + "msg_named": "{} are written in the {lang} language", + "clickMe": "Click me", + "doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة", + "atLeastOneLowercase": "حرف صغير واحد على الأقل", + "atLeastOneUppercase": "حرف كبير واحد على الأقل", + "atLeastOneNumeric": "رقم واحد على الأقل", + "minimum8Characters": "8 أحرف على الأقل", + "doNotAddRepeatingLetters": "لا تقم بإضافة أحرف متكررة", + "itShouldContainSpecialCharacter": "يجب أن يحتوي على طابع خاص", + "confirmPasswordMustMatch": "يجب أن يتطابق تأكيد كلمة المرور", + "sms": "رسالة قصيرة", + "fingerPrint": "بصمة", + "face": "التعرف على الوجه", + "whatsapp": "واتس اب", + "reject": "يرفض", + "approve": "يوافق", + "cancel": "إلغاء", + "requestedItems": "العناصر المطلوبة", + "request": "طلب", + "actions": "أجراءات", + "delegate": "مندوب", + "request_info": "اطلب معلومات", + "attachments": "المرفقات", + "info": "معلومات", + "employeeNumber": "رقم الموظف", + "assignmentNumber": "رقم الواجب", + "employeeName": "اسم الموظف", + "scheduleDate": "تاريخ الجدول الزمني", + "shiftType": "نوع التحول", + "shift": "يحول", + "breakText": "استراحة", + "actualSwipeStart": "بدء التمرير الفعلي", + "actualSwipeEnd": "التمرير الفعلي للنهاية", + "approvedSwipeStart": "وافق انتقاد البدء", + "approvedSwipeStartReason": "تمت الموافقة على سبب بدء التمرير السريع", + "approvedSwipeEnd": "تمت الموافقة على تمرير النهاية", + "approvedSwipeEndReason": "الموافقة على سبب إنهاء التمرير", + "from": "من", + "to": "ل", + "sent": "أرسلت", + "closed": "مغلق", + "id": "هوية شخصية", + "responder": "المستجيب", + "jobTitle": "عنوان وظيفي", + "grade": "درجة", + "jobCategory": "تصنيف الوظيفة", + "category": "فئة", + "employeeEmailAddress": "عنوان البريد الإلكتروني للموظف", + "payrollBranch": "فرع الرواتب", + "yourChangeHasBeenSavedSuccessfully": "تم حفظ التغيير الخاص بك بنجاح", + "code": "شفرة", + "unit": "وحدة", + "quantity": "كمية", + "dateRequired": "التاريخ مطلوب", + "lineStatus": "حالة الخط", + "statusDate": "تاريخ الحالة", + "transactionType": "نوع المعاملة", + "operatingUnit": "وحدة التشغيل", + "organizationCode": "كود المنظمة", + "organization": "منظمة", + "fromSubInventory": "من الجرد الفرعي", + "fromLocator": "من محدد المواقع", + "toSubInventory": "إلى الجرد الفرعي", + "toLocator": "إلى محدد المواقع", + "shipToLocator": "شحن إلى محدد المواقع", + "itemHistory": "تاريخ العنصر", + "mfg": "مبدع", + "lineType": "نوع الخط", + "price": "السعر", + "lineAmount": "مبلغ الخط", + "lineDiscount": "خصم الخط٪", + "needByDate": "القادمة إلى الأمام", + "promisedDate": "التسجيل وعد", + "deliverToLocation": "تسليم إلى الموقع", + "requisitionNumber": "رقم الطلب", + "requester": "مقدم الطلب", + "quotationAnalysis": "تحليل الاقتباس", + "subject": "موضوعات", + "description": "وصف", + "supplier": "المورد", + "site": "موقع", + "buyer": "مشتر", + "preparer": "معد", + "creationDate": "تاريخ الإنشاء", + "shipToLocation": "الشحن الى الموقع", + "quotationNumber": "رقم الإقتباس", + "quotationDate": "تاريخ الاقتباس", + "paymentTerms": "شروط الدفع", + "currency": "عملة", + "grossAmount": "المبلغ الإجمالي", + "discountAmount": "مقدار الخصم", + "customDuty": "الرسوم الجمركية", + "shipHandle": "مقبض السفينة", + "otherCharges": "رسوم أخرى", + "totalPOAmountWithVAT": "إجمالي مبلغ الشراء مع ضريبة القيمة المضافة", + "totalPOAmountInWords": "إجمالي مبلغ أمر الشراء بالكلمات", + "requestNumber": "رقم الطلب", + "uom": "UOM", + "operatingCode": "كود التشغيل", + "poNumber": "PO عدد", + "revision": "مراجعة", + "quantityOrdered": "الكمية المطلوبة", + "quantityReceived": "الكمية المستلمة", + "bonusQuantity": "كمية المكافأة", + "purchasePrice": "سعر الشراء", + "discountPer": "خصم ٪", + "balanceQuantity": "كمية التوازن", + "netPrice": "السعر الصافي", + "closureStatus": "حالة الإغلاق", + "quotationNetPrice": "صافي سعر الاقتباس", + "quotationUOM": "اقتباس UOM", + "quotationQty": "اقتباس الكمية", + "itemCode": "رمز الصنف", + "vendorName": "اسم البائع", + "quotationMFGPartNumber": "رقم الجزء MFG الاقتباس", + "quotationDeliveryDate": "تاريخ تسليم عرض الأسعار", + "quotationBonusQuantity": "كمية مكافأة الاقتباس", + "quotationLineTotal": "مجموع خط الاقتباس", + "rfqUOM": "RFQ UOM", + "rfqQty": "RFQ الكمية", + "rfqNumber": "رقم RFQ", + "human": "بشري", + "resources": "موارد", + "details": "تفاصيل", + "noDataAvailable": "لا تتوافر بيانات", + "productName": "اسم المنتج", + "productDescription": "وصف المنتج", + "unitPrice": "سعر الوحده", + "manufacturerName": "اسم المصنع", + "manufacturerPartName": "اسم جزء الشركة المصنعة", + "supplierName": "اسم المورد", + "supplierContact": "الاتصال بالمورد", + "chargeToPatient": "المسؤول عن المريض", + "justification": "التبرير", + "itemDescription": "وصف السلعة", + "groupCode": "كود المجموعة", + "primaryUOM": "UOM الابتدائية", + "subgroupDescription": "وصف المجموعة الفرعية", + "subgroupCode": "رمز المجموعة الفرعية", + "groupDescription": "وصف المجموعة", + "templateName": "اسم القالب", + "itemCreationStatus": "حالة إنشاء العنصر", + "standardizationApprovalStatus": "حالة الموافقة على التقييس", + "standardizationApprovalRejectionReason": "سبب رفض الموافقة على التقييس", + "analyzedBy": "تحليل بواسطة", + "approvedDate": "تاريخ الموافقة", + "itemType": "نوع العنصر", + "relatedTo": "متعلق ب", + "requestDate": "تاريخ الطلب", + "analyzedDate": "تاريخ التحليل", + "urgent": "العاجلة", + "requestDetails": "طلب تفاصيل", + "approvalLevel": "مستوى الموافقة", + "requesterDetails": "تفاصيل مقدم الطلب", + "myAttendance": "حضوري", + "workOnBreak": "العمل على استراحة", + "next": "التالي", + "completingYear": "نحن نقدر لك لاستكمال خدمة", + "year": "سنة", + "month": "شهر", + "day": "يوم", + "address": "العنوان", + "phoneNumber": "رقم الجوال", + "businessGroup": "مجموعة العمل", + "Payroll": "الراتب", + "civilIdentityNumber": "رقم الهويه", + "dateOfBirth": "تاريخ الميلاد", + "maritalStatus ": "الحالة الاجتماعية", + "fullName": "الأسم الكامل", + "remove": "حذف", + "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!" + "profileCompletionPer": "استكمال الملف الشخصي", + "completeProfile": "الملف الشخصي الكامل", + "personalInformation": "معلومات شخصية", + "basicDetails": "تفاصيل أساسية", + "contactDetails": "بيانات التواصل", + "familyDetails": "تفاصيل عائلية" + }, + "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!" + }, + "amount": { + "zero": "Your amount : {} ", + "one": "Your amount : {} ", + "two": "Your amount : {} ", + "few": "Your amount : {} ", + "many": "Your amount : {} ", + "other": "Your amount : {} " + }, + "gender": { + "male": "Hi man ;) ", + "female": "Hello girl :)", + "with_arg": { + "male": "Hi man ;) {}", + "female": "Hello girl :) {}" + } + }, + "reset_locale": "Reset Language" +}; +static const Map en_US = { + "mohemm": "Mohemm", + "english": "English", + "arabic": "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", + "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", + "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", + "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 11", + "pres": "present", + "shiftTime": "Shift Time", + "absent": "ABSENT 10", + "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 contain special character", + "confirmPasswordMustMatch": "Confirm password must match", + "sms": "SMS", + "fingerPrint": "Fingerprint", + "face": "Face", + "whatsapp": "Whatsapp", + "reject": "Reject", + "approve": "Approve", + "cancel": "Cancel", + "requestedItems": "Requested Items", + "request": "Request", + "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", + "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", + "profile": { + "reset_password": { + "label": "Reset Password", + "username": "Username", + "password": "password" }, - "amount": {"zero": "Your amount : {} ", "one": "Your amount : {} ", "two": "Your amount : {} ", "few": "Your amount : {} ", "many": "Your amount : {} ", "other": "Your amount : {} "}, - "gender": { - "male": "Hi man ;) ", - "female": "Hello girl :)", - "with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"} - }, - "reset_locale": "Reset Language" - }; - static const Map en_US = { - "mohemm": "Mohemm", - "english": "English", - "arabic": "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", - "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", - "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", - "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", - "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 contain special character", - "confirmPasswordMustMatch": "Confirm password must match", - "sms": "SMS", - "fingerPrint": "Fingerprint", - "face": "Face", - "whatsapp": "Whatsapp", - "msg": "Hello {} in the {} world ", - "msg_named": "{} are written in the {lang} language", - "clickMe": "Click me", - "human": "Human", - "resources": "Resources", - "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!" - }, - "amount": {"zero": "Your amount : {} ", "one": "Your amount : {} ", "two": "Your amount : {} ", "few": "Your amount : {} ", "many": "Your amount : {} ", "other": "Your amount : {} "}, - "gender": { - "male": "Hi man ;) ", - "female": "Hello girl :)", - "with_arg": {"male": "Hi man ;) {}", "female": "Hello girl :) {}"} - }, - "reset_locale": "Reset Language" - }; - static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; + "profileCompletionPer": "Profile Completion", + "completeProfile": "Complete Profile", + "personalInformation": "Personal Information", + "basicDetails": "Basic Details", + "contactDetails": "Contact Details", + "familyDetails": "Family Members" + }, + "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!" + }, + "amount": { + "zero": "Your amount : {} ", + "one": "Your amount : {} ", + "two": "Your amount : {} ", + "few": "Your amount : {} ", + "many": "Your amount : {} ", + "other": "Your amount : {} " + }, + "gender": { + "male": "Hi man ;) ", + "female": "Hello girl :)", + "with_arg": { + "male": "Hi man ;) {}", + "female": "Hello girl :) {}" + } + }, + "reset_locale": "Reset Language" +}; +static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 55e543b..230e45b 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1,6 +1,6 @@ // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart -abstract class LocaleKeys { +abstract class LocaleKeys { static const mohemm = 'mohemm'; static const english = 'english'; static const arabic = 'arabic'; @@ -53,6 +53,30 @@ abstract class LocaleKeys { static const confirm = 'confirm'; static const passwordChangedSuccessfully = 'passwordChangedSuccessfully'; static const itemsForSale = 'itemsForSale'; + static const attendanceDetails = 'attendanceDetails'; + static const order = 'order'; + static const earlyOut = 'earlyOut'; + static const shortage = 'shortage'; + static const excess = 'excess'; + static const lateIn = 'lateIn'; + static const approvedCheckOut = 'approvedCheckOut'; + static const approvedCheckIn = 'approvedCheckIn'; + static const actualCheckOut = 'actualCheckOut'; + static const actualCheckIn = 'actualCheckIn'; + static const present = 'present'; + static const pres = 'pres'; + static const shiftTime = 'shiftTime'; + static const absent = 'absent'; + static const attendance = 'attendance'; + static const scheduleDays = 'scheduleDays'; + static const offDays = 'offDays'; + static const nonAnalyzed = 'nonAnalyzed'; + static const shortageHour = 'shortageHour'; + static const stats = 'stats'; + static const completed = 'completed'; + static const msg = 'msg'; + static const msg_named = 'msg_named'; + static const clickMe = 'clickMe'; static const doNotUseRecentPassword = 'doNotUseRecentPassword'; static const atLeastOneLowercase = 'atLeastOneLowercase'; static const atLeastOneUppercase = 'atLeastOneUppercase'; @@ -65,22 +89,177 @@ abstract class LocaleKeys { static const fingerPrint = 'fingerPrint'; static const face = 'face'; static const whatsapp = 'whatsapp'; - static const msg = 'msg'; - static const msg_named = 'msg_named'; - static const clickMe = 'clickMe'; + static const reject = 'reject'; + static const approve = 'approve'; + static const cancel = 'cancel'; + static const requestedItems = 'requestedItems'; + static const request = 'request'; + static const actions = 'actions'; + static const delegate = 'delegate'; + static const request_info = 'request_info'; + static const attachments = 'attachments'; + static const info = 'info'; + static const employeeNumber = 'employeeNumber'; + static const assignmentNumber = 'assignmentNumber'; + static const employeeName = 'employeeName'; + static const scheduleDate = 'scheduleDate'; + static const shiftType = 'shiftType'; + static const shift = 'shift'; + static const breakText = 'breakText'; + static const actualSwipeStart = 'actualSwipeStart'; + static const actualSwipeEnd = 'actualSwipeEnd'; + static const approvedSwipeStart = 'approvedSwipeStart'; + static const approvedSwipeStartReason = 'approvedSwipeStartReason'; + static const approvedSwipeEnd = 'approvedSwipeEnd'; + static const approvedSwipeEndReason = 'approvedSwipeEndReason'; + static const from = 'from'; + static const to = 'to'; + static const sent = 'sent'; + static const closed = 'closed'; + static const id = 'id'; + static const responder = 'responder'; + static const jobTitle = 'jobTitle'; + static const grade = 'grade'; + static const jobCategory = 'jobCategory'; + static const category = 'category'; + static const employeeEmailAddress = 'employeeEmailAddress'; + static const payrollBranch = 'payrollBranch'; + static const yourChangeHasBeenSavedSuccessfully = 'yourChangeHasBeenSavedSuccessfully'; + static const code = 'code'; + static const unit = 'unit'; + static const quantity = 'quantity'; + static const dateRequired = 'dateRequired'; + static const lineStatus = 'lineStatus'; + static const statusDate = 'statusDate'; + static const transactionType = 'transactionType'; + static const operatingUnit = 'operatingUnit'; + static const organizationCode = 'organizationCode'; + static const organization = 'organization'; + static const fromSubInventory = 'fromSubInventory'; + static const fromLocator = 'fromLocator'; + static const toSubInventory = 'toSubInventory'; + static const toLocator = 'toLocator'; + static const shipToLocator = 'shipToLocator'; + static const itemHistory = 'itemHistory'; + static const mfg = 'mfg'; + static const lineType = 'lineType'; + static const price = 'price'; + static const lineAmount = 'lineAmount'; + static const lineDiscount = 'lineDiscount'; + static const needByDate = 'needByDate'; + static const promisedDate = 'promisedDate'; + static const deliverToLocation = 'deliverToLocation'; + static const requisitionNumber = 'requisitionNumber'; + static const requester = 'requester'; + static const quotationAnalysis = 'quotationAnalysis'; + static const subject = 'subject'; + static const description = 'description'; + static const supplier = 'supplier'; + static const site = 'site'; + static const buyer = 'buyer'; + static const preparer = 'preparer'; + static const creationDate = 'creationDate'; + static const shipToLocation = 'shipToLocation'; + static const quotationNumber = 'quotationNumber'; + static const quotationDate = 'quotationDate'; + static const paymentTerms = 'paymentTerms'; + static const currency = 'currency'; + static const grossAmount = 'grossAmount'; + static const discountAmount = 'discountAmount'; + static const customDuty = 'customDuty'; + static const shipHandle = 'shipHandle'; + static const otherCharges = 'otherCharges'; + static const totalPOAmountWithVAT = 'totalPOAmountWithVAT'; + static const totalPOAmountInWords = 'totalPOAmountInWords'; + static const requestNumber = 'requestNumber'; + static const uom = 'uom'; + static const operatingCode = 'operatingCode'; + static const poNumber = 'poNumber'; + static const revision = 'revision'; + static const quantityOrdered = 'quantityOrdered'; + static const quantityReceived = 'quantityReceived'; + static const bonusQuantity = 'bonusQuantity'; + static const purchasePrice = 'purchasePrice'; + static const discountPer = 'discountPer'; + static const balanceQuantity = 'balanceQuantity'; + static const netPrice = 'netPrice'; + static const closureStatus = 'closureStatus'; + static const quotationNetPrice = 'quotationNetPrice'; + static const quotationUOM = 'quotationUOM'; + static const quotationQty = 'quotationQty'; + static const itemCode = 'itemCode'; + static const vendorName = 'vendorName'; + static const quotationMFGPartNumber = 'quotationMFGPartNumber'; + static const quotationDeliveryDate = 'quotationDeliveryDate'; + static const quotationBonusQuantity = 'quotationBonusQuantity'; + static const quotationLineTotal = 'quotationLineTotal'; + static const rfqUOM = 'rfqUOM'; + static const rfqQty = 'rfqQty'; + static const rfqNumber = 'rfqNumber'; static const human = 'human'; static const resources = 'resources'; static const details = 'details'; - static const reject = 'reject'; - static const approve = 'approve'; + static const noDataAvailable = 'noDataAvailable'; + static const productName = 'productName'; + static const productDescription = 'productDescription'; + static const unitPrice = 'unitPrice'; + static const manufacturerName = 'manufacturerName'; + static const manufacturerPartName = 'manufacturerPartName'; + static const supplierName = 'supplierName'; + static const supplierContact = 'supplierContact'; + static const chargeToPatient = 'chargeToPatient'; + static const justification = 'justification'; + static const itemDescription = 'itemDescription'; + static const groupCode = 'groupCode'; + static const primaryUOM = 'primaryUOM'; + static const subgroupDescription = 'subgroupDescription'; + static const subgroupCode = 'subgroupCode'; + static const groupDescription = 'groupDescription'; + static const templateName = 'templateName'; + static const itemCreationStatus = 'itemCreationStatus'; + static const standardizationApprovalStatus = 'standardizationApprovalStatus'; + static const standardizationApprovalRejectionReason = 'standardizationApprovalRejectionReason'; + static const analyzedBy = 'analyzedBy'; + static const approvedDate = 'approvedDate'; + static const itemType = 'itemType'; + static const relatedTo = 'relatedTo'; + static const requestDate = 'requestDate'; + static const analyzedDate = 'analyzedDate'; + static const urgent = 'urgent'; + static const requestDetails = 'requestDetails'; + static const approvalLevel = 'approvalLevel'; + static const requesterDetails = 'requesterDetails'; + static const myAttendance = 'myAttendance'; + static const workOnBreak = 'workOnBreak'; + static const next = 'next'; + static const completingYear = 'completingYear'; + static const year = 'year'; + static const month = 'month'; + static const day = 'day'; + static const address = 'address'; + static const phoneNumber = 'phoneNumber'; + static const businessGroup = 'businessGroup'; + static const Payroll = 'Payroll'; + static const civilIdentityNumber = 'civilIdentityNumber'; + static const dateOfBirth = 'dateOfBirth'; + static const maritalStatus = 'maritalStatus '; + static const fullName = 'fullName'; + static const remove = 'remove'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; static const profile_reset_password = 'profile.reset_password'; + static const profile_profileCompletionPer = 'profile.profileCompletionPer'; + static const profile_completeProfile = 'profile.completeProfile'; + static const profile_personalInformation = 'profile.personalInformation'; + static const profile_basicDetails = 'profile.basicDetails'; + static const profile_contactDetails = 'profile.contactDetails'; + static const profile_familyDetails = 'profile.familyDetails'; static const profile = 'profile'; static const clicked = 'clicked'; static const amount = 'amount'; static const gender_with_arg = 'gender.with_arg'; static const gender = 'gender'; static const reset_locale = 'reset_locale'; + } diff --git a/lib/main.dart b/lib/main.dart index 29a8e17..9952762 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,6 +8,7 @@ import 'package:mohem_flutter_app/config/app_provider.dart'; import 'package:mohem_flutter_app/generated/codegen_loader.g.dart'; import 'package:mohem_flutter_app/models/post_params_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; +import 'package:mohem_flutter_app/provider/eit_provider_model.dart'; import 'package:mohem_flutter_app/theme/app_theme.dart'; import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.dart'; import 'package:nfc_manager/nfc_manager.dart'; @@ -42,6 +43,7 @@ Future main() async { child: MultiProvider( providers: [ ChangeNotifierProvider(create: (_) => DashboardProviderModel()), + ChangeNotifierProvider(create: (_) => EITProviderModel()), ], child: MyApp(), ), diff --git a/lib/models/dashboard/get_open_missing_swipes_list_model.dart b/lib/models/dashboard/get_open_missing_swipes_list_model.dart index 86ac6a9..8554637 100644 --- a/lib/models/dashboard/get_open_missing_swipes_list_model.dart +++ b/lib/models/dashboard/get_open_missing_swipes_list_model.dart @@ -1,4 +1,3 @@ - class GetOpenMissingSwipesList { GetOpenMissingSwipesList({ this.pOpenMissingSwipes, diff --git a/lib/models/dashboard/itg_forms_model.dart b/lib/models/dashboard/itg_forms_model.dart index 5ed719b..ae67ef8 100644 --- a/lib/models/dashboard/itg_forms_model.dart +++ b/lib/models/dashboard/itg_forms_model.dart @@ -4,6 +4,9 @@ import 'dart:convert'; +import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/request_type_model.dart'; + ItgFormsModel itgFormsModelFromMap(String str) => ItgFormsModel.fromJson(json.decode(str)); String itgFormsModelToMap(ItgFormsModel data) => json.encode(data.toMap()); @@ -80,7 +83,7 @@ class ItgFormsModel { String? successMsg; dynamic successMsgN; dynamic vidaUpdatedResponse; - dynamic itgRequest; + ITGRequest? itgRequest; dynamic itgFormAttachmentsList; String? message; dynamic mohemmItgDepartmentSectionsList; @@ -124,7 +127,7 @@ class ItgFormsModel { successMsg: json["SuccessMsg"] == null ? null : json["SuccessMsg"], successMsgN: json["SuccessMsgN"], vidaUpdatedResponse: json["VidaUpdatedResponse"], - itgRequest: json["ITGRequest"], + itgRequest: json['ITGRequest'] != null ? ITGRequest.fromJson(json['ITGRequest']) : null, itgFormAttachmentsList: json["Itg_FormAttachmentsList"], message: json["Message"] == null ? null : json["Message"], mohemmItgDepartmentSectionsList: json["Mohemm_ITG_DepartmentSectionsList"], @@ -169,7 +172,7 @@ class ItgFormsModel { "SuccessMsg": successMsg == null ? null : successMsg, "SuccessMsgN": successMsgN, "VidaUpdatedResponse": vidaUpdatedResponse, - "ITGRequest": itgRequest, + "ITGRequest": itgRequest == null ? null : itgRequest!.toJson(), "Itg_FormAttachmentsList": itgFormAttachmentsList, "Message": message == null ? null : message, "Mohemm_ITG_DepartmentSectionsList": mohemmItgDepartmentSectionsList, @@ -187,69 +190,3 @@ class ItgFormsModel { "statuseCode": statuseCode == null ? null : statuseCode, }; } - -class RequestType { - int? itemCount; - List? requestDetails; - String? requestTypeCode; - String? requestTypeName; - - RequestType({this.itemCount, this.requestDetails, this.requestTypeCode, this.requestTypeName}); - - RequestType.fromJson(Map json) { - itemCount = json['ItemCount']; - if (json['RequestDetails'] != null) { - requestDetails = []; - json['RequestDetails'].forEach((v) { - requestDetails!.add(new RequestDetails.fromJson(v)); - }); - } - requestTypeCode = json['RequestTypeCode']; - requestTypeName = json['RequestTypeName']; - } - - Map toJson() { - final Map data = new Map(); - data['ItemCount'] = this.itemCount; - if (this.requestDetails != null) { - data['RequestDetails'] = this.requestDetails!.map((v) => v.toJson()).toList(); - } - data['RequestTypeCode'] = this.requestTypeCode; - data['RequestTypeName'] = this.requestTypeName; - return data; - } -} - -class RequestDetails { - int? iD; - int? itemID; - String? listID; - String? listName; - String? modifiedDate; - String? title; - String? uRL; - - RequestDetails({this.iD, this.itemID, this.listID, this.listName, this.modifiedDate, this.title, this.uRL}); - - RequestDetails.fromJson(Map json) { - iD = json['ID']; - itemID = json['ItemID']; - listID = json['ListID']; - listName = json['ListName']; - modifiedDate = json['ModifiedDate']; - title = json['Title']; - uRL = json['URL']; - } - - Map toJson() { - final Map data = new Map(); - data['ID'] = this.iD; - data['ItemID'] = this.itemID; - data['ListID'] = this.listID; - data['ListName'] = this.listName; - data['ModifiedDate'] = this.modifiedDate; - data['Title'] = this.title; - data['URL'] = this.uRL; - return data; - } -} diff --git a/lib/models/dyanmic_forms/get_set_values_request_model.dart b/lib/models/dyanmic_forms/get_set_values_request_model.dart new file mode 100644 index 0000000..82bc05a --- /dev/null +++ b/lib/models/dyanmic_forms/get_set_values_request_model.dart @@ -0,0 +1,32 @@ +class GetSetValuesRequestModel { + String? sEGMENTNAME; + String? vALUECOLUMNNAME; + String? dESCRIPTION; + String? iDCOLUMNNAME; + String? fLEXVALUESETNAME; + + GetSetValuesRequestModel( + {this.sEGMENTNAME, + this.vALUECOLUMNNAME, + this.dESCRIPTION, + this.iDCOLUMNNAME, + this.fLEXVALUESETNAME}); + + GetSetValuesRequestModel.fromJson(Map json) { + sEGMENTNAME = json['SEGMENT_NAME']; + vALUECOLUMNNAME = json['VALUE_COLUMN_NAME']; + dESCRIPTION = json['DESCRIPTION']; + iDCOLUMNNAME = json['ID_COLUMN_NAME']; + fLEXVALUESETNAME = json['FLEX_VALUE_SET_NAME']; + } + + Map toJson() { + final Map data = new Map(); + data['SEGMENT_NAME'] = this.sEGMENTNAME; + data['VALUE_COLUMN_NAME'] = this.vALUECOLUMNNAME; + data['DESCRIPTION'] = this.dESCRIPTION; + data['ID_COLUMN_NAME'] = this.iDCOLUMNNAME; + data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME; + return data; + } +} diff --git a/lib/models/eit/get_eit_transaction_model.dart b/lib/models/eit/get_eit_transaction_model.dart new file mode 100644 index 0000000..186ef9c --- /dev/null +++ b/lib/models/eit/get_eit_transaction_model.dart @@ -0,0 +1,103 @@ +class GET_EIT_Transactions_Model { + List? collectionTransaction; + + GET_EIT_Transactions_Model({this.collectionTransaction}); + + GET_EIT_Transactions_Model.fromJson(Map json) { + if (json['Collection_Transaction'] != null) { + collectionTransaction = []; + json['Collection_Transaction'].forEach((v) { + collectionTransaction!.add(new CollectionTransaction.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.collectionTransaction != null) { + data['Collection_Transaction'] = this.collectionTransaction!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class CollectionTransaction { + String? aPPLICATIONCOLUMNNAME; + String? dATATYPE; + String? dATEVALUE; + String? dESCFLEXCONTEXTCODE; + String? dESCFLEXNAME; + String? dISPLAYFLAG; + int? fROMROWNUM; + int? nOOFROWS; + dynamic? nUMBERVALUE; + int? rOWNUM; + String? sEGMENTNAME; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? sEGMENTVALUEDSP; + int? tOROWNUM; + int? tRANSACTIONNUMBER; + String? vARCHAR2VALUE; + + 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}); + + CollectionTransaction.fromJson(Map json) { + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + dATATYPE = json['DATATYPE']; + dATEVALUE = json['DATE_VALUE']; + dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE']; + dESCFLEXNAME = json['DESC_FLEX_NAME']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + fROMROWNUM = json['FROM_ROW_NUM']; + nOOFROWS = json['NO_OF_ROWS']; + nUMBERVALUE = json['NUMBER_VALUE']; + rOWNUM = json['ROW_NUM']; + sEGMENTNAME = json['SEGMENT_NAME']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + sEGMENTVALUEDSP = json['SEGMENT_VALUE_DSP']; + tOROWNUM = json['TO_ROW_NUM']; + tRANSACTIONNUMBER = json['TRANSACTION_NUMBER']; + vARCHAR2VALUE = json['VARCHAR2_VALUE']; + } + + Map toJson() { + final Map data = new Map(); + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['DATATYPE'] = this.dATATYPE; + data['DATE_VALUE'] = this.dATEVALUE; + data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE; + data['DESC_FLEX_NAME'] = this.dESCFLEXNAME; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['NUMBER_VALUE'] = this.nUMBERVALUE; + data['ROW_NUM'] = this.rOWNUM; + data['SEGMENT_NAME'] = this.sEGMENTNAME; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['SEGMENT_VALUE_DSP'] = this.sEGMENTVALUEDSP; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['TRANSACTION_NUMBER'] = this.tRANSACTIONNUMBER; + data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE; + return data; + } +} diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 0b5c497..fa65b1f 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -1,14 +1,42 @@ +import 'package:mohem_flutter_app/models/get_absence_collection_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_action_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_attachement_list_model.dart'; +import 'package:mohem_flutter_app/models/get_basic_det_ntf_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/get_eit_transaction_list_model.dart'; +import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_address_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; +import 'package:mohem_flutter_app/models/get_item_creation_ntf_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_mo_Item_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_mo_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_notification_buttons_list_model.dart'; +import 'package:mohem_flutter_app/models/get_po_Item_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_quotation_analysis_list_model.dart'; +import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/models/member_login_list_model.dart'; +import 'package:mohem_flutter_app/models/notification_action_model.dart'; +import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart'; +import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; +import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; +import 'package:mohem_flutter_app/models/profile/phone_number_types_modek.dart'; +import 'package:mohem_flutter_app/models/subordinates_on_leaves_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'basic_member_information_model.dart'; -import 'get_mobile_login_info_list_model.dart'; import 'dashboard/get_accrual_balances_list_model.dart'; import 'dashboard/get_attendance_tracking_list_model.dart'; import 'dashboard/get_open_missing_swipes_list_model.dart'; import 'dashboard/get_open_notifications_list.dart'; import 'dashboard/list_menu.dart'; import 'dashboard/menu_entries.dart'; +import 'get_mobile_login_info_list_model.dart'; import 'member_information_list_model.dart'; import 'privilege_list_model.dart'; @@ -62,19 +90,19 @@ class GenericResponseModel { String? forgetPasswordTokenID; List? getAbsenceAttachmentsList; List? getAbsenceAttendanceTypesList; - List? getAbsenceCollectionNotificationBodyList; + List? getAbsenceCollectionNotificationBodyList; List? getAbsenceDffStructureList; List? getAbsenceTransactionList; List? getAccrualBalancesList; - List? getActionHistoryList; + List? getActionHistoryList; List? getAddressDffStructureList; List? getAddressNotificationBodyList; List? getApprovesList; - List? getAttachementList; + List? getAttachementList; GetAttendanceTracking? getAttendanceTrackingList; - List? getBasicDetColsStructureList; - List? getBasicDetDffStructureList; - List? getBasicDetNtfBodyList; + List? getBasicDetColsStructureList; + List? getBasicDetDffStructureList; + List? getBasicDetNtfBodyList; List? getCEICollectionNotificationBodyList; List? getCEIDFFStructureList; List? getCEITransactionList; @@ -88,31 +116,31 @@ class GenericResponseModel { List? getContactDffStructureList; List? getContactNotificationBodyList; List? getCountriesList; - List? getDayHoursTypeDetailsList; + List? getDayHoursTypeDetailsList; List? getDeductionsList; List? getDefaultValueList; List? getEITCollectionNotificationBodyList; - List? getEITDFFStructureList; - List? getEITTransactionList; + List? getEITDFFStructureList; + List? getEITTransactionList; List? getEarningsList; - List? getEmployeeAddressList; - List? getEmployeeBasicDetailsList; - List? getEmployeeContactsList; - List? getEmployeePhonesList; + List? getEmployeeAddressList; + List? getEmployeeBasicDetailsList; + List? getEmployeeContactsList; + List? getEmployeePhonesList; List? getEmployeeSubordinatesList; List? getFliexfieldStructureList; List? getHrCollectionNotificationBodyList; List? getHrTransactionList; - List? getItemCreationNtfBodyList; + GetItemCreationNtfBodyList? getItemCreationNtfBodyList; List? getItemTypeNotificationsList; List? getItemTypesList; List? getLookupValuesList; List? getMenuEntriesList; - List? getMoItemHistoryList; - List? getMoNotificationBodyList; - List? getNotificationButtonsList; + List? getMoItemHistoryList; + List? getMoNotificationBodyList; + List? getNotificationButtonsList; List? getNotificationReassignModeList; - List? getObjectValuesList; + List? getObjectValuesList; GetOpenMissingSwipesList? getOpenMissingSwipesList; List? getOpenNotificationsList; List? getOpenNotificationsNumList; @@ -124,33 +152,33 @@ class GenericResponseModel { List? getPendingReqFunctionsList; List? getPerformanceAppraisalList; List? getPhonesNotificationBodyList; - List? getPoItemHistoryList; - List? getPoNotificationBodyList; + List? getPoItemHistoryList; + GetPoNotificationBodyList? getPoNotificationBodyList; List? getPrNotificationBodyList; - List? getQuotationAnalysisList; + List? getQuotationAnalysisList; List? getRFCEmployeeListList; List? getRespondAttributeValueList; List? getSITCollectionNotificationBodyList; List? getSITDFFStructureList; List? getSITTransactionList; - List? getScheduleShiftsDetailsList; + List? getScheduleShiftsDetailsList; List? getShiftTypesList; - List? getStampMsNotificationBodyList; - List? getStampNsNotificationBodyList; + List? getStampMsNotificationBodyList; + List? getStampNsNotificationBodyList; List? getSubordinatesAttdStatusList; - List? getSubordinatesLeavesList; + List? getSubordinatesLeavesList; List? getSubordinatesLeavesTotalVacationsList; List? getSummaryOfPaymentList; List? getSwipesList; List? getTermColsStructureList; List? getTermDffStructureList; List? getTermNotificationBodyList; - List? getTimeCardSummaryList; + List? getTimeCardSummaryList; List? getUserItemTypesList; List? getVacationRulesList; List? getVaccinationOnHandList; List? getVaccinationsList; - List? getValueSetValuesList; + List? getValueSetValuesList; List? getWorkList; String? hRCertificateTemplate; String? imgURLsList; @@ -189,16 +217,16 @@ class GenericResponseModel { bool? mohemmIsInsertBusinessCardEnable; String? mohemmWifiPassword; String? mohemmWifiSSID; - String? notificationAction; - String? notificationGetRespondAttributesList; - String? notificationRespondRolesList; + NotificationAction? notificationAction; + List? notificationGetRespondAttributesList; + List? notificationRespondRolesList; int? oracleOutPutNumber; String? pASSWORDEXPIREDMSG; String? pCOUNTRYCODE; String? pCOUNTRYNAME; String? pDESCFLEXCONTEXTCODE; String? pDESCFLEXCONTEXTNAME; - Null? pForm; + String? pForm; String? pINFORMATION; int? pMBLID; String? pNUMOFSUBORDINATES; @@ -239,7 +267,7 @@ class GenericResponseModel { String? submitPhonesTransactionList; String? submitSITTransactionList; String? submitTermTransactionList; - String? subordinatesOnLeavesList; + List? subordinatesOnLeavesList; String? sumbitAbsenceTransactionList; String? tokenID; String? updateAttachmentList; @@ -568,19 +596,56 @@ class GenericResponseModel { forgetPasswordTokenID = json['ForgetPasswordTokenID']; getAbsenceAttachmentsList = json['GetAbsenceAttachmentsList']; getAbsenceAttendanceTypesList = json['GetAbsenceAttendanceTypesList']; - getAbsenceCollectionNotificationBodyList = json['GetAbsenceCollectionNotificationBodyList']; + + if (json['GetAbsenceCollectionNotificationBodyList'] != null) { + getAbsenceCollectionNotificationBodyList = []; + json['GetAbsenceCollectionNotificationBodyList'].forEach((v) { + getAbsenceCollectionNotificationBodyList!.add(new GetAbsenceCollectionNotificationBodyList.fromJson(v)); + }); + } + getAbsenceDffStructureList = json['GetAbsenceDffStructureList']; getAbsenceTransactionList = json['GetAbsenceTransactionList']; getAccrualBalancesList = json["GetAccrualBalancesList"] == null ? null : List.from(json["GetAccrualBalancesList"].map((x) => GetAccrualBalancesList.fromJson(x))); - getActionHistoryList = json['GetActionHistoryList']; + + if (json['GetActionHistoryList'] != null) { + getActionHistoryList = []; + json['GetActionHistoryList'].forEach((v) { + getActionHistoryList!.add(GetActionHistoryList.fromJson(v)); + }); + } + getAddressDffStructureList = json['GetAddressDffStructureList']; getAddressNotificationBodyList = json['GetAddressNotificationBodyList']; getApprovesList = json['GetApprovesList']; - getAttachementList = json['GetAttachementList']; + + if (json['GetAttachementList'] != null) { + getAttachementList = []; + json['GetAttachementList'].forEach((v) { + getAttachementList!.add(new GetAttachementList.fromJson(v)); + }); + } getAttendanceTrackingList = json["GetAttendanceTrackingList"] == null ? null : GetAttendanceTracking.fromMap(json["GetAttendanceTrackingList"]); - getBasicDetColsStructureList = json['GetBasicDetColsStructureList']; - getBasicDetDffStructureList = json['GetBasicDetDffStructureList']; - getBasicDetNtfBodyList = json['GetBasicDetNtfBodyList']; + if (json['GetBasicDetColsStructureList'] != null) { + getBasicDetColsStructureList = []; + json['GetBasicDetColsStructureList'].forEach((v) { + getBasicDetColsStructureList!.add(new GetBasicDetColsStructureList.fromJson(v)); + }); + } + // getBasicDetDffStructureList = json['GetBasicDetDffStructureList']; + if (json['GetBasicDetDffStructureList'] != null) { + getBasicDetDffStructureList = []; + json['GetBasicDetDffStructureList'].forEach((v) { + getBasicDetDffStructureList!.add(new GetBasicDetDffStructureList.fromJson(v)); + }); + } + if (json['GetBasicDetNtfBodyList'] != null) { + getBasicDetNtfBodyList = []; + json['GetBasicDetNtfBodyList'].forEach((v) { + getBasicDetNtfBodyList!.add(new GetBasicDetNtfBodyList.fromJson(v)); + }); + } + getCEICollectionNotificationBodyList = json['GetCEICollectionNotificationBodyList']; getCEIDFFStructureList = json['GetCEIDFFStructureList']; getCEITransactionList = json['GetCEITransactionList']; @@ -594,31 +659,91 @@ class GenericResponseModel { getContactDffStructureList = json['GetContactDffStructureList']; getContactNotificationBodyList = json['GetContactNotificationBodyList']; getCountriesList = json['GetCountriesList']; - getDayHoursTypeDetailsList = json['GetDayHoursTypeDetailsList']; + if (json['GetDayHoursTypeDetailsList'] != null) { + getDayHoursTypeDetailsList = []; + json['GetDayHoursTypeDetailsList'].forEach((v) { + getDayHoursTypeDetailsList!.add(new GetDayHoursTypeDetailsList.fromJson(v)); + }); + } getDeductionsList = json['GetDeductionsList']; getDefaultValueList = json['GetDefaultValueList']; getEITCollectionNotificationBodyList = json['GetEITCollectionNotificationBodyList']; - getEITDFFStructureList = json['GetEITDFFStructureList']; - getEITTransactionList = json['GetEITTransactionList']; + if (json['GetEITDFFStructureList'] != null) { + getEITDFFStructureList = []; + json['GetEITDFFStructureList'].forEach((v) { + getEITDFFStructureList!.add(new GetEITDFFStructureList.fromJson(v)); + }); + } + if (json['GetEITTransactionList'] != null) { + getEITTransactionList = []; + json['GetEITTransactionList'].forEach((v) { + getEITTransactionList!.add(new GetEITTransactionList.fromJson(v)); + }); + } getEarningsList = json['GetEarningsList']; - getEmployeeAddressList = json['GetEmployeeAddressList']; - getEmployeeBasicDetailsList = json['GetEmployeeBasicDetailsList']; - getEmployeeContactsList = json['GetEmployeeContactsList']; - getEmployeePhonesList = json['GetEmployeePhonesList']; + if (json['GetEmployeeAddressList'] != null) { + getEmployeeAddressList = []; + json['GetEmployeeAddressList'].forEach((v) { + getEmployeeAddressList!.add(new GetEmployeeAddressList.fromJson(v)); + }); + } + if (json['GetEmployeeBasicDetailsList'] != null) { + getEmployeeBasicDetailsList = []; + json['GetEmployeeBasicDetailsList'].forEach((v) { + getEmployeeBasicDetailsList!.add(new GetEmployeeBasicDetailsList.fromJson(v)); + }); + } + if (json['GetEmployeeContactsList'] != null) { + getEmployeeContactsList = []; + json['GetEmployeeContactsList'].forEach((v) { + getEmployeeContactsList!.add(new GetEmployeeContactsList.fromJson(v)); + }); + } + if (json['GetEmployeePhonesList'] != null) { + getEmployeePhonesList = []; + json['GetEmployeePhonesList'].forEach((v) { + getEmployeePhonesList!.add(new GetEmployeePhonesList.fromJson(v)); + }); + } getEmployeeSubordinatesList = json['GetEmployeeSubordinatesList']; getFliexfieldStructureList = json['GetFliexfieldStructureList']; getHrCollectionNotificationBodyList = json['GetHrCollectionNotificationBodyList']; getHrTransactionList = json['GetHrTransactionList']; - getItemCreationNtfBodyList = json['GetItemCreationNtfBodyList']; + + getItemCreationNtfBodyList = json['GetItemCreationNtfBodyList'] != null ? new GetItemCreationNtfBodyList.fromJson(json['GetItemCreationNtfBodyList']) : null; + getItemTypeNotificationsList = json['GetItemTypeNotificationsList']; getItemTypesList = json['GetItemTypesList']; getLookupValuesList = json['GetLookupValuesList']; getMenuEntriesList = json["GetMenuEntriesList"] == null ? null : List.from(json["GetMenuEntriesList"].map((x) => GetMenuEntriesList.fromJson(x))); - getMoItemHistoryList = json['GetMoItemHistoryList']; - getMoNotificationBodyList = json['GetMoNotificationBodyList']; - getNotificationButtonsList = json['GetNotificationButtonsList']; - getNotificationReassignModeList = json['GetNotificationReassignModeList']; - getObjectValuesList = json['GetObjectValuesList']; + if (json['GetMoItemHistoryList'] != null) { + getMoItemHistoryList = []; + json['GetMoItemHistoryList'].forEach((v) { + getMoItemHistoryList!.add(new GetMoItemHistoryList.fromJson(v)); + }); + } + + if (json['GetMoNotificationBodyList'] != null) { + getMoNotificationBodyList = []; + json['GetMoNotificationBodyList'].forEach((v) { + getMoNotificationBodyList!.add(new GetMoNotificationBodyList.fromJson(v)); + }); + } + + if (json['GetNotificationButtonsList'] != null) { + getNotificationButtonsList = []; + json['GetNotificationButtonsList'].forEach((v) { + getNotificationButtonsList!.add(new GetNotificationButtonsList.fromJson(v)); + }); + } + + if (json['GetObjectValuesList'] != null) { + getObjectValuesList = []; + json['GetObjectValuesList'].forEach((v) { + getObjectValuesList!.add(new GetPhoneNumberTypesModel.fromJson(v)); + }); + } + getOpenMissingSwipesList = json["GetOpenMissingSwipesList"] == null ? null : GetOpenMissingSwipesList.fromJson(json["GetOpenMissingSwipesList"]); getOpenNotificationsList = json["GetOpenNotificationsList"] == null ? null : List.from(json["GetOpenNotificationsList"].map((x) => GetOpenNotificationsList.fromMap(x))); getOpenNotificationsNumList = json['GetOpenNotificationsNumList']; @@ -630,33 +755,79 @@ class GenericResponseModel { getPendingReqFunctionsList = json['GetPendingReqFunctionsList']; getPerformanceAppraisalList = json['GetPerformanceAppraisalList']; getPhonesNotificationBodyList = json['GetPhonesNotificationBodyList']; - getPoItemHistoryList = json['GetPoItemHistoryList']; - getPoNotificationBodyList = json['GetPoNotificationBodyList']; + if (json['GetPoItemHistoryList'] != null) { + getPoItemHistoryList = []; + json['GetPoItemHistoryList'].forEach((v) { + getPoItemHistoryList!.add(new GetPoItemHistoryList.fromJson(v)); + }); + } + getPoNotificationBodyList = json['GetPoNotificationBodyList'] != null ? new GetPoNotificationBodyList.fromJson(json['GetPoNotificationBodyList']) : null; getPrNotificationBodyList = json['GetPrNotificationBodyList']; - getQuotationAnalysisList = json['GetQuotationAnalysisList']; + if (json['GetQuotationAnalysisList'] != null) { + getQuotationAnalysisList = []; + json['GetQuotationAnalysisList'].forEach((v) { + getQuotationAnalysisList!.add(new GetQuotationAnalysisList.fromJson(v)); + }); + } getRFCEmployeeListList = json['GetRFCEmployeeListList']; getRespondAttributeValueList = json['GetRespondAttributeValueList']; getSITCollectionNotificationBodyList = json['GetSITCollectionNotificationBodyList']; getSITDFFStructureList = json['GetSITDFFStructureList']; getSITTransactionList = json['GetSITTransactionList']; - getScheduleShiftsDetailsList = json['GetScheduleShiftsDetailsList']; + if (json['GetScheduleShiftsDetailsList'] != null) { + getScheduleShiftsDetailsList = []; + json['GetScheduleShiftsDetailsList'].forEach((v) { + getScheduleShiftsDetailsList!.add(new GetScheduleShiftsDetailsList.fromJson(v)); + }); + } getShiftTypesList = json['GetShiftTypesList']; - getStampMsNotificationBodyList = json['GetStampMsNotificationBodyList']; - getStampNsNotificationBodyList = json['GetStampNsNotificationBodyList']; + + if (json['GetStampMsNotificationBodyList'] != null) { + getStampMsNotificationBodyList = []; + json['GetStampMsNotificationBodyList'].forEach((v) { + getStampMsNotificationBodyList!.add(new GetStampMsNotificationBodyList.fromJson(v)); + }); + } + if (json['GetStampNsNotificationBodyList'] != null) { + getStampNsNotificationBodyList = []; + json['GetStampNsNotificationBodyList'].forEach((v) { + getStampNsNotificationBodyList!.add(new GetStampNsNotificationBodyList.fromJson(v)); + }); + } + getSubordinatesAttdStatusList = json['GetSubordinatesAttdStatusList']; - getSubordinatesLeavesList = json['GetSubordinatesLeavesList']; + + if (json['GetSubordinatesLeavesList'] != null) { + getSubordinatesLeavesList = []; + json['GetSubordinatesLeavesList'].forEach((v) { + getSubordinatesLeavesList!.add(SubordinatesLeavesList.fromJson(v)); + }); + } + getSubordinatesLeavesTotalVacationsList = json['GetSubordinatesLeavesTotalVacationsList']; getSummaryOfPaymentList = json['GetSummaryOfPaymentList']; getSwipesList = json['GetSwipesList']; getTermColsStructureList = json['GetTermColsStructureList']; getTermDffStructureList = json['GetTermDffStructureList']; getTermNotificationBodyList = json['GetTermNotificationBodyList']; - getTimeCardSummaryList = json['GetTimeCardSummaryList']; + + if (json['GetTimeCardSummaryList'] != null) { + getTimeCardSummaryList = []; + json['GetTimeCardSummaryList'].forEach((v) { + getTimeCardSummaryList!.add(new GetTimeCardSummaryList.fromJson(v)); + }); + } getUserItemTypesList = json['GetUserItemTypesList']; getVacationRulesList = json['GetVacationRulesList']; getVaccinationOnHandList = json['GetVaccinationOnHandList']; getVaccinationsList = json['GetVaccinationsList']; - getValueSetValuesList = json['GetValueSetValuesList']; + + if (json['GetValueSetValuesList'] != null) { + getValueSetValuesList = []; + json['GetValueSetValuesList'].forEach((v) { + getValueSetValuesList!.add(ESERVICESVS.fromJson(v)); + }); + } if (json['GetWorkList'] != null) { getWorkList = []; @@ -703,7 +874,7 @@ class GenericResponseModel { if (json['Mohemm_GetMobileLoginInfoList'] != null) { mohemmGetMobileLoginInfoList = []; json['Mohemm_GetMobileLoginInfoList'].forEach((v) { - mohemmGetMobileLoginInfoList!.add(new GetMobileLoginInfoListModel.fromJson(v)); + mohemmGetMobileLoginInfoList!.add(GetMobileLoginInfoListModel.fromJson(v)); }); } mohemmGetPatientIDList = json['Mohemm_GetPatientID_List']; @@ -712,9 +883,21 @@ class GenericResponseModel { mohemmIsInsertBusinessCardEnable = json['Mohemm_IsInsertBusinessCardEnable']; mohemmWifiPassword = json['Mohemm_Wifi_Password']; mohemmWifiSSID = json['Mohemm_Wifi_SSID']; - notificationAction = json['NotificationAction']; - notificationGetRespondAttributesList = json['NotificationGetRespondAttributesList']; - notificationRespondRolesList = json['NotificationRespondRolesList']; + notificationAction = json['NotificationAction'] != null ? NotificationAction.fromJson(json['NotificationAction']) : null; + if (json['NotificationGetRespondAttributesList'] != null) { + notificationGetRespondAttributesList = []; + json['NotificationGetRespondAttributesList'].forEach((v) { + notificationGetRespondAttributesList!.add(NotificationGetRespondAttributesList.fromJson(v)); + }); + } + + if (json['NotificationRespondRolesList'] != null) { + notificationRespondRolesList = []; + json['NotificationGetRespondAttributesList'].forEach((v) { + // notificationRespondRolesList!.add(v); + }); + } + oracleOutPutNumber = json['OracleOutPutNumber']; pASSWORDEXPIREDMSG = json['PASSWORD_EXPIRED_MSG']; pCOUNTRYCODE = json['P_COUNTRY_CODE']; @@ -769,7 +952,14 @@ class GenericResponseModel { submitPhonesTransactionList = json['SubmitPhonesTransactionList']; submitSITTransactionList = json['SubmitSITTransactionList']; submitTermTransactionList = json['SubmitTermTransactionList']; - subordinatesOnLeavesList = json['SubordinatesOnLeavesList']; + + if (json['SubordinatesOnLeavesList'] != null) { + subordinatesOnLeavesList = []; + json['GetSubordinatesLeavesList'].forEach((v) { + subordinatesOnLeavesList!.add(SubordinatesLeavesList.fromJson(v)); + }); + } + sumbitAbsenceTransactionList = json['SumbitAbsenceTransactionList']; tokenID = json['TokenID']; updateAttachmentList = json['UpdateAttachmentList']; @@ -849,19 +1039,35 @@ class GenericResponseModel { data['ForgetPasswordTokenID'] = this.forgetPasswordTokenID; data['GetAbsenceAttachmentsList'] = this.getAbsenceAttachmentsList; data['GetAbsenceAttendanceTypesList'] = this.getAbsenceAttendanceTypesList; - data['GetAbsenceCollectionNotificationBodyList'] = this.getAbsenceCollectionNotificationBodyList; + + if (this.getAbsenceCollectionNotificationBodyList != null) { + data['GetAbsenceCollectionNotificationBodyList'] = this.getAbsenceCollectionNotificationBodyList!.map((v) => v.toJson()).toList(); + } + data['GetAbsenceDffStructureList'] = this.getAbsenceDffStructureList; data['GetAbsenceTransactionList'] = this.getAbsenceTransactionList; data['GetAccrualBalancesList'] = this.getAccrualBalancesList; - data['GetActionHistoryList'] = this.getActionHistoryList; + + if (this.getActionHistoryList != null) { + data['GetActionHistoryList'] = this.getActionHistoryList!.map((v) => v.toJson()).toList(); + } + data['GetAddressDffStructureList'] = this.getAddressDffStructureList; data['GetAddressNotificationBodyList'] = this.getAddressNotificationBodyList; data['GetApprovesList'] = this.getApprovesList; - data['GetAttachementList'] = this.getAttachementList; + + if (this.getAttachementList != null) { + data['GetAttachementList'] = this.getAttachementList!.map((v) => v.toJson()).toList(); + } + data['GetAttendanceTrackingList'] = this.getAttendanceTrackingList; data['GetBasicDetColsStructureList'] = this.getBasicDetColsStructureList; data['GetBasicDetDffStructureList'] = this.getBasicDetDffStructureList; - data['GetBasicDetNtfBodyList'] = this.getBasicDetNtfBodyList; + + 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; @@ -875,29 +1081,56 @@ class GenericResponseModel { data['GetContactDffStructureList'] = this.getContactDffStructureList; data['GetContactNotificationBodyList'] = this.getContactNotificationBodyList; data['GetCountriesList'] = this.getCountriesList; - data['GetDayHoursTypeDetailsList'] = this.getDayHoursTypeDetailsList; + if (this.getDayHoursTypeDetailsList != null) { + data['GetDayHoursTypeDetailsList'] = this.getDayHoursTypeDetailsList!.map((v) => v.toJson()).toList(); + } data['GetDeductionsList'] = this.getDeductionsList; data['GetDefaultValueList'] = this.getDefaultValueList; data['GetEITCollectionNotificationBodyList'] = this.getEITCollectionNotificationBodyList; - data['GetEITDFFStructureList'] = this.getEITDFFStructureList; - data['GetEITTransactionList'] = this.getEITTransactionList; + if (this.getEITDFFStructureList != null) { + data['GetEITDFFStructureList'] = this.getEITDFFStructureList!.map((v) => v.toJson()).toList(); + } + if (this.getEITTransactionList != null) { + data['GetEITTransactionList'] = this.getEITTransactionList!.map((v) => v.toJson()).toList(); + } data['GetEarningsList'] = this.getEarningsList; - data['GetEmployeeAddressList'] = this.getEmployeeAddressList; - data['GetEmployeeBasicDetailsList'] = this.getEmployeeBasicDetailsList; - data['GetEmployeeContactsList'] = this.getEmployeeContactsList; - data['GetEmployeePhonesList'] = this.getEmployeePhonesList; + if (this.getEmployeeAddressList != null) { + data['GetEmployeeAddressList'] = this.getEmployeeAddressList!.map((v) => v.toJson()).toList(); + } + if (this.getEmployeeBasicDetailsList != null) { + data['GetEmployeeBasicDetailsList'] = this.getEmployeeBasicDetailsList!.map((v) => v.toJson()).toList(); + } + if (this.getEmployeeContactsList != null) { + data['GetEmployeeContactsList'] = this.getEmployeeContactsList!.map((v) => v.toJson()).toList(); + } + if (this.getEmployeePhonesList != null) { + data['GetEmployeePhonesList'] = this.getEmployeePhonesList!.map((v) => v.toJson()).toList(); + } data['GetEmployeeSubordinatesList'] = this.getEmployeeSubordinatesList; data['GetFliexfieldStructureList'] = this.getFliexfieldStructureList; data['GetHrCollectionNotificationBodyList'] = this.getHrCollectionNotificationBodyList; data['GetHrTransactionList'] = this.getHrTransactionList; - data['GetItemCreationNtfBodyList'] = this.getItemCreationNtfBodyList; + + if (this.getItemCreationNtfBodyList != null) { + data['GetItemCreationNtfBodyList'] = this.getItemCreationNtfBodyList!.toJson(); + } + data['GetItemTypeNotificationsList'] = this.getItemTypeNotificationsList; data['GetItemTypesList'] = this.getItemTypesList; data['GetLookupValuesList'] = this.getLookupValuesList; data['GetMenuEntriesList'] = this.getMenuEntriesList; - data['GetMoItemHistoryList'] = this.getMoItemHistoryList; - data['GetMoNotificationBodyList'] = this.getMoNotificationBodyList; - data['GetNotificationButtonsList'] = this.getNotificationButtonsList; + if (this.getMoItemHistoryList != null) { + data['GetMoItemHistoryList'] = this.getMoItemHistoryList!.map((v) => v.toJson()).toList(); + } + + if (this.getMoNotificationBodyList != null) { + data['GetMoNotificationBodyList'] = this.getMoNotificationBodyList!.map((v) => v.toJson()).toList(); + } + + if (this.getNotificationButtonsList != null) { + data['GetNotificationButtonsList'] = this.getNotificationButtonsList!.map((v) => v.toJson()).toList(); + } + data['GetNotificationReassignModeList'] = this.getNotificationReassignModeList; data['GetObjectValuesList'] = this.getObjectValuesList; data['GetOpenMissingSwipesList'] = this.getOpenMissingSwipesList; @@ -911,38 +1144,62 @@ class GenericResponseModel { data['GetPendingReqFunctionsList'] = this.getPendingReqFunctionsList; data['GetPerformanceAppraisalList'] = this.getPerformanceAppraisalList; data['GetPhonesNotificationBodyList'] = this.getPhonesNotificationBodyList; - data['GetPoItemHistoryList'] = this.getPoItemHistoryList; - data['GetPoNotificationBodyList'] = this.getPoNotificationBodyList; + if (this.getPoItemHistoryList != null) { + data['GetPoItemHistoryList'] = this.getPoItemHistoryList!.map((v) => v.toJson()).toList(); + } + + if (this.getPoNotificationBodyList != null) { + data['GetPoNotificationBodyList'] = this.getPoNotificationBodyList!.toJson(); + } data['GetPrNotificationBodyList'] = this.getPrNotificationBodyList; - data['GetQuotationAnalysisList'] = this.getQuotationAnalysisList; + if (this.getQuotationAnalysisList != null) { + data['GetQuotationAnalysisList'] = this.getQuotationAnalysisList!.map((v) => v.toJson()).toList(); + } data['GetRFCEmployeeListList'] = this.getRFCEmployeeListList; data['GetRespondAttributeValueList'] = this.getRespondAttributeValueList; data['GetSITCollectionNotificationBodyList'] = this.getSITCollectionNotificationBodyList; data['GetSITDFFStructureList'] = this.getSITDFFStructureList; data['GetSITTransactionList'] = this.getSITTransactionList; - data['GetScheduleShiftsDetailsList'] = this.getScheduleShiftsDetailsList; + if (this.getScheduleShiftsDetailsList != null) { + data['GetScheduleShiftsDetailsList'] = this.getScheduleShiftsDetailsList!.map((v) => v.toJson()).toList(); + } data['GetShiftTypesList'] = this.getShiftTypesList; - data['GetStampMsNotificationBodyList'] = this.getStampMsNotificationBodyList; + + if (this.getStampMsNotificationBodyList != null) { + data['GetStampMsNotificationBodyList'] = this.getStampMsNotificationBodyList!.map((v) => v.toJson()).toList(); + } + + if (this.getStampNsNotificationBodyList != null) { + data['GetStampNsNotificationBodyList'] = this.getStampNsNotificationBodyList!.map((v) => v.toJson()).toList(); + } + data['GetStampNsNotificationBodyList'] = this.getStampNsNotificationBodyList; data['GetSubordinatesAttdStatusList'] = this.getSubordinatesAttdStatusList; data['GetSubordinatesLeavesList'] = this.getSubordinatesLeavesList; + + if (this.getSubordinatesLeavesList != null) { + data['GetSubordinatesLeavesList'] = this.getSubordinatesLeavesList!.map((v) => v.toJson()).toList(); + } + data['GetSubordinatesLeavesTotalVacationsList'] = this.getSubordinatesLeavesTotalVacationsList; data['GetSummaryOfPaymentList'] = this.getSummaryOfPaymentList; data['GetSwipesList'] = this.getSwipesList; data['GetTermColsStructureList'] = this.getTermColsStructureList; data['GetTermDffStructureList'] = this.getTermDffStructureList; data['GetTermNotificationBodyList'] = this.getTermNotificationBodyList; - data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList; + if (this.getTimeCardSummaryList != null) { + data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList!.map((v) => v.toJson()).toList(); + } data['GetUserItemTypesList'] = this.getUserItemTypesList; data['GetVacationRulesList'] = this.getVacationRulesList; data['GetVaccinationOnHandList'] = this.getVaccinationOnHandList; data['GetVaccinationsList'] = this.getVaccinationsList; - data['GetValueSetValuesList'] = this.getValueSetValuesList; - + if (getValueSetValuesList != null) { + data['GetValueSetValuesList'] = getValueSetValuesList!.map((v) => v.toJson()).toList(); + } if (getWorkList != null) { data['GetWorkList'] = getWorkList!.map((v) => v.toJson()).toList(); } - data['HRCertificateTemplate'] = this.hRCertificateTemplate; data['ImgURLsList'] = this.imgURLsList; data['InsertApInv'] = this.insertApInv; @@ -984,9 +1241,19 @@ class GenericResponseModel { data['Mohemm_IsInsertBusinessCardEnable'] = this.mohemmIsInsertBusinessCardEnable; data['Mohemm_Wifi_Password'] = this.mohemmWifiPassword; data['Mohemm_Wifi_SSID'] = this.mohemmWifiSSID; - data['NotificationAction'] = this.notificationAction; - data['NotificationGetRespondAttributesList'] = this.notificationGetRespondAttributesList; - data['NotificationRespondRolesList'] = this.notificationRespondRolesList; + + if (this.notificationAction != null) { + data['NotificationAction'] = this.notificationAction!.toJson(); + } + + if (notificationGetRespondAttributesList != null) { + data['NotificationGetRespondAttributesList'] = notificationGetRespondAttributesList!.map((v) => v.toJson()).toList(); + } + + if (notificationRespondRolesList != null) { + data['NotificationRespondRolesList'] = notificationRespondRolesList!.map((v) => v).toList(); + } + data['OracleOutPutNumber'] = this.oracleOutPutNumber; data['PASSWORD_EXPIRED_MSG'] = this.pASSWORDEXPIREDMSG; data['P_COUNTRY_CODE'] = this.pCOUNTRYCODE; @@ -1037,6 +1304,11 @@ class GenericResponseModel { data['SubmitSITTransactionList'] = this.submitSITTransactionList; data['SubmitTermTransactionList'] = this.submitTermTransactionList; data['SubordinatesOnLeavesList'] = this.subordinatesOnLeavesList; + + if (this.subordinatesOnLeavesList != null) { + data['SubordinatesOnLeavesList'] = this.subordinatesOnLeavesList!.map((v) => v.toJson()).toList(); + } + data['SumbitAbsenceTransactionList'] = this.sumbitAbsenceTransactionList; data['TokenID'] = this.tokenID; data['UpdateAttachmentList'] = this.updateAttachmentList; diff --git a/lib/models/get_absence_collection_notification_body_list_model.dart b/lib/models/get_absence_collection_notification_body_list_model.dart new file mode 100644 index 0000000..4ac1f27 --- /dev/null +++ b/lib/models/get_absence_collection_notification_body_list_model.dart @@ -0,0 +1,97 @@ + +class GetAbsenceCollectionNotificationBodyList { + List? collectionNotification; + + GetAbsenceCollectionNotificationBodyList({this.collectionNotification}); + + GetAbsenceCollectionNotificationBodyList.fromJson(Map json) { + if (json['Collection_Notification'] != null) { + collectionNotification = []; + json['Collection_Notification'].forEach((v) { + collectionNotification!.add(new CollectionNotification.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.collectionNotification != null) { + data['Collection_Notification'] = + this.collectionNotification!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class CollectionNotification { + String? aCTION; + String? aPPLICATIONCOLUMNNAME; + String? dATATYPE; + String? dATEVALUE; + String? dESCFLEXCONTEXTCODE; + String? dESCFLEXNAME; + String? dISPLAYFLAG; + int? nUMBERVALUE; + String? pREVSEGMENTVALUEDSP; + String? sEGMENTNAME; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? sEGMENTVALUEDSP; + int? tRANSACTIONNUMBER; + String? vARCHAR2VALUE; + + CollectionNotification( + {this.aCTION, + this.aPPLICATIONCOLUMNNAME, + this.dATATYPE, + this.dATEVALUE, + this.dESCFLEXCONTEXTCODE, + this.dESCFLEXNAME, + this.dISPLAYFLAG, + this.nUMBERVALUE, + this.pREVSEGMENTVALUEDSP, + this.sEGMENTNAME, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.sEGMENTVALUEDSP, + this.tRANSACTIONNUMBER, + this.vARCHAR2VALUE}); + + CollectionNotification.fromJson(Map json) { + aCTION = json['ACTION']; + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + dATATYPE = json['DATATYPE']; + dATEVALUE = json['DATE_VALUE']; + dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE']; + dESCFLEXNAME = json['DESC_FLEX_NAME']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + nUMBERVALUE = json['NUMBER_VALUE']; + pREVSEGMENTVALUEDSP = json['PREV_SEGMENT_VALUE_DSP']; + sEGMENTNAME = json['SEGMENT_NAME']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + sEGMENTVALUEDSP = json['SEGMENT_VALUE_DSP']; + tRANSACTIONNUMBER = json['TRANSACTION_NUMBER']; + vARCHAR2VALUE = json['VARCHAR2_VALUE']; + } + + Map toJson() { + final Map data = new Map(); + data['ACTION'] = this.aCTION; + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['DATATYPE'] = this.dATATYPE; + data['DATE_VALUE'] = this.dATEVALUE; + data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE; + data['DESC_FLEX_NAME'] = this.dESCFLEXNAME; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['NUMBER_VALUE'] = this.nUMBERVALUE; + data['PREV_SEGMENT_VALUE_DSP'] = this.pREVSEGMENTVALUEDSP; + data['SEGMENT_NAME'] = this.sEGMENTNAME; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['SEGMENT_VALUE_DSP'] = this.sEGMENTVALUEDSP; + data['TRANSACTION_NUMBER'] = this.tRANSACTIONNUMBER; + data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_action_history_list_model.dart b/lib/models/get_action_history_list_model.dart new file mode 100644 index 0000000..c89a974 --- /dev/null +++ b/lib/models/get_action_history_list_model.dart @@ -0,0 +1,76 @@ +class GetActionHistoryList { + String? aCTION; + String? aCTIONCODE; + String? eMAILADDRESS; + String? eMPLOYEEIMAGE; + int? fROMROWNUM; + bool? isFavorite; + String? nAME; + String? nOTE; + String? nOTIFICATIONDATE; + int? nOTIFICATIONID; + int? nOOFROWS; + String? pOSITIONTITLE; + int? rOWNUM; + int? sEQUENCE; + int? tOROWNUM; + String? uSERNAME; + + GetActionHistoryList( + {this.aCTION, + this.aCTIONCODE, + this.eMAILADDRESS, + this.eMPLOYEEIMAGE, + this.fROMROWNUM, + this.isFavorite, + this.nAME, + this.nOTE, + this.nOTIFICATIONDATE, + this.nOTIFICATIONID, + this.nOOFROWS, + this.pOSITIONTITLE, + this.rOWNUM, + this.sEQUENCE, + this.tOROWNUM, + this.uSERNAME}); + + GetActionHistoryList.fromJson(Map json) { + aCTION = json['ACTION']; + aCTIONCODE = json['ACTION_CODE']; + eMAILADDRESS = json['EMAIL_ADDRESS']; + eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE']; + fROMROWNUM = json['FROM_ROW_NUM']; + isFavorite = json['IsFavorite']; + nAME = json['NAME']; + nOTE = json['NOTE']; + nOTIFICATIONDATE = json['NOTIFICATION_DATE']; + nOTIFICATIONID = json['NOTIFICATION_ID']; + nOOFROWS = json['NO_OF_ROWS']; + pOSITIONTITLE = json['POSITION_TITLE']; + rOWNUM = json['ROW_NUM']; + sEQUENCE = json['SEQUENCE']; + tOROWNUM = json['TO_ROW_NUM']; + uSERNAME = json['USER_NAME']; + } + + Map toJson() { + final Map data = new Map(); + data['ACTION'] = this.aCTION; + data['ACTION_CODE'] = this.aCTIONCODE; + data['EMAIL_ADDRESS'] = this.eMAILADDRESS; + data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['IsFavorite'] = this.isFavorite; + data['NAME'] = this.nAME; + data['NOTE'] = this.nOTE; + data['NOTIFICATION_DATE'] = this.nOTIFICATIONDATE; + data['NOTIFICATION_ID'] = this.nOTIFICATIONID; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['POSITION_TITLE'] = this.pOSITIONTITLE; + data['ROW_NUM'] = this.rOWNUM; + data['SEQUENCE'] = this.sEQUENCE; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['USER_NAME'] = this.uSERNAME; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_attachement_list_model.dart b/lib/models/get_attachement_list_model.dart new file mode 100644 index 0000000..79c43bb --- /dev/null +++ b/lib/models/get_attachement_list_model.dart @@ -0,0 +1,72 @@ +class GetAttachementList { + int? aTTACHEDDOCUMENTID; + int? cATEGORYID; + int? dATATYPEID; + int? dOCUMENTID; + String? eNTITYNAME; + String? fILECONTENTTYPE; + String? fILEDATA; + int? fILEID; + String? fILENAME; + String? pK1VALUE; + String? pK2VALUE; + String? pK3VALUE; + String? pK4VALUE; + String? pK5VALUE; + int? sEQNUM; + + GetAttachementList( + {this.aTTACHEDDOCUMENTID, + this.cATEGORYID, + this.dATATYPEID, + this.dOCUMENTID, + this.eNTITYNAME, + this.fILECONTENTTYPE, + this.fILEDATA, + this.fILEID, + this.fILENAME, + this.pK1VALUE, + this.pK2VALUE, + this.pK3VALUE, + this.pK4VALUE, + this.pK5VALUE, + this.sEQNUM}); + + GetAttachementList.fromJson(Map json) { + aTTACHEDDOCUMENTID = json['ATTACHED_DOCUMENT_ID']; + cATEGORYID = json['CATEGORY_ID']; + dATATYPEID = json['DATATYPE_ID']; + dOCUMENTID = json['DOCUMENT_ID']; + eNTITYNAME = json['ENTITY_NAME']; + fILECONTENTTYPE = json['FILE_CONTENT_TYPE']; + fILEDATA = json['FILE_DATA']; + fILEID = json['FILE_ID']; + fILENAME = json['FILE_NAME']; + pK1VALUE = json['PK1_VALUE']; + pK2VALUE = json['PK2_VALUE']; + pK3VALUE = json['PK3_VALUE']; + pK4VALUE = json['PK4_VALUE']; + pK5VALUE = json['PK5_VALUE']; + sEQNUM = json['SEQ_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['ATTACHED_DOCUMENT_ID'] = this.aTTACHEDDOCUMENTID; + data['CATEGORY_ID'] = this.cATEGORYID; + data['DATATYPE_ID'] = this.dATATYPEID; + data['DOCUMENT_ID'] = this.dOCUMENTID; + data['ENTITY_NAME'] = this.eNTITYNAME; + data['FILE_CONTENT_TYPE'] = this.fILECONTENTTYPE; + data['FILE_DATA'] = this.fILEDATA; + data['FILE_ID'] = this.fILEID; + data['FILE_NAME'] = this.fILENAME; + data['PK1_VALUE'] = this.pK1VALUE; + data['PK2_VALUE'] = this.pK2VALUE; + data['PK3_VALUE'] = this.pK3VALUE; + data['PK4_VALUE'] = this.pK4VALUE; + data['PK5_VALUE'] = this.pK5VALUE; + data['SEQ_NUM'] = this.sEQNUM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_basic_det_ntf_body_list_model.dart b/lib/models/get_basic_det_ntf_body_list_model.dart new file mode 100644 index 0000000..afdcd29 --- /dev/null +++ b/lib/models/get_basic_det_ntf_body_list_model.dart @@ -0,0 +1,24 @@ +class GetBasicDetNtfBodyList { + String? prevSegmentValueDsp; + String? segmentPrompt; + String? segmentValueDsp; + String? updatedFlag; + + GetBasicDetNtfBodyList({this.prevSegmentValueDsp, this.segmentPrompt, this.segmentValueDsp, this.updatedFlag}); + + GetBasicDetNtfBodyList.fromJson(Map json) { + prevSegmentValueDsp = json['PREV_SEGMENT_VALUE_DSP']; + segmentPrompt = json['SEGMENT_PROMPT']; + segmentValueDsp = json['SEGMENT_VALUE_DSP']; + updatedFlag = json['UPDATED_FLAG']; + } + + Map toJson() { + final Map data = new Map(); + data['PREV_SEGMENT_VALUE_DSP'] = this.prevSegmentValueDsp; + data['SEGMENT_PROMPT'] = this.segmentPrompt; + data['SEGMENT_VALUE_DSP'] = this.segmentValueDsp; + data['UPDATED_FLAG'] = this.updatedFlag; + return data; + } +} diff --git a/lib/models/get_day_hours_type_details_list_model.dart b/lib/models/get_day_hours_type_details_list_model.dart new file mode 100644 index 0000000..5d0a0ab --- /dev/null +++ b/lib/models/get_day_hours_type_details_list_model.dart @@ -0,0 +1,180 @@ +class GetDayHoursTypeDetailsList { + Null? aBSENCEATTENDANCEID; + Null? aBSENCEATTENDANCETYPEID; + String? aBSENTFLAG; + String? aCTUALHRS; + String? aNALAYZEDFLAG; + String? aPPROVEDTIMEBACKHRS; + String? aPPRTIMEBACKFLAG; + int? aSSIGNMENTID; + String? aTTENDEDFLAG; + Null? cALENDARENTRYID; + String? cOMPOFFFLAG; + String? cOMPOFFHRS; + String? cOMPOFFHHRS; + String? cOMPOFFNHRS; + String? cOMPOFFWHRS; + String? dAYTYPE; + String? eARLYOUTFLAG; + String? eARLYOUTHRS; + String? eXCESSFLAG; + String? eXCESSHRS; + int? fROMROWNUM; + String? lATEINFLAG; + String? lATEINHRS; + String? mISSINGSWIPEFLAG; + String? nONSCHEDULEDFLAG; + Null? nOOFROWS; + String? oNCALLHRS; + Null? pERSONEXTRAINFOID; + String? pLANNEDOTHRS; + String? pLANNEDOTHRSFLAG; + String? rEMARKS; + int? rOWNUM; + int? rTPID; + String? sCHEDULEDHRS; + String? sCHEDULEDONCALLHRS; + String? sCHEDULEDPLANNEDOTHRS; + String? sCHEDULEDATE; + String? sHORTAGEFLAG; + String? sHORTAGEHRS; + String? tIMEBACKFLAG; + String? tIMEBACKHRS; + int? tOROWNUM; + + GetDayHoursTypeDetailsList( + {this.aBSENCEATTENDANCEID, + this.aBSENCEATTENDANCETYPEID, + this.aBSENTFLAG, + this.aCTUALHRS, + this.aNALAYZEDFLAG, + this.aPPROVEDTIMEBACKHRS, + this.aPPRTIMEBACKFLAG, + this.aSSIGNMENTID, + this.aTTENDEDFLAG, + this.cALENDARENTRYID, + this.cOMPOFFFLAG, + this.cOMPOFFHRS, + this.cOMPOFFHHRS, + this.cOMPOFFNHRS, + this.cOMPOFFWHRS, + this.dAYTYPE, + this.eARLYOUTFLAG, + this.eARLYOUTHRS, + this.eXCESSFLAG, + this.eXCESSHRS, + this.fROMROWNUM, + this.lATEINFLAG, + this.lATEINHRS, + this.mISSINGSWIPEFLAG, + this.nONSCHEDULEDFLAG, + this.nOOFROWS, + this.oNCALLHRS, + this.pERSONEXTRAINFOID, + this.pLANNEDOTHRS, + this.pLANNEDOTHRSFLAG, + this.rEMARKS, + this.rOWNUM, + this.rTPID, + this.sCHEDULEDHRS, + this.sCHEDULEDONCALLHRS, + this.sCHEDULEDPLANNEDOTHRS, + this.sCHEDULEDATE, + this.sHORTAGEFLAG, + this.sHORTAGEHRS, + this.tIMEBACKFLAG, + this.tIMEBACKHRS, + this.tOROWNUM}); + + GetDayHoursTypeDetailsList.fromJson(Map json) { + aBSENCEATTENDANCEID = json['ABSENCE_ATTENDANCE_ID']; + aBSENCEATTENDANCETYPEID = json['ABSENCE_ATTENDANCE_TYPE_ID']; + aBSENTFLAG = json['ABSENT_FLAG']; + aCTUALHRS = json['ACTUAL_HRS']; + aNALAYZEDFLAG = json['ANALAYZED_FLAG']; + aPPROVEDTIMEBACKHRS = json['APPROVED_TIMEBACK_HRS']; + aPPRTIMEBACKFLAG = json['APPR_TIMEBACK_FLAG']; + aSSIGNMENTID = json['ASSIGNMENT_ID']; + aTTENDEDFLAG = json['ATTENDED_FLAG']; + cALENDARENTRYID = json['CALENDAR_ENTRY_ID']; + cOMPOFFFLAG = json['COMP_OFF_FLAG']; + cOMPOFFHRS = json['COMP_OFF_HRS']; + cOMPOFFHHRS = json['COMP_OFF_H_HRS']; + cOMPOFFNHRS = json['COMP_OFF_N_HRS']; + cOMPOFFWHRS = json['COMP_OFF_W_HRS']; + dAYTYPE = json['DAY_TYPE']; + eARLYOUTFLAG = json['EARLY_OUT_FLAG']; + eARLYOUTHRS = json['EARLY_OUT_HRS']; + eXCESSFLAG = json['EXCESS_FLAG']; + eXCESSHRS = json['EXCESS_HRS']; + fROMROWNUM = json['FROM_ROW_NUM']; + lATEINFLAG = json['LATE_IN_FLAG']; + lATEINHRS = json['LATE_IN_HRS']; + mISSINGSWIPEFLAG = json['MISSING_SWIPE_FLAG']; + nONSCHEDULEDFLAG = json['NON_SCHEDULED_FLAG']; + nOOFROWS = json['NO_OF_ROWS']; + oNCALLHRS = json['ON_CALL_HRS']; + pERSONEXTRAINFOID = json['PERSON_EXTRA_INFO_ID']; + pLANNEDOTHRS = json['PLANNED_OT_HRS']; + pLANNEDOTHRSFLAG = json['PLANNED_OT_HRS_FLAG']; + rEMARKS = json['REMARKS']; + rOWNUM = json['ROW_NUM']; + rTPID = json['RTP_ID']; + sCHEDULEDHRS = json['SCHEDULED_HRS']; + sCHEDULEDONCALLHRS = json['SCHEDULED_ON_CALL_HRS']; + sCHEDULEDPLANNEDOTHRS = json['SCHEDULED_PLANNED_OT_HRS']; + sCHEDULEDATE = json['SCHEDULE_DATE']; + sHORTAGEFLAG = json['SHORTAGE_FLAG']; + sHORTAGEHRS = json['SHORTAGE_HRS']; + tIMEBACKFLAG = json['TIMEBACK_FLAG']; + tIMEBACKHRS = json['TIMEBACK_HRS']; + tOROWNUM = json['TO_ROW_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['ABSENCE_ATTENDANCE_ID'] = this.aBSENCEATTENDANCEID; + data['ABSENCE_ATTENDANCE_TYPE_ID'] = this.aBSENCEATTENDANCETYPEID; + data['ABSENT_FLAG'] = this.aBSENTFLAG; + data['ACTUAL_HRS'] = this.aCTUALHRS; + data['ANALAYZED_FLAG'] = this.aNALAYZEDFLAG; + data['APPROVED_TIMEBACK_HRS'] = this.aPPROVEDTIMEBACKHRS; + data['APPR_TIMEBACK_FLAG'] = this.aPPRTIMEBACKFLAG; + data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; + data['ATTENDED_FLAG'] = this.aTTENDEDFLAG; + data['CALENDAR_ENTRY_ID'] = this.cALENDARENTRYID; + data['COMP_OFF_FLAG'] = this.cOMPOFFFLAG; + data['COMP_OFF_HRS'] = this.cOMPOFFHRS; + data['COMP_OFF_H_HRS'] = this.cOMPOFFHHRS; + data['COMP_OFF_N_HRS'] = this.cOMPOFFNHRS; + data['COMP_OFF_W_HRS'] = this.cOMPOFFWHRS; + data['DAY_TYPE'] = this.dAYTYPE; + data['EARLY_OUT_FLAG'] = this.eARLYOUTFLAG; + data['EARLY_OUT_HRS'] = this.eARLYOUTHRS; + data['EXCESS_FLAG'] = this.eXCESSFLAG; + data['EXCESS_HRS'] = this.eXCESSHRS; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['LATE_IN_FLAG'] = this.lATEINFLAG; + data['LATE_IN_HRS'] = this.lATEINHRS; + data['MISSING_SWIPE_FLAG'] = this.mISSINGSWIPEFLAG; + data['NON_SCHEDULED_FLAG'] = this.nONSCHEDULEDFLAG; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['ON_CALL_HRS'] = this.oNCALLHRS; + data['PERSON_EXTRA_INFO_ID'] = this.pERSONEXTRAINFOID; + data['PLANNED_OT_HRS'] = this.pLANNEDOTHRS; + data['PLANNED_OT_HRS_FLAG'] = this.pLANNEDOTHRSFLAG; + data['REMARKS'] = this.rEMARKS; + data['ROW_NUM'] = this.rOWNUM; + data['RTP_ID'] = this.rTPID; + data['SCHEDULED_HRS'] = this.sCHEDULEDHRS; + data['SCHEDULED_ON_CALL_HRS'] = this.sCHEDULEDONCALLHRS; + data['SCHEDULED_PLANNED_OT_HRS'] = this.sCHEDULEDPLANNEDOTHRS; + data['SCHEDULE_DATE'] = this.sCHEDULEDATE; + data['SHORTAGE_FLAG'] = this.sHORTAGEFLAG; + data['SHORTAGE_HRS'] = this.sHORTAGEHRS; + data['TIMEBACK_FLAG'] = this.tIMEBACKFLAG; + data['TIMEBACK_HRS'] = this.tIMEBACKHRS; + data['TO_ROW_NUM'] = this.tOROWNUM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_eit_dff_structure_list_model.dart b/lib/models/get_eit_dff_structure_list_model.dart new file mode 100644 index 0000000..d559794 --- /dev/null +++ b/lib/models/get_eit_dff_structure_list_model.dart @@ -0,0 +1,307 @@ +class GetEITDFFStructureList { + String? aLPHANUMERICALLOWEDFLAG; + String? aPPLICATIONCOLUMNNAME; + String? cHILDSEGMENTSDV; + List? cHILDSEGMENTSDVSplited; + String? cHILDSEGMENTSVS; + List? cHILDSEGMENTSVSSplited; + String? dEFAULTTYPE; + String? dEFAULTVALUE; + String? dESCFLEXCONTEXTCODE; + String? dESCFLEXCONTEXTNAME; + String? dESCFLEXNAME; + String? dISPLAYFLAG; + String? eNABLEDFLAG; + ESERVICESDV? eSERVICESDV; + List? eSERVICESVS; + String? fLEXVALUESETNAME; + String? fORMATTYPE; + String? fORMATTYPEDSP; + bool? isEmptyOption; + String? lONGLISTFLAG; + int? mAXIMUMSIZE; + String? mAXIMUMVALUE; + String? mINIMUMVALUE; + String? mOBILEENABLED; + String? nUMBERPRECISION; + String? nUMERICMODEENABLEDFLAG; + String? pARENTSEGMENTSDV; + List? pARENTSEGMENTSDVSplited; + String? pARENTSEGMENTSVS; + List? pARENTSEGMENTSVSSplitedVS; + String? rEADONLY; + String? rEQUIREDFLAG; + String? sEGMENTNAME; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? uPPERCASEONLYFLAG; + String? uSEDFLAG; + String? vALIDATIONTYPE; + String? vALIDATIONTYPEDSP; + String? fieldAnswer; + + GetEITDFFStructureList( + {this.aLPHANUMERICALLOWEDFLAG, + this.aPPLICATIONCOLUMNNAME, + this.cHILDSEGMENTSDV, + this.cHILDSEGMENTSDVSplited, + this.cHILDSEGMENTSVS, + this.cHILDSEGMENTSVSSplited, + this.dEFAULTTYPE, + this.dEFAULTVALUE, + this.dESCFLEXCONTEXTCODE, + this.dESCFLEXCONTEXTNAME, + this.dESCFLEXNAME, + this.dISPLAYFLAG, + this.eNABLEDFLAG, + this.eSERVICESDV, + this.eSERVICESVS, + this.fLEXVALUESETNAME, + this.fORMATTYPE, + this.fORMATTYPEDSP, + this.isEmptyOption, + this.lONGLISTFLAG, + this.mAXIMUMSIZE, + this.mAXIMUMVALUE, + this.mINIMUMVALUE, + this.mOBILEENABLED, + this.nUMBERPRECISION, + this.nUMERICMODEENABLEDFLAG, + this.pARENTSEGMENTSDV, + this.pARENTSEGMENTSDVSplited, + this.pARENTSEGMENTSVS, + this.pARENTSEGMENTSVSSplitedVS, + this.rEADONLY, + this.rEQUIREDFLAG, + this.sEGMENTNAME, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.uPPERCASEONLYFLAG, + this.uSEDFLAG, + this.vALIDATIONTYPE, + this.vALIDATIONTYPEDSP, + this.fieldAnswer}); + + GetEITDFFStructureList.fromJson(Map json) { + print("----------------=============================="); + print("----------------:$json"); + aLPHANUMERICALLOWEDFLAG = json['ALPHANUMERIC_ALLOWED_FLAG']; + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + cHILDSEGMENTSDV = json['CHILD_SEGMENTS_DV']; + cHILDSEGMENTSDVSplited = json['CHILD_SEGMENTS_DV_Splited'] == null ? [] : json['CHILD_SEGMENTS_DV_Splited'].cast(); + cHILDSEGMENTSVS = json['CHILD_SEGMENTS_VS']; + cHILDSEGMENTSVSSplited = json['CHILD_SEGMENTS_VS_Splited'] == null ? [] : json['CHILD_SEGMENTS_VS_Splited'].cast(); + + dEFAULTTYPE = json['DEFAULT_TYPE']; + dEFAULTVALUE = json['DEFAULT_VALUE']; + dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE']; + dESCFLEXCONTEXTNAME = json['DESC_FLEX_CONTEXT_NAME']; + dESCFLEXNAME = json['DESC_FLEX_NAME']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + eNABLEDFLAG = json['ENABLED_FLAG']; + eSERVICESDV = json['E_SERVICES_DV'] != null ? new ESERVICESDV.fromJson(json['E_SERVICES_DV']) : null; + // if (json['E_SERVICES_VS'] != null) { + // eSERVICESVS = []; + // json['E_SERVICES_VS'].forEach((v) { + // eSERVICESVS!.add(v); + // }); + // } + if (json['E_SERVICES_VS'] != null) { + eSERVICESVS = []; + json['E_SERVICES_VS'].forEach((v) { + eSERVICESVS!.add(new ESERVICESVS.fromJson(v)); + }); + } else { + eSERVICESVS = []; + } + + fLEXVALUESETNAME = json['FLEX_VALUE_SET_NAME']; + fORMATTYPE = json['FORMAT_TYPE']; + fORMATTYPEDSP = json['FORMAT_TYPE_DSP']; + isEmptyOption = json['IsEmptyOption']; + lONGLISTFLAG = json['LONGLIST_FLAG']; + mAXIMUMSIZE = json['MAXIMUM_SIZE']; + mAXIMUMVALUE = json['MAXIMUM_VALUE']; + mINIMUMVALUE = json['MINIMUM_VALUE']; + mOBILEENABLED = json['MOBILE_ENABLED']; + nUMBERPRECISION = json['NUMBER_PRECISION']; + nUMERICMODEENABLEDFLAG = json['NUMERIC_MODE_ENABLED_FLAG']; + pARENTSEGMENTSDV = json['PARENT_SEGMENTS_DV']; + if (json['PARENT_SEGMENTS_DV_Splited'] != null) { + pARENTSEGMENTSDVSplited = []; + json['PARENT_SEGMENTS_DV_Splited'].forEach((v) { + pARENTSEGMENTSDVSplited!.add(new PARENTSEGMENTSDVSplited.fromJson(v)); + }); + } + pARENTSEGMENTSVS = json['PARENT_SEGMENTS_VS']; + + if (json['PARENT_SEGMENTS_VS_SplitedVS'] != null) { + pARENTSEGMENTSVSSplitedVS = []; + json['PARENT_SEGMENTS_VS_SplitedVS'].forEach((v) { + pARENTSEGMENTSVSSplitedVS!.add(new PARENTSEGMENTSVSSplitedVS.fromJson(v)); + }); + } + rEADONLY = json['READ_ONLY']; + rEQUIREDFLAG = json['REQUIRED_FLAG']; + sEGMENTNAME = json['SEGMENT_NAME']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + uPPERCASEONLYFLAG = json['UPPERCASE_ONLY_FLAG']; + uSEDFLAG = json['USED_FLAG']; + vALIDATIONTYPE = json['VALIDATION_TYPE']; + vALIDATIONTYPEDSP = json['VALIDATION_TYPE_DSP']; + } + + Map toJson() { + final Map data = new Map(); + data['ALPHANUMERIC_ALLOWED_FLAG'] = this.aLPHANUMERICALLOWEDFLAG; + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['CHILD_SEGMENTS_DV'] = this.cHILDSEGMENTSDV; + data['CHILD_SEGMENTS_DV_Splited'] = this.cHILDSEGMENTSDVSplited; + data['CHILD_SEGMENTS_VS'] = this.cHILDSEGMENTSVS; + data['CHILD_SEGMENTS_VS_Splited'] = this.cHILDSEGMENTSVSSplited; + data['DEFAULT_TYPE'] = this.dEFAULTTYPE; + data['DEFAULT_VALUE'] = this.dEFAULTVALUE; + data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE; + data['DESC_FLEX_CONTEXT_NAME'] = this.dESCFLEXCONTEXTNAME; + data['DESC_FLEX_NAME'] = this.dESCFLEXNAME; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['ENABLED_FLAG'] = this.eNABLEDFLAG; + if (this.eSERVICESDV != null) { + data['E_SERVICES_DV'] = this.eSERVICESDV!.toJson(); + } + if (this.eSERVICESVS != null) { + data['E_SERVICES_VS'] = this.eSERVICESVS!.map((v) => v.toJson()).toList(); + } + // if (this.eSERVICESVS != null) { + // data['E_SERVICES_VS'] = this.eSERVICESVS!.toList(); + // } + data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME; + data['FORMAT_TYPE'] = this.fORMATTYPE; + data['FORMAT_TYPE_DSP'] = this.fORMATTYPEDSP; + data['IsEmptyOption'] = this.isEmptyOption; + data['LONGLIST_FLAG'] = this.lONGLISTFLAG; + data['MAXIMUM_SIZE'] = this.mAXIMUMSIZE; + data['MAXIMUM_VALUE'] = this.mAXIMUMVALUE; + data['MINIMUM_VALUE'] = this.mINIMUMVALUE; + data['MOBILE_ENABLED'] = this.mOBILEENABLED; + data['NUMBER_PRECISION'] = this.nUMBERPRECISION; + data['NUMERIC_MODE_ENABLED_FLAG'] = this.nUMERICMODEENABLEDFLAG; + data['PARENT_SEGMENTS_DV'] = this.pARENTSEGMENTSDV; + if (this.pARENTSEGMENTSDVSplited != null) { + data['PARENT_SEGMENTS_DV_Splited'] = this.pARENTSEGMENTSDVSplited!.map((v) => v.toJson()).toList(); + } + data['PARENT_SEGMENTS_VS'] = this.pARENTSEGMENTSVS; + if (this.pARENTSEGMENTSVSSplitedVS != null) { + data['PARENT_SEGMENTS_VS_SplitedVS'] = this.pARENTSEGMENTSVSSplitedVS!.map((v) => v.toJson()).toList(); + } + + data['READ_ONLY'] = this.rEADONLY; + data['REQUIRED_FLAG'] = this.rEQUIREDFLAG; + data['SEGMENT_NAME'] = this.sEGMENTNAME; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['UPPERCASE_ONLY_FLAG'] = this.uPPERCASEONLYFLAG; + data['USED_FLAG'] = this.uSEDFLAG; + data['VALIDATION_TYPE'] = this.vALIDATIONTYPE; + data['VALIDATION_TYPE_DSP'] = this.vALIDATIONTYPEDSP; + return data; + } +} + +class ESERVICESDV { + String? pIDCOLUMNNAME; + String? pRETURNMSG; + String? pRETURNSTATUS; + String? pVALUECOLUMNNAME; + + ESERVICESDV({this.pIDCOLUMNNAME, this.pRETURNMSG, this.pRETURNSTATUS, this.pVALUECOLUMNNAME}); + + 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']; + } + + Map toJson() { + final Map data = new Map(); + data['P_ID_COLUMN_NAME'] = this.pIDCOLUMNNAME; + data['P_RETURN_MSG'] = this.pRETURNMSG; + data['P_RETURN_STATUS'] = this.pRETURNSTATUS; + data['P_VALUE_COLUMN_NAME'] = this.pVALUECOLUMNNAME; + return data; + } +} + +class ESERVICESVS { + String? dESCRIPTION; + int? fROMROWNUM; + String? iDCOLUMNNAME; + int? nOOFROWS; + int? rOWNUM; + int? tOROWNUM; + String? vALUECOLUMNNAME; + + ESERVICESVS({this.dESCRIPTION, this.fROMROWNUM, this.iDCOLUMNNAME, this.nOOFROWS, this.rOWNUM, this.tOROWNUM, this.vALUECOLUMNNAME}); + + ESERVICESVS.fromJson(Map json) { + dESCRIPTION = json['DESCRIPTION']; + fROMROWNUM = json['FROM_ROW_NUM']; + iDCOLUMNNAME = json['ID_COLUMN_NAME']; + nOOFROWS = json['NO_OF_ROWS']; + rOWNUM = json['ROW_NUM']; + tOROWNUM = json['TO_ROW_NUM']; + vALUECOLUMNNAME = json['VALUE_COLUMN_NAME']; + } + + Map toJson() { + final Map data = new Map(); + data['DESCRIPTION'] = this.dESCRIPTION; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['ID_COLUMN_NAME'] = this.iDCOLUMNNAME; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['ROW_NUM'] = this.rOWNUM; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['VALUE_COLUMN_NAME'] = this.vALUECOLUMNNAME; + return data; + } +} + +class PARENTSEGMENTSDVSplited { + String? isRequired; + String? name; + + PARENTSEGMENTSDVSplited({this.isRequired, this.name}); + + PARENTSEGMENTSDVSplited.fromJson(Map json) { + isRequired = json['IsRequired']; + name = json['Name']; + } + + Map toJson() { + final Map data = new Map(); + data['IsRequired'] = this.isRequired; + data['Name'] = this.name; + return data; + } +} + +class PARENTSEGMENTSVSSplitedVS { + String? isRequired; + String? name; + + PARENTSEGMENTSVSSplitedVS({this.isRequired, this.name}); + + PARENTSEGMENTSVSSplitedVS.fromJson(Map json) { + isRequired = json['IsRequired']; + name = json['Name']; + } + + Map toJson() { + final Map data = new Map(); + data['IsRequired'] = this.isRequired; + data['Name'] = this.name; + return data; + } +} diff --git a/lib/models/get_eit_transaction_list_model.dart b/lib/models/get_eit_transaction_list_model.dart new file mode 100644 index 0000000..d2ff7c0 --- /dev/null +++ b/lib/models/get_eit_transaction_list_model.dart @@ -0,0 +1,104 @@ +class GetEITTransactionList { + List? collectionTransaction; + + GetEITTransactionList({this.collectionTransaction}); + + GetEITTransactionList.fromJson(Map json) { + if (json['Collection_Transaction'] != null) { + collectionTransaction = []; + json['Collection_Transaction'].forEach((v) { + collectionTransaction!.add(new CollectionTransaction.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.collectionTransaction != null) { + data['Collection_Transaction'] = + this.collectionTransaction!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class CollectionTransaction { + String? aPPLICATIONCOLUMNNAME; + String? dATATYPE; + String? dATEVALUE; + String? dESCFLEXCONTEXTCODE; + String? dESCFLEXNAME; + String? dISPLAYFLAG; + int? fROMROWNUM; + int? nOOFROWS; + int? nUMBERVALUE; + int? rOWNUM; + String? sEGMENTNAME; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? sEGMENTVALUEDSP; + int? tOROWNUM; + int? tRANSACTIONNUMBER; + String? vARCHAR2VALUE; + + 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}); + + CollectionTransaction.fromJson(Map json) { + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + dATATYPE = json['DATATYPE']; + dATEVALUE = json['DATE_VALUE']; + dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE']; + dESCFLEXNAME = json['DESC_FLEX_NAME']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + fROMROWNUM = json['FROM_ROW_NUM']; + nOOFROWS = json['NO_OF_ROWS']; + nUMBERVALUE = json['NUMBER_VALUE']; + rOWNUM = json['ROW_NUM']; + sEGMENTNAME = json['SEGMENT_NAME']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + sEGMENTVALUEDSP = json['SEGMENT_VALUE_DSP']; + tOROWNUM = json['TO_ROW_NUM']; + tRANSACTIONNUMBER = json['TRANSACTION_NUMBER']; + vARCHAR2VALUE = json['VARCHAR2_VALUE']; + } + + Map toJson() { + final Map data = new Map(); + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['DATATYPE'] = this.dATATYPE; + data['DATE_VALUE'] = this.dATEVALUE; + data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE; + data['DESC_FLEX_NAME'] = this.dESCFLEXNAME; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['NUMBER_VALUE'] = this.nUMBERVALUE; + data['ROW_NUM'] = this.rOWNUM; + data['SEGMENT_NAME'] = this.sEGMENTNAME; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['SEGMENT_VALUE_DSP'] = this.sEGMENTVALUEDSP; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['TRANSACTION_NUMBER'] = this.tRANSACTIONNUMBER; + data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_employee_address_model.dart b/lib/models/get_employee_address_model.dart new file mode 100644 index 0000000..1033797 --- /dev/null +++ b/lib/models/get_employee_address_model.dart @@ -0,0 +1,50 @@ + + + class GetEmployeeAddressList { + String? aPPLICATIONCOLUMNNAME; + String? dATATYPE; + String? dATEVALUE; + String? dISPLAYFLAG; + Null? nUMBERVALUE; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? sEGMENTVALUEDSP; + String? vARCHAR2VALUE; + + GetEmployeeAddressList( + {this.aPPLICATIONCOLUMNNAME, + this.dATATYPE, + this.dATEVALUE, + this.dISPLAYFLAG, + this.nUMBERVALUE, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.sEGMENTVALUEDSP, + this.vARCHAR2VALUE}); + + GetEmployeeAddressList.fromJson(Map json) { + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + dATATYPE = json['DATATYPE']; + dATEVALUE = json['DATE_VALUE']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + nUMBERVALUE = json['NUMBER_VALUE']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + sEGMENTVALUEDSP = json['SEGMENT_VALUE_DSP']; + vARCHAR2VALUE = json['VARCHAR2_VALUE']; + } + + Map toJson() { + final Map data = new Map(); + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['DATATYPE'] = this.dATATYPE; + data['DATE_VALUE'] = this.dATEVALUE; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['NUMBER_VALUE'] = this.nUMBERVALUE; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['SEGMENT_VALUE_DSP'] = this.sEGMENTVALUEDSP; + data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE; + return data; + } + } diff --git a/lib/models/get_employee_basic_details.model.dart b/lib/models/get_employee_basic_details.model.dart new file mode 100644 index 0000000..06713c0 --- /dev/null +++ b/lib/models/get_employee_basic_details.model.dart @@ -0,0 +1,53 @@ + +class GetEmployeeBasicDetailsList { + String? aPPLICATIONCOLUMNNAME; + String? dATATYPE; + String? dATEVALUE; + String? dISPLAYFLAG; + int? gROUPNUM; + int? nUMBERVALUE; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? sEGMENTVALUEDSP; + String? vARCHAR2VALUE; + + GetEmployeeBasicDetailsList( + {this.aPPLICATIONCOLUMNNAME, + this.dATATYPE, + this.dATEVALUE, + this.dISPLAYFLAG, + this.gROUPNUM, + this.nUMBERVALUE, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.sEGMENTVALUEDSP, + this.vARCHAR2VALUE}); + + GetEmployeeBasicDetailsList.fromJson(Map json) { + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + dATATYPE = json['DATATYPE']; + dATEVALUE = json['DATE_VALUE']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + gROUPNUM = json['GROUP_NUM']; + nUMBERVALUE = json['NUMBER_VALUE']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + sEGMENTVALUEDSP = json['SEGMENT_VALUE_DSP']; + vARCHAR2VALUE = json['VARCHAR2_VALUE']; + } + + Map toJson() { + final Map data = new Map(); + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['DATATYPE'] = this.dATATYPE; + data['DATE_VALUE'] = this.dATEVALUE; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['GROUP_NUM'] = this.gROUPNUM; + data['NUMBER_VALUE'] = this.nUMBERVALUE; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['SEGMENT_VALUE_DSP'] = this.sEGMENTVALUEDSP; + data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_employee_contacts.model.dart b/lib/models/get_employee_contacts.model.dart new file mode 100644 index 0000000..4064d10 --- /dev/null +++ b/lib/models/get_employee_contacts.model.dart @@ -0,0 +1,45 @@ + +class GetEmployeeContactsList { + String? cONTACTNAME; + int? cONTACTPERSONID; + int? cONTACTRELATIONSHIPID; + String? cONTACTTYPE; + String? dATEOFBIRTH; + int? pERSONID; + String? pRIMARYCONTACTFLAG; + String? rELATIONSHIP; + + GetEmployeeContactsList( + {this.cONTACTNAME, + this.cONTACTPERSONID, + this.cONTACTRELATIONSHIPID, + this.cONTACTTYPE, + this.dATEOFBIRTH, + this.pERSONID, + this.pRIMARYCONTACTFLAG, + this.rELATIONSHIP}); + + GetEmployeeContactsList.fromJson(Map json) { + cONTACTNAME = json['CONTACT_NAME']; + cONTACTPERSONID = json['CONTACT_PERSON_ID']; + cONTACTRELATIONSHIPID = json['CONTACT_RELATIONSHIP_ID']; + cONTACTTYPE = json['CONTACT_TYPE']; + dATEOFBIRTH = json['DATE_OF_BIRTH']; + pERSONID = json['PERSON_ID']; + pRIMARYCONTACTFLAG = json['PRIMARY_CONTACT_FLAG']; + rELATIONSHIP = json['RELATIONSHIP']; + } + + Map toJson() { + final Map data = new Map(); + data['CONTACT_NAME'] = this.cONTACTNAME; + data['CONTACT_PERSON_ID'] = this.cONTACTPERSONID; + data['CONTACT_RELATIONSHIP_ID'] = this.cONTACTRELATIONSHIPID; + data['CONTACT_TYPE'] = this.cONTACTTYPE; + data['DATE_OF_BIRTH'] = this.dATEOFBIRTH; + data['PERSON_ID'] = this.pERSONID; + data['PRIMARY_CONTACT_FLAG'] = this.pRIMARYCONTACTFLAG; + data['RELATIONSHIP'] = this.rELATIONSHIP; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_employee_phones_model.dart b/lib/models/get_employee_phones_model.dart new file mode 100644 index 0000000..1fbba7f --- /dev/null +++ b/lib/models/get_employee_phones_model.dart @@ -0,0 +1,53 @@ + +class GetEmployeePhonesList { + String? dATEFROM; + String? dATETO; + int? oBJECTVERSIONNUMBER; + int? pARENTID; + String? pARENTTABLE; + int? pHONEID; + String? pHONENUMBER; + String? pHONETYPE; + String? pHONETYPEMEANING; + int? rOWINDEX; + + GetEmployeePhonesList( + {this.dATEFROM, + this.dATETO, + this.oBJECTVERSIONNUMBER, + this.pARENTID, + this.pARENTTABLE, + this.pHONEID, + this.pHONENUMBER, + this.pHONETYPE, + this.pHONETYPEMEANING, + this.rOWINDEX}); + + GetEmployeePhonesList.fromJson(Map json) { + dATEFROM = json['DATE_FROM']; + dATETO = json['DATE_TO']; + oBJECTVERSIONNUMBER = json['OBJECT_VERSION_NUMBER']; + pARENTID = json['PARENT_ID']; + pARENTTABLE = json['PARENT_TABLE']; + pHONEID = json['PHONE_ID']; + pHONENUMBER = json['PHONE_NUMBER']; + pHONETYPE = json['PHONE_TYPE']; + pHONETYPEMEANING = json['PHONE_TYPE_MEANING']; + rOWINDEX = json['ROW_INDEX']; + } + + Map toJson() { + final Map data = new Map(); + data['DATE_FROM'] = this.dATEFROM; + data['DATE_TO'] = this.dATETO; + data['OBJECT_VERSION_NUMBER'] = this.oBJECTVERSIONNUMBER; + data['PARENT_ID'] = this.pARENTID; + data['PARENT_TABLE'] = this.pARENTTABLE; + data['PHONE_ID'] = this.pHONEID; + data['PHONE_NUMBER'] = this.pHONENUMBER; + data['PHONE_TYPE'] = this.pHONETYPE; + data['PHONE_TYPE_MEANING'] = this.pHONETYPEMEANING; + data['ROW_INDEX'] = this.rOWINDEX; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_item_creation_ntf_body_list_model.dart b/lib/models/get_item_creation_ntf_body_list_model.dart new file mode 100644 index 0000000..83c81cb --- /dev/null +++ b/lib/models/get_item_creation_ntf_body_list_model.dart @@ -0,0 +1,292 @@ +class GetItemCreationNtfBodyList { + List? itemCreationHeader; + List? itemCreationLines; + String? pINFORMATION; + String? pQUESTION; + + GetItemCreationNtfBodyList({this.itemCreationHeader, this.itemCreationLines, this.pINFORMATION, this.pQUESTION}); + + GetItemCreationNtfBodyList.fromJson(Map json) { + if (json['ItemCreationHeader'] != null) { + itemCreationHeader = []; + json['ItemCreationHeader'].forEach((v) { + itemCreationHeader!.add(new ItemCreationHeader.fromJson(v)); + }); + } + if (json['ItemCreationLines'] != null) { + itemCreationLines = []; + json['ItemCreationLines'].forEach((v) { + itemCreationLines!.add(new ItemCreationLines.fromJson(v)); + }); + } + pINFORMATION = json['P_INFORMATION']; + pQUESTION = json['P_QUESTION']; + } + + Map toJson() { + final Map data = new Map(); + if (this.itemCreationHeader != null) { + data['ItemCreationHeader'] = this.itemCreationHeader!.map((v) => v.toJson()).toList(); + } + if (this.itemCreationLines != null) { + data['ItemCreationLines'] = this.itemCreationLines!.map((v) => v.toJson()).toList(); + } + data['P_INFORMATION'] = this.pINFORMATION; + data['P_QUESTION'] = this.pQUESTION; + return data; + } +} + +class ItemCreationHeader { + String? aNALYZEDBY; + int? aNALYZEDBYID; + String? aNALYZEDDATE; + String? aPPROVEDDATE; + String? cATEGORY; + int? cATEGORYID; + String? iTEMTYPE; + String? oPERATINGUNIT; + int? oRGID; + int? rELATEDID; + String? rELATEDTO; + String? rEQUESTER; + int? rEQUESTERID; + String? rEQUESTDATE; + String? sTATUS; + int? tRANSACTIONHEADERID; + String? uRGENTFLAG; + String? uRGENTFLAGDISP; + String? wFITEMKEYANALYSIS; + String? wFITEMKEYAPPROVAL; + String? wFITEMTYPE; + + ItemCreationHeader( + {this.aNALYZEDBY, + this.aNALYZEDBYID, + this.aNALYZEDDATE, + this.aPPROVEDDATE, + this.cATEGORY, + this.cATEGORYID, + this.iTEMTYPE, + this.oPERATINGUNIT, + this.oRGID, + this.rELATEDID, + this.rELATEDTO, + this.rEQUESTER, + this.rEQUESTERID, + this.rEQUESTDATE, + this.sTATUS, + this.tRANSACTIONHEADERID, + this.uRGENTFLAG, + this.uRGENTFLAGDISP, + this.wFITEMKEYANALYSIS, + this.wFITEMKEYAPPROVAL, + this.wFITEMTYPE}); + + ItemCreationHeader.fromJson(Map json) { + aNALYZEDBY = json['ANALYZED_BY']; + aNALYZEDBYID = json['ANALYZED_BY_ID']; + aNALYZEDDATE = json['ANALYZED_DATE']; + aPPROVEDDATE = json['APPROVED_DATE']; + cATEGORY = json['CATEGORY']; + cATEGORYID = json['CATEGORY_ID']; + iTEMTYPE = json['ITEM_TYPE']; + oPERATINGUNIT = json['OPERATING_UNIT']; + oRGID = json['ORG_ID']; + rELATEDID = json['RELATED_ID']; + rELATEDTO = json['RELATED_TO']; + rEQUESTER = json['REQUESTER']; + rEQUESTERID = json['REQUESTER_ID']; + rEQUESTDATE = json['REQUEST_DATE']; + sTATUS = json['STATUS']; + tRANSACTIONHEADERID = json['TRANSACTION_HEADER_ID']; + uRGENTFLAG = json['URGENT_FLAG']; + uRGENTFLAGDISP = json['URGENT_FLAG_DISP']; + wFITEMKEYANALYSIS = json['WF_ITEM_KEY_ANALYSIS']; + wFITEMKEYAPPROVAL = json['WF_ITEM_KEY_APPROVAL']; + wFITEMTYPE = json['WF_ITEM_TYPE']; + } + + Map toJson() { + final Map data = new Map(); + data['ANALYZED_BY'] = this.aNALYZEDBY; + data['ANALYZED_BY_ID'] = this.aNALYZEDBYID; + data['ANALYZED_DATE'] = this.aNALYZEDDATE; + data['APPROVED_DATE'] = this.aPPROVEDDATE; + data['CATEGORY'] = this.cATEGORY; + data['CATEGORY_ID'] = this.cATEGORYID; + data['ITEM_TYPE'] = this.iTEMTYPE; + data['OPERATING_UNIT'] = this.oPERATINGUNIT; + data['ORG_ID'] = this.oRGID; + data['RELATED_ID'] = this.rELATEDID; + data['RELATED_TO'] = this.rELATEDTO; + data['REQUESTER'] = this.rEQUESTER; + data['REQUESTER_ID'] = this.rEQUESTERID; + data['REQUEST_DATE'] = this.rEQUESTDATE; + data['STATUS'] = this.sTATUS; + data['TRANSACTION_HEADER_ID'] = this.tRANSACTIONHEADERID; + data['URGENT_FLAG'] = this.uRGENTFLAG; + data['URGENT_FLAG_DISP'] = this.uRGENTFLAGDISP; + data['WF_ITEM_KEY_ANALYSIS'] = this.wFITEMKEYANALYSIS; + data['WF_ITEM_KEY_APPROVAL'] = this.wFITEMKEYAPPROVAL; + data['WF_ITEM_TYPE'] = this.wFITEMTYPE; + return data; + } +} + +class ItemCreationLines { + String? cHARGETOPATIENT; + int? fROMROWNUM; + int? iNVENTORYITEMID; + String? iTEMCODE; + String? iTEMCREATIONSTATUS; + String? iTEMCREATIONSTATUSDISP; + String? iTEMDESCRIPTION; + String? iTEMGROUP; + String? iTEMGROUPCODE; + String? iTEMSUBGROUP; + String? iTEMSUBGROUPCODE; + String? iTEMTYPE; + String? jUSTIFICATION; + int? lINENUMBER; + int? nOOFROWS; + String? pRIMARYUOM; + String? pRIMARYUOMCODE; + String? pRODUCTDESCRIPTION; + String? pRODUCTNAME; + int? rOWNUM; + String? sTANARDSTATUSDISP; + int? sTANDARDMANUFACTURERID; + String? sTANDARDMANUFACTURERNAME; + String? sTANDARDMFGPARTNUM; + String? sTANDARDREJECTREASON; + String? sTANDARDSTATUS; + String? sUPPLIERCONTACT; + String? sUPPLIERNAME; + int? tEMPLATEID; + String? tEMPLATENAME; + int? tOROWNUM; + int? tRANSACTIONHEADERID; + int? tRANSACTIONLINEID; + int? uNITPRICE; + String? uSERMANUFACTURERNAME; + String? uSERMFGPARTNUM; + + ItemCreationLines( + {this.cHARGETOPATIENT, + this.fROMROWNUM, + this.iNVENTORYITEMID, + this.iTEMCODE, + this.iTEMCREATIONSTATUS, + this.iTEMCREATIONSTATUSDISP, + this.iTEMDESCRIPTION, + this.iTEMGROUP, + this.iTEMGROUPCODE, + this.iTEMSUBGROUP, + this.iTEMSUBGROUPCODE, + this.iTEMTYPE, + this.jUSTIFICATION, + this.lINENUMBER, + this.nOOFROWS, + this.pRIMARYUOM, + this.pRIMARYUOMCODE, + this.pRODUCTDESCRIPTION, + this.pRODUCTNAME, + this.rOWNUM, + this.sTANARDSTATUSDISP, + this.sTANDARDMANUFACTURERID, + this.sTANDARDMANUFACTURERNAME, + this.sTANDARDMFGPARTNUM, + this.sTANDARDREJECTREASON, + this.sTANDARDSTATUS, + this.sUPPLIERCONTACT, + this.sUPPLIERNAME, + this.tEMPLATEID, + this.tEMPLATENAME, + this.tOROWNUM, + this.tRANSACTIONHEADERID, + this.tRANSACTIONLINEID, + this.uNITPRICE, + this.uSERMANUFACTURERNAME, + this.uSERMFGPARTNUM}); + + ItemCreationLines.fromJson(Map json) { + cHARGETOPATIENT = json['CHARGE_TO_PATIENT']; + fROMROWNUM = json['FROM_ROW_NUM']; + iNVENTORYITEMID = json['INVENTORY_ITEM_ID']; + iTEMCODE = json['ITEM_CODE']; + iTEMCREATIONSTATUS = json['ITEM_CREATION_STATUS']; + iTEMCREATIONSTATUSDISP = json['ITEM_CREATION_STATUS_DISP']; + iTEMDESCRIPTION = json['ITEM_DESCRIPTION']; + iTEMGROUP = json['ITEM_GROUP']; + iTEMGROUPCODE = json['ITEM_GROUP_CODE']; + iTEMSUBGROUP = json['ITEM_SUBGROUP']; + iTEMSUBGROUPCODE = json['ITEM_SUBGROUP_CODE']; + iTEMTYPE = json['ITEM_TYPE']; + jUSTIFICATION = json['JUSTIFICATION']; + lINENUMBER = json['LINE_NUMBER']; + nOOFROWS = json['NO_OF_ROWS']; + pRIMARYUOM = json['PRIMARY_UOM']; + pRIMARYUOMCODE = json['PRIMARY_UOM_CODE']; + pRODUCTDESCRIPTION = json['PRODUCT_DESCRIPTION']; + pRODUCTNAME = json['PRODUCT_NAME']; + rOWNUM = json['ROW_NUM']; + sTANARDSTATUSDISP = json['STANARD_STATUS_DISP']; + sTANDARDMANUFACTURERID = json['STANDARD_MANUFACTURER_ID']; + sTANDARDMANUFACTURERNAME = json['STANDARD_MANUFACTURER_NAME']; + sTANDARDMFGPARTNUM = json['STANDARD_MFG_PART_NUM']; + sTANDARDREJECTREASON = json['STANDARD_REJECT_REASON']; + sTANDARDSTATUS = json['STANDARD_STATUS']; + sUPPLIERCONTACT = json['SUPPLIER_CONTACT']; + sUPPLIERNAME = json['SUPPLIER_NAME']; + tEMPLATEID = json['TEMPLATE_ID']; + tEMPLATENAME = json['TEMPLATE_NAME']; + tOROWNUM = json['TO_ROW_NUM']; + tRANSACTIONHEADERID = json['TRANSACTION_HEADER_ID']; + tRANSACTIONLINEID = json['TRANSACTION_LINE_ID']; + uNITPRICE = json['UNIT_PRICE']; + uSERMANUFACTURERNAME = json['USER_MANUFACTURER_NAME']; + uSERMFGPARTNUM = json['USER_MFG_PART_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['CHARGE_TO_PATIENT'] = this.cHARGETOPATIENT; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['INVENTORY_ITEM_ID'] = this.iNVENTORYITEMID; + data['ITEM_CODE'] = this.iTEMCODE; + data['ITEM_CREATION_STATUS'] = this.iTEMCREATIONSTATUS; + data['ITEM_CREATION_STATUS_DISP'] = this.iTEMCREATIONSTATUSDISP; + data['ITEM_DESCRIPTION'] = this.iTEMDESCRIPTION; + data['ITEM_GROUP'] = this.iTEMGROUP; + data['ITEM_GROUP_CODE'] = this.iTEMGROUPCODE; + data['ITEM_SUBGROUP'] = this.iTEMSUBGROUP; + data['ITEM_SUBGROUP_CODE'] = this.iTEMSUBGROUPCODE; + data['ITEM_TYPE'] = this.iTEMTYPE; + data['JUSTIFICATION'] = this.jUSTIFICATION; + data['LINE_NUMBER'] = this.lINENUMBER; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['PRIMARY_UOM'] = this.pRIMARYUOM; + data['PRIMARY_UOM_CODE'] = this.pRIMARYUOMCODE; + data['PRODUCT_DESCRIPTION'] = this.pRODUCTDESCRIPTION; + data['PRODUCT_NAME'] = this.pRODUCTNAME; + data['ROW_NUM'] = this.rOWNUM; + data['STANARD_STATUS_DISP'] = this.sTANARDSTATUSDISP; + data['STANDARD_MANUFACTURER_ID'] = this.sTANDARDMANUFACTURERID; + data['STANDARD_MANUFACTURER_NAME'] = this.sTANDARDMANUFACTURERNAME; + data['STANDARD_MFG_PART_NUM'] = this.sTANDARDMFGPARTNUM; + data['STANDARD_REJECT_REASON'] = this.sTANDARDREJECTREASON; + data['STANDARD_STATUS'] = this.sTANDARDSTATUS; + data['SUPPLIER_CONTACT'] = this.sUPPLIERCONTACT; + data['SUPPLIER_NAME'] = this.sUPPLIERNAME; + data['TEMPLATE_ID'] = this.tEMPLATEID; + data['TEMPLATE_NAME'] = this.tEMPLATENAME; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['TRANSACTION_HEADER_ID'] = this.tRANSACTIONHEADERID; + data['TRANSACTION_LINE_ID'] = this.tRANSACTIONLINEID; + data['UNIT_PRICE'] = this.uNITPRICE; + data['USER_MANUFACTURER_NAME'] = this.uSERMANUFACTURERNAME; + data['USER_MFG_PART_NUM'] = this.uSERMFGPARTNUM; + return data; + } +} diff --git a/lib/models/get_mo_Item_history_list_model.dart b/lib/models/get_mo_Item_history_list_model.dart new file mode 100644 index 0000000..3604322 --- /dev/null +++ b/lib/models/get_mo_Item_history_list_model.dart @@ -0,0 +1,100 @@ +class GetMoItemHistoryList { + String? dATEREQUIRED; + String? dESCRIPTION; + String? fROMLOCATOR; + int? fROMROWNUM; + String? fROMSUBINVENTORYCODE; + String? iTEMCODE; + String? lINESTATUSDIS; + int? nOOFROWS; + String? oPERATINGUNITNAME; + String? oRGANIZATIONCODE; + int? oRGANIZATIONID; + String? oRGANIZATIONNAME; + int? qUANTITY; + String? rEQUESTNUMBER; + int? rOWNUM; + String? sHIPTOLOCATION; + String? sTATUSDATE; + String? tOLOCATOR; + int? tOROWNUM; + String? tOSUBINVENTORYCODE; + String? tRANSACTIONTYPENAME; + String? uNITOFMEASURE; + + GetMoItemHistoryList( + {this.dATEREQUIRED, + this.dESCRIPTION, + this.fROMLOCATOR, + this.fROMROWNUM, + this.fROMSUBINVENTORYCODE, + this.iTEMCODE, + this.lINESTATUSDIS, + this.nOOFROWS, + this.oPERATINGUNITNAME, + this.oRGANIZATIONCODE, + this.oRGANIZATIONID, + this.oRGANIZATIONNAME, + this.qUANTITY, + this.rEQUESTNUMBER, + this.rOWNUM, + this.sHIPTOLOCATION, + this.sTATUSDATE, + this.tOLOCATOR, + this.tOROWNUM, + this.tOSUBINVENTORYCODE, + this.tRANSACTIONTYPENAME, + this.uNITOFMEASURE}); + + GetMoItemHistoryList.fromJson(Map json) { + dATEREQUIRED = json['DATE_REQUIRED']; + dESCRIPTION = json['DESCRIPTION']; + fROMLOCATOR = json['FROM_LOCATOR']; + fROMROWNUM = json['FROM_ROW_NUM']; + fROMSUBINVENTORYCODE = json['FROM_SUBINVENTORY_CODE']; + iTEMCODE = json['ITEM_CODE']; + lINESTATUSDIS = json['LINE_STATUS_DIS']; + nOOFROWS = json['NO_OF_ROWS']; + oPERATINGUNITNAME = json['OPERATING_UNIT_NAME']; + oRGANIZATIONCODE = json['ORGANIZATION_CODE']; + oRGANIZATIONID = json['ORGANIZATION_ID']; + oRGANIZATIONNAME = json['ORGANIZATION_NAME']; + qUANTITY = json['QUANTITY']; + rEQUESTNUMBER = json['REQUEST_NUMBER']; + rOWNUM = json['ROW_NUM']; + sHIPTOLOCATION = json['SHIP_TO_LOCATION']; + sTATUSDATE = json['STATUS_DATE']; + tOLOCATOR = json['TO_LOCATOR']; + tOROWNUM = json['TO_ROW_NUM']; + tOSUBINVENTORYCODE = json['TO_SUBINVENTORY_CODE']; + tRANSACTIONTYPENAME = json['TRANSACTION_TYPE_NAME']; + uNITOFMEASURE = json['UNIT_OF_MEASURE']; + } + + Map toJson() { + final Map data = new Map(); + data['DATE_REQUIRED'] = this.dATEREQUIRED; + data['DESCRIPTION'] = this.dESCRIPTION; + data['FROM_LOCATOR'] = this.fROMLOCATOR; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['FROM_SUBINVENTORY_CODE'] = this.fROMSUBINVENTORYCODE; + data['ITEM_CODE'] = this.iTEMCODE; + data['LINE_STATUS_DIS'] = this.lINESTATUSDIS; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['OPERATING_UNIT_NAME'] = this.oPERATINGUNITNAME; + data['ORGANIZATION_CODE'] = this.oRGANIZATIONCODE; + data['ORGANIZATION_ID'] = this.oRGANIZATIONID; + data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME; + data['QUANTITY'] = this.qUANTITY; + data['REQUEST_NUMBER'] = this.rEQUESTNUMBER; + data['ROW_NUM'] = this.rOWNUM; + data['SHIP_TO_LOCATION'] = this.sHIPTOLOCATION; + data['STATUS_DATE'] = this.sTATUSDATE; + data['TO_LOCATOR'] = this.tOLOCATOR; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['TO_SUBINVENTORY_CODE'] = this.tOSUBINVENTORYCODE; + data['TRANSACTION_TYPE_NAME'] = this.tRANSACTIONTYPENAME; + data['UNIT_OF_MEASURE'] = this.uNITOFMEASURE; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_mo_notification_body_list_model.dart b/lib/models/get_mo_notification_body_list_model.dart new file mode 100644 index 0000000..613d10f --- /dev/null +++ b/lib/models/get_mo_notification_body_list_model.dart @@ -0,0 +1,104 @@ +class GetMoNotificationBodyList { + String? dATEREQUIRED; + String? dESCRIPTION; + String? fROMLOCATOR; + int? fROMROWNUM; + String? fROMSUBINVENTORY; + String? iTEMCODE; + int? iTEMID; + int? lINENUMBER; + String? lINESTATUS; + int? nOOFROWS; + String? oPERATINGUNIT; + String? oRGANIZATIONCODE; + String? oRGANIZATIONNAME; + int? oRGID; + int? qUANTITY; + int? rOWNUM; + String? sHIPTOLOCATION; + String? sTATUSDATE; + String? tOLOCATOR; + int? tOROWNUM; + String? tOSUBINVENTORY; + String? tRANSACTIONTYPENAME; + String? uOM; + + GetMoNotificationBodyList( + {this.dATEREQUIRED, + this.dESCRIPTION, + this.fROMLOCATOR, + this.fROMROWNUM, + this.fROMSUBINVENTORY, + this.iTEMCODE, + this.iTEMID, + this.lINENUMBER, + this.lINESTATUS, + this.nOOFROWS, + this.oPERATINGUNIT, + this.oRGANIZATIONCODE, + this.oRGANIZATIONNAME, + this.oRGID, + this.qUANTITY, + this.rOWNUM, + this.sHIPTOLOCATION, + this.sTATUSDATE, + this.tOLOCATOR, + this.tOROWNUM, + this.tOSUBINVENTORY, + this.tRANSACTIONTYPENAME, + this.uOM}); + + GetMoNotificationBodyList.fromJson(Map json) { + dATEREQUIRED = json['DATE_REQUIRED']; + dESCRIPTION = json['DESCRIPTION']; + fROMLOCATOR = json['FROM_LOCATOR']; + fROMROWNUM = json['FROM_ROW_NUM']; + fROMSUBINVENTORY = json['FROM_SUBINVENTORY']; + iTEMCODE = json['ITEM_CODE']; + iTEMID = json['ITEM_ID']; + lINENUMBER = json['LINE_NUMBER']; + lINESTATUS = json['LINE_STATUS']; + nOOFROWS = json['NO_OF_ROWS']; + oPERATINGUNIT = json['OPERATING_UNIT']; + oRGANIZATIONCODE = json['ORGANIZATION_CODE']; + oRGANIZATIONNAME = json['ORGANIZATION_NAME']; + oRGID = json['ORG_ID']; + qUANTITY = json['QUANTITY']; + rOWNUM = json['ROW_NUM']; + sHIPTOLOCATION = json['SHIP_TO_LOCATION']; + sTATUSDATE = json['STATUS_DATE']; + tOLOCATOR = json['TO_LOCATOR']; + tOROWNUM = json['TO_ROW_NUM']; + tOSUBINVENTORY = json['TO_SUBINVENTORY']; + tRANSACTIONTYPENAME = json['TRANSACTION_TYPE_NAME']; + uOM = json['UOM']; + } + + Map toJson() { + final Map data = new Map(); + data['DATE_REQUIRED'] = this.dATEREQUIRED; + data['DESCRIPTION'] = this.dESCRIPTION; + data['FROM_LOCATOR'] = this.fROMLOCATOR; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['FROM_SUBINVENTORY'] = this.fROMSUBINVENTORY; + data['ITEM_CODE'] = this.iTEMCODE; + data['ITEM_ID'] = this.iTEMID; + data['LINE_NUMBER'] = this.lINENUMBER; + data['LINE_STATUS'] = this.lINESTATUS; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['OPERATING_UNIT'] = this.oPERATINGUNIT; + data['ORGANIZATION_CODE'] = this.oRGANIZATIONCODE; + data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME; + data['ORG_ID'] = this.oRGID; + data['QUANTITY'] = this.qUANTITY; + data['ROW_NUM'] = this.rOWNUM; + data['SHIP_TO_LOCATION'] = this.sHIPTOLOCATION; + data['STATUS_DATE'] = this.sTATUSDATE; + data['TO_LOCATOR'] = this.tOLOCATOR; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['TO_SUBINVENTORY'] = this.tOSUBINVENTORY; + data['TRANSACTION_TYPE_NAME'] = this.tRANSACTIONTYPENAME; + data['UOM'] = this.uOM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_notification_buttons_list_model.dart b/lib/models/get_notification_buttons_list_model.dart new file mode 100644 index 0000000..a6b29d2 --- /dev/null +++ b/lib/models/get_notification_buttons_list_model.dart @@ -0,0 +1,25 @@ +class GetNotificationButtonsList { + String? bUTTONACTION; + String? bUTTONICON; + String? bUTTONLABEL; + int? bUTTONSEQ; + + GetNotificationButtonsList( + {this.bUTTONACTION, this.bUTTONICON, this.bUTTONLABEL, this.bUTTONSEQ}); + + GetNotificationButtonsList.fromJson(Map json) { + bUTTONACTION = json['BUTTON_ACTION']; + bUTTONICON = json['BUTTON_ICON']; + bUTTONLABEL = json['BUTTON_LABEL']; + bUTTONSEQ = json['BUTTON_SEQ']; + } + + Map toJson() { + final Map data = new Map(); + data['BUTTON_ACTION'] = this.bUTTONACTION; + data['BUTTON_ICON'] = this.bUTTONICON; + data['BUTTON_LABEL'] = this.bUTTONLABEL; + data['BUTTON_SEQ'] = this.bUTTONSEQ; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_po_Item_history_list_model.dart b/lib/models/get_po_Item_history_list_model.dart new file mode 100644 index 0000000..d51861b --- /dev/null +++ b/lib/models/get_po_Item_history_list_model.dart @@ -0,0 +1,92 @@ +class GetPoItemHistoryList { + int? bALANCEQUANTITY; + int? bONUSQUANTITY; + String? bUYER; + String? cLOSEDCODE; + String? cREATIONDATE; + int? dISCOUNTPERCENTAGE; + int? fROMROWNUM; + int? iTEMID; + int? nETPRICE; + int? nOOFROWS; + String? oUNAME; + String? pONUMBER; + int? pURCHASEPRICE; + int? qUANTITYORDERED; + int? qUANTITYRECEIVED; + int? rEVISIONNUM; + int? rOWNUM; + String? sUPPLIER; + int? tOROWNUM; + String? uOM; + + GetPoItemHistoryList( + {this.bALANCEQUANTITY, + this.bONUSQUANTITY, + this.bUYER, + this.cLOSEDCODE, + this.cREATIONDATE, + this.dISCOUNTPERCENTAGE, + this.fROMROWNUM, + this.iTEMID, + this.nETPRICE, + this.nOOFROWS, + this.oUNAME, + this.pONUMBER, + this.pURCHASEPRICE, + this.qUANTITYORDERED, + this.qUANTITYRECEIVED, + this.rEVISIONNUM, + this.rOWNUM, + this.sUPPLIER, + this.tOROWNUM, + this.uOM}); + + GetPoItemHistoryList.fromJson(Map json) { + bALANCEQUANTITY = json['BALANCE_QUANTITY']; + bONUSQUANTITY = json['BONUS_QUANTITY']; + bUYER = json['BUYER']; + cLOSEDCODE = json['CLOSED_CODE']; + cREATIONDATE = json['CREATION_DATE']; + dISCOUNTPERCENTAGE = json['DISCOUNT_PERCENTAGE']; + fROMROWNUM = json['FROM_ROW_NUM']; + iTEMID = json['ITEM_ID']; + nETPRICE = json['NET_PRICE']; + nOOFROWS = json['NO_OF_ROWS']; + oUNAME = json['OU_NAME']; + pONUMBER = json['PO_NUMBER']; + pURCHASEPRICE = json['PURCHASE_PRICE']; + qUANTITYORDERED = json['QUANTITY_ORDERED']; + qUANTITYRECEIVED = json['QUANTITY_RECEIVED']; + rEVISIONNUM = json['REVISION_NUM']; + rOWNUM = json['ROW_NUM']; + sUPPLIER = json['SUPPLIER']; + tOROWNUM = json['TO_ROW_NUM']; + uOM = json['UOM']; + } + + Map toJson() { + final Map data = new Map(); + data['BALANCE_QUANTITY'] = this.bALANCEQUANTITY; + data['BONUS_QUANTITY'] = this.bONUSQUANTITY; + data['BUYER'] = this.bUYER; + data['CLOSED_CODE'] = this.cLOSEDCODE; + data['CREATION_DATE'] = this.cREATIONDATE; + data['DISCOUNT_PERCENTAGE'] = this.dISCOUNTPERCENTAGE; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['ITEM_ID'] = this.iTEMID; + data['NET_PRICE'] = this.nETPRICE; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['OU_NAME'] = this.oUNAME; + data['PO_NUMBER'] = this.pONUMBER; + data['PURCHASE_PRICE'] = this.pURCHASEPRICE; + data['QUANTITY_ORDERED'] = this.qUANTITYORDERED; + data['QUANTITY_RECEIVED'] = this.qUANTITYRECEIVED; + data['REVISION_NUM'] = this.rEVISIONNUM; + data['ROW_NUM'] = this.rOWNUM; + data['SUPPLIER'] = this.sUPPLIER; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['UOM'] = this.uOM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_po_notification_body_list_model.dart b/lib/models/get_po_notification_body_list_model.dart new file mode 100644 index 0000000..7b5c1cb --- /dev/null +++ b/lib/models/get_po_notification_body_list_model.dart @@ -0,0 +1,242 @@ + +class GetPoNotificationBodyList { + List? pOHeader; + List? pOLines; + String? pINFORMATION; + String? pQUESTION; + + GetPoNotificationBodyList( + {this.pOHeader, this.pOLines, this.pINFORMATION, this.pQUESTION}); + + GetPoNotificationBodyList.fromJson(Map json) { + if (json['POHeader'] != null) { + pOHeader = []; + json['POHeader'].forEach((v) { + pOHeader!.add(new POHeader.fromJson(v)); + }); + } + if (json['POLines'] != null) { + pOLines = []; + json['POLines'].forEach((v) { + pOLines!.add(new POLines.fromJson(v)); + }); + } + pINFORMATION = json['P_INFORMATION']; + pQUESTION = json['P_QUESTION']; + } + + Map toJson() { + final Map data = new Map(); + if (this.pOHeader != null) { + data['POHeader'] = this.pOHeader!.map((v) => v.toJson()).toList(); + } + if (this.pOLines != null) { + data['POLines'] = this.pOLines!.map((v) => v.toJson()).toList(); + } + data['P_INFORMATION'] = this.pINFORMATION; + data['P_QUESTION'] = this.pQUESTION; + return data; + } +} + +class POHeader { + String? bUYER; + String? cOMMENTS; + String? cREATIONDATE; + String? cURRENCYNAME; + int? cUSTOMDUTY; + int? dISCOUNTAMOUNT; + int? gROSSAMOUNT; + String? lOCCUR; + int? lOCCURTOTPOAMT; + int? oTHERCHARGES; + String? pAYMENTTERMS; + String? pONUMBER; + String? pREPARER; + String? qUOTATIONDATE; + String? qUOTATIONNUMBER; + int? sALESTAX; + int? sHIPHANDLE; + String? sHIPTOLOCATIONNAME; + int? tOTALPODISCOUNT; + int? tOTPOAMT; + String? tOTPOAMTWORD; + String? vENDORNAME; + String? vENDORSITECODE; + + POHeader( + {this.bUYER, + this.cOMMENTS, + this.cREATIONDATE, + this.cURRENCYNAME, + this.cUSTOMDUTY, + this.dISCOUNTAMOUNT, + this.gROSSAMOUNT, + this.lOCCUR, + this.lOCCURTOTPOAMT, + this.oTHERCHARGES, + this.pAYMENTTERMS, + this.pONUMBER, + this.pREPARER, + this.qUOTATIONDATE, + this.qUOTATIONNUMBER, + this.sALESTAX, + this.sHIPHANDLE, + this.sHIPTOLOCATIONNAME, + this.tOTALPODISCOUNT, + this.tOTPOAMT, + this.tOTPOAMTWORD, + this.vENDORNAME, + this.vENDORSITECODE}); + + POHeader.fromJson(Map json) { + bUYER = json['BUYER']; + cOMMENTS = json['COMMENTS']; + cREATIONDATE = json['CREATION_DATE']; + cURRENCYNAME = json['CURRENCY_NAME']; + cUSTOMDUTY = json['CUSTOM_DUTY']; + dISCOUNTAMOUNT = json['DISCOUNT_AMOUNT']; + gROSSAMOUNT = json['GROSS_AMOUNT']; + lOCCUR = json['LOC_CUR']; + lOCCURTOTPOAMT = json['LOC_CUR_TOT_PO_AMT']; + oTHERCHARGES = json['OTHER_CHARGES']; + pAYMENTTERMS = json['PAYMENT_TERMS']; + pONUMBER = json['PO_NUMBER']; + pREPARER = json['PREPARER']; + qUOTATIONDATE = json['QUOTATION_DATE']; + qUOTATIONNUMBER = json['QUOTATION_NUMBER']; + sALESTAX = json['SALES_TAX']; + sHIPHANDLE = json['SHIP_HANDLE']; + sHIPTOLOCATIONNAME = json['SHIP_TO_LOCATION_NAME']; + tOTALPODISCOUNT = json['TOTAL_PO_DISCOUNT']; + tOTPOAMT = json['TOT_PO_AMT']; + tOTPOAMTWORD = json['TOT_PO_AMT_WORD']; + vENDORNAME = json['VENDOR_NAME']; + vENDORSITECODE = json['VENDOR_SITE_CODE']; + } + + Map toJson() { + final Map data = new Map(); + data['BUYER'] = this.bUYER; + data['COMMENTS'] = this.cOMMENTS; + data['CREATION_DATE'] = this.cREATIONDATE; + data['CURRENCY_NAME'] = this.cURRENCYNAME; + data['CUSTOM_DUTY'] = this.cUSTOMDUTY; + data['DISCOUNT_AMOUNT'] = this.dISCOUNTAMOUNT; + data['GROSS_AMOUNT'] = this.gROSSAMOUNT; + data['LOC_CUR'] = this.lOCCUR; + data['LOC_CUR_TOT_PO_AMT'] = this.lOCCURTOTPOAMT; + data['OTHER_CHARGES'] = this.oTHERCHARGES; + data['PAYMENT_TERMS'] = this.pAYMENTTERMS; + data['PO_NUMBER'] = this.pONUMBER; + data['PREPARER'] = this.pREPARER; + data['QUOTATION_DATE'] = this.qUOTATIONDATE; + data['QUOTATION_NUMBER'] = this.qUOTATIONNUMBER; + data['SALES_TAX'] = this.sALESTAX; + data['SHIP_HANDLE'] = this.sHIPHANDLE; + data['SHIP_TO_LOCATION_NAME'] = this.sHIPTOLOCATIONNAME; + data['TOTAL_PO_DISCOUNT'] = this.tOTALPODISCOUNT; + data['TOT_PO_AMT'] = this.tOTPOAMT; + data['TOT_PO_AMT_WORD'] = this.tOTPOAMTWORD; + data['VENDOR_NAME'] = this.vENDORNAME; + data['VENDOR_SITE_CODE'] = this.vENDORSITECODE; + return data; + } +} + +class POLines { + String? dELIVERTOLOCATION; + int? fROMROWNUM; + String? iTEMCODE; + String? iTEMDESCRIPTION; + int? iTEMID; + int? lINEAMOUNT; + int? lINEDISCPERCENTAGE; + int? lINENUM; + String? lINETYPE; + String? mFG; + String? nEEDBYDATE; + int? nOOFROWS; + int? pOHEADERID; + String? pROMISEDDATE; + String? pRNUM; + int? qUANTITY; + String? rEQUESTOR; + int? rOWNUM; + int? tOROWNUM; + int? uNITPRICE; + String? uOM; + + POLines( + {this.dELIVERTOLOCATION, + this.fROMROWNUM, + this.iTEMCODE, + this.iTEMDESCRIPTION, + this.iTEMID, + this.lINEAMOUNT, + this.lINEDISCPERCENTAGE, + this.lINENUM, + this.lINETYPE, + this.mFG, + this.nEEDBYDATE, + this.nOOFROWS, + this.pOHEADERID, + this.pROMISEDDATE, + this.pRNUM, + this.qUANTITY, + this.rEQUESTOR, + this.rOWNUM, + this.tOROWNUM, + this.uNITPRICE, + this.uOM}); + + POLines.fromJson(Map json) { + dELIVERTOLOCATION = json['DELIVER_TO_LOCATION']; + fROMROWNUM = json['FROM_ROW_NUM']; + iTEMCODE = json['ITEM_CODE']; + iTEMDESCRIPTION = json['ITEM_DESCRIPTION']; + iTEMID = json['ITEM_ID']; + lINEAMOUNT = json['LINE_AMOUNT']; + lINEDISCPERCENTAGE = json['LINE_DISC_PERCENTAGE']; + lINENUM = json['LINE_NUM']; + lINETYPE = json['LINE_TYPE']; + mFG = json['MFG']; + nEEDBYDATE = json['NEED_BY_DATE']; + nOOFROWS = json['NO_OF_ROWS']; + pOHEADERID = json['PO_HEADER_ID']; + pROMISEDDATE = json['PROMISED_DATE']; + pRNUM = json['PR_NUM']; + qUANTITY = json['QUANTITY']; + rEQUESTOR = json['REQUESTOR']; + rOWNUM = json['ROW_NUM']; + tOROWNUM = json['TO_ROW_NUM']; + uNITPRICE = json['UNIT_PRICE']; + uOM = json['UOM']; + } + + Map toJson() { + final Map data = new Map(); + data['DELIVER_TO_LOCATION'] = this.dELIVERTOLOCATION; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['ITEM_CODE'] = this.iTEMCODE; + data['ITEM_DESCRIPTION'] = this.iTEMDESCRIPTION; + data['ITEM_ID'] = this.iTEMID; + data['LINE_AMOUNT'] = this.lINEAMOUNT; + data['LINE_DISC_PERCENTAGE'] = this.lINEDISCPERCENTAGE; + data['LINE_NUM'] = this.lINENUM; + data['LINE_TYPE'] = this.lINETYPE; + data['MFG'] = this.mFG; + data['NEED_BY_DATE'] = this.nEEDBYDATE; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['PO_HEADER_ID'] = this.pOHEADERID; + data['PROMISED_DATE'] = this.pROMISEDDATE; + data['PR_NUM'] = this.pRNUM; + data['QUANTITY'] = this.qUANTITY; + data['REQUESTOR'] = this.rEQUESTOR; + data['ROW_NUM'] = this.rOWNUM; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['UNIT_PRICE'] = this.uNITPRICE; + data['UOM'] = this.uOM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_quotation_analysis_list_model.dart b/lib/models/get_quotation_analysis_list_model.dart new file mode 100644 index 0000000..c0be32d --- /dev/null +++ b/lib/models/get_quotation_analysis_list_model.dart @@ -0,0 +1,84 @@ +class GetQuotationAnalysisList { + int? fROMROWNUM; + String? iTEMCODE; + String? iTEMDESC; + int? nOOFROWS; + String? qUOTBONUSQTY; + String? qUOTDELIVERYDATE; + int? qUOTLINETOTAL; + String? qUOTMFGPARTNUM; + String? qUOTNUM; + int? qUOTQTY; + int? qUOTUNITPRICE; + String? qUOTUOM; + String? rFQNUM; + int? rFQQTY; + String? rFQUOM; + int? rOWNUM; + int? tOROWNUM; + String? vENDORNAME; + + GetQuotationAnalysisList( + {this.fROMROWNUM, + this.iTEMCODE, + this.iTEMDESC, + this.nOOFROWS, + this.qUOTBONUSQTY, + this.qUOTDELIVERYDATE, + this.qUOTLINETOTAL, + this.qUOTMFGPARTNUM, + this.qUOTNUM, + this.qUOTQTY, + this.qUOTUNITPRICE, + this.qUOTUOM, + this.rFQNUM, + this.rFQQTY, + this.rFQUOM, + this.rOWNUM, + this.tOROWNUM, + this.vENDORNAME}); + + GetQuotationAnalysisList.fromJson(Map json) { + fROMROWNUM = json['FROM_ROW_NUM']; + iTEMCODE = json['ITEM_CODE']; + iTEMDESC = json['ITEM_DESC']; + nOOFROWS = json['NO_OF_ROWS']; + qUOTBONUSQTY = json['QUOT_BONUS_QTY']; + qUOTDELIVERYDATE = json['QUOT_DELIVERY_DATE']; + qUOTLINETOTAL = json['QUOT_LINE_TOTAL']; + qUOTMFGPARTNUM = json['QUOT_MFG_PART_NUM']; + qUOTNUM = json['QUOT_NUM']; + qUOTQTY = json['QUOT_QTY']; + qUOTUNITPRICE = json['QUOT_UNIT_PRICE']; + qUOTUOM = json['QUOT_UOM']; + rFQNUM = json['RFQ_NUM']; + rFQQTY = json['RFQ_QTY']; + rFQUOM = json['RFQ_UOM']; + rOWNUM = json['ROW_NUM']; + tOROWNUM = json['TO_ROW_NUM']; + vENDORNAME = json['VENDOR_NAME']; + } + + Map toJson() { + final Map data = new Map(); + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['ITEM_CODE'] = this.iTEMCODE; + data['ITEM_DESC'] = this.iTEMDESC; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['QUOT_BONUS_QTY'] = this.qUOTBONUSQTY; + data['QUOT_DELIVERY_DATE'] = this.qUOTDELIVERYDATE; + data['QUOT_LINE_TOTAL'] = this.qUOTLINETOTAL; + data['QUOT_MFG_PART_NUM'] = this.qUOTMFGPARTNUM; + data['QUOT_NUM'] = this.qUOTNUM; + data['QUOT_QTY'] = this.qUOTQTY; + data['QUOT_UNIT_PRICE'] = this.qUOTUNITPRICE; + data['QUOT_UOM'] = this.qUOTUOM; + data['RFQ_NUM'] = this.rFQNUM; + data['RFQ_QTY'] = this.rFQQTY; + data['RFQ_UOM'] = this.rFQUOM; + data['ROW_NUM'] = this.rOWNUM; + data['TO_ROW_NUM'] = this.tOROWNUM; + data['VENDOR_NAME'] = this.vENDORNAME; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_schedule_shifts_details_list_model.dart b/lib/models/get_schedule_shifts_details_list_model.dart new file mode 100644 index 0000000..8003446 --- /dev/null +++ b/lib/models/get_schedule_shifts_details_list_model.dart @@ -0,0 +1,129 @@ + +class GetScheduleShiftsDetailsList { + String? aCTUALWOBHRS; + String? aPPROVEDENDDATETIME; + String? aPPROVEDENDREASON; + String? aPPROVEDENDREASONDESC; + String? aPPROVEDENDTIME; + String? aPPROVEDSTARTDATETIME; + String? aPPROVEDSTARTREASON; + String? aPPROVEDSTARTREASONDESC; + String? aPPROVEDSTARTTIME; + int? aSSIGNMENTID; + String? bREAKNAME; + int? fROMROWNUM; + int? nOOFROWS; + String? pERCENTAGE; + int? rOWNUM; + int? rTPID; + int? rTPSCHEDULEID; + String? sCHEDULEDATE; + int? sEQNO; + String? sHTACTUALENDDATETIME; + String? sHTACTUALENDTIME; + String? sHTACTUALHRS; + String? sHTACTUALSTARTDATETIME; + String? sHTACTUALSTARTTIME; + String? sHTCODE; + String? sHTNAME; + String? sHTTYPE; + String? sHTTYPEDESC; + int? tOROWNUM; + + GetScheduleShiftsDetailsList( + {this.aCTUALWOBHRS, + this.aPPROVEDENDDATETIME, + this.aPPROVEDENDREASON, + this.aPPROVEDENDREASONDESC, + this.aPPROVEDENDTIME, + this.aPPROVEDSTARTDATETIME, + this.aPPROVEDSTARTREASON, + this.aPPROVEDSTARTREASONDESC, + this.aPPROVEDSTARTTIME, + this.aSSIGNMENTID, + this.bREAKNAME, + this.fROMROWNUM, + this.nOOFROWS, + this.pERCENTAGE, + this.rOWNUM, + this.rTPID, + this.rTPSCHEDULEID, + this.sCHEDULEDATE, + this.sEQNO, + this.sHTACTUALENDDATETIME, + this.sHTACTUALENDTIME, + this.sHTACTUALHRS, + this.sHTACTUALSTARTDATETIME, + this.sHTACTUALSTARTTIME, + this.sHTCODE, + this.sHTNAME, + this.sHTTYPE, + this.sHTTYPEDESC, + this.tOROWNUM}); + + GetScheduleShiftsDetailsList.fromJson(Map json) { + aCTUALWOBHRS = json['ACTUAL_WOB_HRS']; + aPPROVEDENDDATETIME = json['APPROVED_END_DATETIME']; + aPPROVEDENDREASON = json['APPROVED_END_REASON']; + aPPROVEDENDREASONDESC = json['APPROVED_END_REASON_DESC']; + aPPROVEDENDTIME = json['APPROVED_END_TIME']; + aPPROVEDSTARTDATETIME = json['APPROVED_START_DATETIME']; + aPPROVEDSTARTREASON = json['APPROVED_START_REASON']; + aPPROVEDSTARTREASONDESC = json['APPROVED_START_REASON_DESC']; + aPPROVEDSTARTTIME = json['APPROVED_START_TIME']; + aSSIGNMENTID = json['ASSIGNMENT_ID']; + bREAKNAME = json['BREAK_NAME']; + fROMROWNUM = json['FROM_ROW_NUM']; + nOOFROWS = json['NO_OF_ROWS']; + pERCENTAGE = json['PERCENTAGE']; + rOWNUM = json['ROW_NUM']; + rTPID = json['RTP_ID']; + rTPSCHEDULEID = json['RTP_SCHEDULE_ID']; + sCHEDULEDATE = json['SCHEDULE_DATE']; + sEQNO = json['SEQ_NO']; + sHTACTUALENDDATETIME = json['SHT_ACTUAL_END_DATETIME']; + sHTACTUALENDTIME = json['SHT_ACTUAL_END_TIME']; + sHTACTUALHRS = json['SHT_ACTUAL_HRS']; + sHTACTUALSTARTDATETIME = json['SHT_ACTUAL_START_DATETIME']; + sHTACTUALSTARTTIME = json['SHT_ACTUAL_START_TIME']; + sHTCODE = json['SHT_CODE']; + sHTNAME = json['SHT_NAME']; + sHTTYPE = json['SHT_TYPE']; + sHTTYPEDESC = json['SHT_TYPE_DESC']; + tOROWNUM = json['TO_ROW_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['ACTUAL_WOB_HRS'] = this.aCTUALWOBHRS; + data['APPROVED_END_DATETIME'] = this.aPPROVEDENDDATETIME; + data['APPROVED_END_REASON'] = this.aPPROVEDENDREASON; + data['APPROVED_END_REASON_DESC'] = this.aPPROVEDENDREASONDESC; + data['APPROVED_END_TIME'] = this.aPPROVEDENDTIME; + data['APPROVED_START_DATETIME'] = this.aPPROVEDSTARTDATETIME; + data['APPROVED_START_REASON'] = this.aPPROVEDSTARTREASON; + data['APPROVED_START_REASON_DESC'] = this.aPPROVEDSTARTREASONDESC; + data['APPROVED_START_TIME'] = this.aPPROVEDSTARTTIME; + data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; + data['BREAK_NAME'] = this.bREAKNAME; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['PERCENTAGE'] = this.pERCENTAGE; + data['ROW_NUM'] = this.rOWNUM; + data['RTP_ID'] = this.rTPID; + data['RTP_SCHEDULE_ID'] = this.rTPSCHEDULEID; + data['SCHEDULE_DATE'] = this.sCHEDULEDATE; + data['SEQ_NO'] = this.sEQNO; + data['SHT_ACTUAL_END_DATETIME'] = this.sHTACTUALENDDATETIME; + data['SHT_ACTUAL_END_TIME'] = this.sHTACTUALENDTIME; + data['SHT_ACTUAL_HRS'] = this.sHTACTUALHRS; + data['SHT_ACTUAL_START_DATETIME'] = this.sHTACTUALSTARTDATETIME; + data['SHT_ACTUAL_START_TIME'] = this.sHTACTUALSTARTTIME; + data['SHT_CODE'] = this.sHTCODE; + data['SHT_NAME'] = this.sHTNAME; + data['SHT_TYPE'] = this.sHTTYPE; + data['SHT_TYPE_DESC'] = this.sHTTYPEDESC; + data['TO_ROW_NUM'] = this.tOROWNUM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_stamp_ms_notification_body_list_model.dart b/lib/models/get_stamp_ms_notification_body_list_model.dart new file mode 100644 index 0000000..dbead87 --- /dev/null +++ b/lib/models/get_stamp_ms_notification_body_list_model.dart @@ -0,0 +1,132 @@ +class GetStampMsNotificationBodyList { + int? aCTUALWOBHRS; + int? aCTUALWOBSEC; + String? aPPROVEDENDREASONDESC; + String? aPPROVEDSTARTDATETIME; + String? aPPROVEDSTARTREASON; + String? aPPROVEDSTARTTIME; + int? aSSIGNMENTID; + int? aSSIGNMENTNUMBER; + String? bREAKNAME; + String? bUSINESSGROUPID; + String? eMPLOYEENAME; + int? eMPLOYEENUMBER; + String? eMPLOYMENTCATEGORY; + int? pAYROLLID; + String? pAYROLLNAME; + String? sCHEDULEDATE; + int? sEQNO; + String? sHTACTUALENDDATETIME; + String? sHTACTUALENDTIME; + String? sHTACTUALHRS; + int? sHTACTUALSEC; + String? sHTACTUALSTARTDATETIME; + String? sHTACTUALSTARTTIME; + String? sHTCODE; + int? sHTID; + String? sHTNAME; + String? sHTTYPE; + String? sHTTYPEDESC; + int? sUPERVISORID; + int? tKPERSONID; + + GetStampMsNotificationBodyList( + {this.aCTUALWOBHRS, + this.aCTUALWOBSEC, + this.aPPROVEDENDREASONDESC, + this.aPPROVEDSTARTDATETIME, + this.aPPROVEDSTARTREASON, + this.aPPROVEDSTARTTIME, + this.aSSIGNMENTID, + this.aSSIGNMENTNUMBER, + this.bREAKNAME, + this.bUSINESSGROUPID, + this.eMPLOYEENAME, + this.eMPLOYEENUMBER, + this.eMPLOYMENTCATEGORY, + this.pAYROLLID, + this.pAYROLLNAME, + this.sCHEDULEDATE, + this.sEQNO, + this.sHTACTUALENDDATETIME, + this.sHTACTUALENDTIME, + this.sHTACTUALHRS, + this.sHTACTUALSEC, + this.sHTACTUALSTARTDATETIME, + this.sHTACTUALSTARTTIME, + this.sHTCODE, + this.sHTID, + this.sHTNAME, + this.sHTTYPE, + this.sHTTYPEDESC, + this.sUPERVISORID, + this.tKPERSONID}); + + GetStampMsNotificationBodyList.fromJson(Map json) { + aCTUALWOBHRS = json['ACTUAL_WOB_HRS']; + aCTUALWOBSEC = json['ACTUAL_WOB_SEC']; + aPPROVEDENDREASONDESC = json['APPROVED_END_REASON_DESC']; + aPPROVEDSTARTDATETIME = json['APPROVED_START_DATETIME']; + aPPROVEDSTARTREASON = json['APPROVED_START_REASON']; + aPPROVEDSTARTTIME = json['APPROVED_START_TIME']; + aSSIGNMENTID = json['ASSIGNMENT_ID']; + aSSIGNMENTNUMBER = json['ASSIGNMENT_NUMBER']; + bREAKNAME = json['BREAK_NAME']; + bUSINESSGROUPID = json['BUSINESS_GROUP_ID']; + eMPLOYEENAME = json['EMPLOYEE_NAME']; + eMPLOYEENUMBER = json['EMPLOYEE_NUMBER']; + eMPLOYMENTCATEGORY = json['EMPLOYMENT_CATEGORY']; + pAYROLLID = json['PAYROLL_ID']; + pAYROLLNAME = json['PAYROLL_NAME']; + sCHEDULEDATE = json['SCHEDULE_DATE']; + sEQNO = json['SEQ_NO']; + sHTACTUALENDDATETIME = json['SHT_ACTUAL_END_DATETIME']; + sHTACTUALENDTIME = json['SHT_ACTUAL_END_TIME']; + sHTACTUALHRS = json['SHT_ACTUAL_HRS']; + sHTACTUALSEC = json['SHT_ACTUAL_SEC']; + sHTACTUALSTARTDATETIME = json['SHT_ACTUAL_START_DATETIME']; + sHTACTUALSTARTTIME = json['SHT_ACTUAL_START_TIME']; + sHTCODE = json['SHT_CODE']; + sHTID = json['SHT_ID']; + sHTNAME = json['SHT_NAME']; + sHTTYPE = json['SHT_TYPE']; + sHTTYPEDESC = json['SHT_TYPE_DESC']; + sUPERVISORID = json['SUPERVISOR_ID']; + tKPERSONID = json['TK_PERSON_ID']; + } + + Map toJson() { + final Map data = new Map(); + data['ACTUAL_WOB_HRS'] = this.aCTUALWOBHRS; + data['ACTUAL_WOB_SEC'] = this.aCTUALWOBSEC; + data['APPROVED_END_REASON_DESC'] = this.aPPROVEDENDREASONDESC; + data['APPROVED_START_DATETIME'] = this.aPPROVEDSTARTDATETIME; + data['APPROVED_START_REASON'] = this.aPPROVEDSTARTREASON; + data['APPROVED_START_TIME'] = this.aPPROVEDSTARTTIME; + data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; + data['ASSIGNMENT_NUMBER'] = this.aSSIGNMENTNUMBER; + data['BREAK_NAME'] = this.bREAKNAME; + data['BUSINESS_GROUP_ID'] = this.bUSINESSGROUPID; + data['EMPLOYEE_NAME'] = this.eMPLOYEENAME; + data['EMPLOYEE_NUMBER'] = this.eMPLOYEENUMBER; + data['EMPLOYMENT_CATEGORY'] = this.eMPLOYMENTCATEGORY; + data['PAYROLL_ID'] = this.pAYROLLID; + data['PAYROLL_NAME'] = this.pAYROLLNAME; + data['SCHEDULE_DATE'] = this.sCHEDULEDATE; + data['SEQ_NO'] = this.sEQNO; + data['SHT_ACTUAL_END_DATETIME'] = this.sHTACTUALENDDATETIME; + data['SHT_ACTUAL_END_TIME'] = this.sHTACTUALENDTIME; + data['SHT_ACTUAL_HRS'] = this.sHTACTUALHRS; + data['SHT_ACTUAL_SEC'] = this.sHTACTUALSEC; + data['SHT_ACTUAL_START_DATETIME'] = this.sHTACTUALSTARTDATETIME; + data['SHT_ACTUAL_START_TIME'] = this.sHTACTUALSTARTTIME; + data['SHT_CODE'] = this.sHTCODE; + data['SHT_ID'] = this.sHTID; + data['SHT_NAME'] = this.sHTNAME; + data['SHT_TYPE'] = this.sHTTYPE; + data['SHT_TYPE_DESC'] = this.sHTTYPEDESC; + data['SUPERVISOR_ID'] = this.sUPERVISORID; + data['TK_PERSON_ID'] = this.tKPERSONID; + return data; + } +} diff --git a/lib/models/get_stamp_ns_notification_body_list_model.dart b/lib/models/get_stamp_ns_notification_body_list_model.dart new file mode 100644 index 0000000..4ce708c --- /dev/null +++ b/lib/models/get_stamp_ns_notification_body_list_model.dart @@ -0,0 +1,61 @@ + +class GetStampNsNotificationBodyList { + int? aSSIGNMENTID; + String? aSSIGNMENTNUMBER; + int? bUSINESSGROUPID; + String? eMPLOYEENAME; + String? eMPLOYEENUMBER; + String? eMPLOYMENTCATEGORY; + int? pAYROLLID; + String? pAYROLLNAME; + int? pERSONID; + String? sCHEDULEDATE; + int? sUPERVISORID; + int? tKPERSONID; + + GetStampNsNotificationBodyList( + {this.aSSIGNMENTID, + this.aSSIGNMENTNUMBER, + this.bUSINESSGROUPID, + this.eMPLOYEENAME, + this.eMPLOYEENUMBER, + this.eMPLOYMENTCATEGORY, + this.pAYROLLID, + this.pAYROLLNAME, + this.pERSONID, + this.sCHEDULEDATE, + this.sUPERVISORID, + this.tKPERSONID}); + + GetStampNsNotificationBodyList.fromJson(Map json) { + aSSIGNMENTID = json['ASSIGNMENT_ID']; + aSSIGNMENTNUMBER = json['ASSIGNMENT_NUMBER']; + bUSINESSGROUPID = json['BUSINESS_GROUP_ID']; + eMPLOYEENAME = json['EMPLOYEE_NAME']; + eMPLOYEENUMBER = json['EMPLOYEE_NUMBER']; + eMPLOYMENTCATEGORY = json['EMPLOYMENT_CATEGORY']; + pAYROLLID = json['PAYROLL_ID']; + pAYROLLNAME = json['PAYROLL_NAME']; + pERSONID = json['PERSON_ID']; + sCHEDULEDATE = json['SCHEDULE_DATE']; + sUPERVISORID = json['SUPERVISOR_ID']; + tKPERSONID = json['TK_PERSON_ID']; + } + + Map toJson() { + final Map data = new Map(); + data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; + data['ASSIGNMENT_NUMBER'] = this.aSSIGNMENTNUMBER; + data['BUSINESS_GROUP_ID'] = this.bUSINESSGROUPID; + data['EMPLOYEE_NAME'] = this.eMPLOYEENAME; + data['EMPLOYEE_NUMBER'] = this.eMPLOYEENUMBER; + data['EMPLOYMENT_CATEGORY'] = this.eMPLOYMENTCATEGORY; + data['PAYROLL_ID'] = this.pAYROLLID; + data['PAYROLL_NAME'] = this.pAYROLLNAME; + data['PERSON_ID'] = this.pERSONID; + data['SCHEDULE_DATE'] = this.sCHEDULEDATE; + data['SUPERVISOR_ID'] = this.sUPERVISORID; + data['TK_PERSON_ID'] = this.tKPERSONID; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_time_card_summary_list_model.dart b/lib/models/get_time_card_summary_list_model.dart new file mode 100644 index 0000000..6799bfa --- /dev/null +++ b/lib/models/get_time_card_summary_list_model.dart @@ -0,0 +1,153 @@ + + +class GetTimeCardSummaryList { + int? aBSENTDAYS; + int? aCTUALHRS; + int? aPPROVEDTIMEBACKHRS; + int? aSSIGNMENTID; + int? aTTENDEDDAYS; + int? bUSINESSTRIP; + int? cOMPOFFHHRS; + int? cOMPOFFNHRS; + int? cOMPOFFWHRS; + int? dESIREDSCHEDULEDHRS; + int? eARLYOUTHRS; + int? eXCESSHRS; + int? hALFDAYLEAVE; + int? lATEINHRS; + int? lEAVESHOLIDAYSHRS; + int? nONSCHEDULEDAYS; + int? nOTANALYZEDDAYS; + int? oFFDAYS; + int? oNCALLHRS; + int? pAIDLEAVE; + int? pERIODDAYS; + int? pLANNEDOTHRS; + int? pUBLICHOLIDAY; + int? sCHEDULEDHRS; + int? sCHEDULEDONCALLHRS; + int? sCHEDULEDPLANNEDOTHRS; + int? sCHEDULEDAYS; + int? sHORTAGEHRS; + int? sHORTAGESCHEDULEHRS; + int? sICKLEAVE; + int? tIMEBACKHRS; + double? tIMEBACKBALANCE; + int? uNAUTHORIZEDLEAVE; + int? uNCOVERDSHORTAGEHRS; + int? uNPAIDLEAVE; + + GetTimeCardSummaryList( + {this.aBSENTDAYS, + this.aCTUALHRS, + this.aPPROVEDTIMEBACKHRS, + this.aSSIGNMENTID, + this.aTTENDEDDAYS, + this.bUSINESSTRIP, + this.cOMPOFFHHRS, + this.cOMPOFFNHRS, + this.cOMPOFFWHRS, + this.dESIREDSCHEDULEDHRS, + this.eARLYOUTHRS, + this.eXCESSHRS, + this.hALFDAYLEAVE, + this.lATEINHRS, + this.lEAVESHOLIDAYSHRS, + this.nONSCHEDULEDAYS, + this.nOTANALYZEDDAYS, + this.oFFDAYS, + this.oNCALLHRS, + this.pAIDLEAVE, + this.pERIODDAYS, + this.pLANNEDOTHRS, + this.pUBLICHOLIDAY, + this.sCHEDULEDHRS, + this.sCHEDULEDONCALLHRS, + this.sCHEDULEDPLANNEDOTHRS, + this.sCHEDULEDAYS, + this.sHORTAGEHRS, + this.sHORTAGESCHEDULEHRS, + this.sICKLEAVE, + this.tIMEBACKHRS, + this.tIMEBACKBALANCE, + this.uNAUTHORIZEDLEAVE, + this.uNCOVERDSHORTAGEHRS, + this.uNPAIDLEAVE}); + + GetTimeCardSummaryList.fromJson(Map json) { + aBSENTDAYS = json['ABSENT_DAYS']; + aCTUALHRS = json['ACTUAL_HRS']; + aPPROVEDTIMEBACKHRS = json['APPROVED_TIMEBACK_HRS']; + aSSIGNMENTID = json['ASSIGNMENT_ID']; + aTTENDEDDAYS = json['ATTENDED_DAYS']; + bUSINESSTRIP = json['BUSINESS_TRIP']; + cOMPOFFHHRS = json['COMP_OFF_H_HRS']; + cOMPOFFNHRS = json['COMP_OFF_N_HRS']; + cOMPOFFWHRS = json['COMP_OFF_W_HRS']; + dESIREDSCHEDULEDHRS = json['DESIRED_SCHEDULED_HRS']; + eARLYOUTHRS = json['EARLY_OUT_HRS']; + eXCESSHRS = json['EXCESS_HRS']; + hALFDAYLEAVE = json['HALF_DAY_LEAVE']; + lATEINHRS = json['LATE_IN_HRS']; + lEAVESHOLIDAYSHRS = json['LEAVES_HOLIDAYS_HRS']; + nONSCHEDULEDAYS = json['NON_SCHEDULE_DAYS']; + nOTANALYZEDDAYS = json['NOT_ANALYZED_DAYS']; + oFFDAYS = json['OFF_DAYS']; + oNCALLHRS = json['ON_CALL_HRS']; + pAIDLEAVE = json['PAID_LEAVE']; + pERIODDAYS = json['PERIOD_DAYS']; + pLANNEDOTHRS = json['PLANNED_OTHRS']; + pUBLICHOLIDAY = json['PUBLIC_HOLIDAY']; + sCHEDULEDHRS = json['SCHEDULED_HRS']; + sCHEDULEDONCALLHRS = json['SCHEDULED_ON_CALL_HRS']; + sCHEDULEDPLANNEDOTHRS = json['SCHEDULED_PLANNED_OT_HRS']; + sCHEDULEDAYS = json['SCHEDULE_DAYS']; + sHORTAGEHRS = json['SHORTAGE_HRS']; + sHORTAGESCHEDULEHRS = json['SHORTAGE_SCHEDULE_HRS']; + sICKLEAVE = json['SICK_LEAVE']; + tIMEBACKHRS = json['TIMEBACK_HRS']; + tIMEBACKBALANCE = json['TIME_BACK_BALANCE']; + uNAUTHORIZEDLEAVE = json['UNAUTHORIZED_LEAVE']; + uNCOVERDSHORTAGEHRS = json['UNCOVERD_SHORTAGE_HRS']; + uNPAIDLEAVE = json['UNPAID_LEAVE']; + } + + Map toJson() { + final Map data = new Map(); + data['ABSENT_DAYS'] = this.aBSENTDAYS; + data['ACTUAL_HRS'] = this.aCTUALHRS; + data['APPROVED_TIMEBACK_HRS'] = this.aPPROVEDTIMEBACKHRS; + data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; + data['ATTENDED_DAYS'] = this.aTTENDEDDAYS; + data['BUSINESS_TRIP'] = this.bUSINESSTRIP; + data['COMP_OFF_H_HRS'] = this.cOMPOFFHHRS; + data['COMP_OFF_N_HRS'] = this.cOMPOFFNHRS; + data['COMP_OFF_W_HRS'] = this.cOMPOFFWHRS; + data['DESIRED_SCHEDULED_HRS'] = this.dESIREDSCHEDULEDHRS; + data['EARLY_OUT_HRS'] = this.eARLYOUTHRS; + data['EXCESS_HRS'] = this.eXCESSHRS; + data['HALF_DAY_LEAVE'] = this.hALFDAYLEAVE; + data['LATE_IN_HRS'] = this.lATEINHRS; + data['LEAVES_HOLIDAYS_HRS'] = this.lEAVESHOLIDAYSHRS; + data['NON_SCHEDULE_DAYS'] = this.nONSCHEDULEDAYS; + data['NOT_ANALYZED_DAYS'] = this.nOTANALYZEDDAYS; + data['OFF_DAYS'] = this.oFFDAYS; + data['ON_CALL_HRS'] = this.oNCALLHRS; + data['PAID_LEAVE'] = this.pAIDLEAVE; + data['PERIOD_DAYS'] = this.pERIODDAYS; + data['PLANNED_OTHRS'] = this.pLANNEDOTHRS; + data['PUBLIC_HOLIDAY'] = this.pUBLICHOLIDAY; + data['SCHEDULED_HRS'] = this.sCHEDULEDHRS; + data['SCHEDULED_ON_CALL_HRS'] = this.sCHEDULEDONCALLHRS; + data['SCHEDULED_PLANNED_OT_HRS'] = this.sCHEDULEDPLANNEDOTHRS; + data['SCHEDULE_DAYS'] = this.sCHEDULEDAYS; + data['SHORTAGE_HRS'] = this.sHORTAGEHRS; + data['SHORTAGE_SCHEDULE_HRS'] = this.sHORTAGESCHEDULEHRS; + data['SICK_LEAVE'] = this.sICKLEAVE; + data['TIMEBACK_HRS'] = this.tIMEBACKHRS; + data['TIME_BACK_BALANCE'] = this.tIMEBACKBALANCE; + data['UNAUTHORIZED_LEAVE'] = this.uNAUTHORIZEDLEAVE; + data['UNCOVERD_SHORTAGE_HRS'] = this.uNCOVERDSHORTAGEHRS; + data['UNPAID_LEAVE'] = this.uNPAIDLEAVE; + return data; + }} \ No newline at end of file diff --git a/lib/models/itg_forms_models/allowed_actions_model.dart b/lib/models/itg_forms_models/allowed_actions_model.dart new file mode 100644 index 0000000..9c394c3 --- /dev/null +++ b/lib/models/itg_forms_models/allowed_actions_model.dart @@ -0,0 +1,21 @@ +class AllowedActions { + String? action; + String? details; + bool? isAvailable; + + AllowedActions({this.action, this.details, this.isAvailable}); + + AllowedActions.fromJson(Map json) { + action = json['Action']; + details = json['Details']; + isAvailable = json['IsAvailable']; + } + + Map toJson() { + final Map data = new Map(); + data['Action'] = this.action; + data['Details'] = this.details; + data['IsAvailable'] = this.isAvailable; + return data; + } +} \ No newline at end of file diff --git a/lib/models/itg_forms_models/field_goups_model.dart b/lib/models/itg_forms_models/field_goups_model.dart new file mode 100644 index 0000000..362fda7 --- /dev/null +++ b/lib/models/itg_forms_models/field_goups_model.dart @@ -0,0 +1,27 @@ +import 'package:mohem_flutter_app/models/itg_forms_models/fields_model.dart'; + +class FieldGoups { + List? fields; + String? title; + + FieldGoups({this.fields, this.title}); + + FieldGoups.fromJson(Map json) { + if (json['Fields'] != null) { + fields = []; + json['Fields'].forEach((v) { + fields!.add(new Fields.fromJson(v)); + }); + } + title = json['Title']; + } + + Map toJson() { + final Map data = new Map(); + if (this.fields != null) { + data['Fields'] = this.fields!.map((v) => v.toJson()).toList(); + } + data['Title'] = this.title; + return data; + } +} \ No newline at end of file diff --git a/lib/models/itg_forms_models/fields_model.dart b/lib/models/itg_forms_models/fields_model.dart new file mode 100644 index 0000000..3800f81 --- /dev/null +++ b/lib/models/itg_forms_models/fields_model.dart @@ -0,0 +1,27 @@ +class Fields { + List? multipleValue; + String? tableValue; + String? title; + String? type; + String? value; + + Fields({this.multipleValue, this.tableValue, this.title, this.type, this.value}); + + Fields.fromJson(Map json) { + multipleValue = json['MultipleValue'] != null ? json['MultipleValue'].cast() : null; + tableValue = json['TableValue']; + title = json['Title']; + type = json['Type']; + value = json['Value']; + } + + Map toJson() { + final Map data = new Map(); + data['MultipleValue'] = this.multipleValue; + data['TableValue'] = this.tableValue; + data['Title'] = this.title; + data['Type'] = this.type; + data['Value'] = this.value; + return data; + } +} diff --git a/lib/models/itg_forms_models/itg_request_model.dart b/lib/models/itg_forms_models/itg_request_model.dart new file mode 100644 index 0000000..5bc4fa4 --- /dev/null +++ b/lib/models/itg_forms_models/itg_request_model.dart @@ -0,0 +1,52 @@ +import 'package:mohem_flutter_app/models/itg_forms_models/allowed_actions_model.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/field_goups_model.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/wf_history_model.dart'; + +class ITGRequest { + List? allowedActions; + Null? attachments; + List? fieldGoups; + Null? grantFields; + List? wFHistory; + + ITGRequest({this.allowedActions, this.attachments, this.fieldGoups, this.grantFields, this.wFHistory}); + + ITGRequest.fromJson(Map json) { + if (json['AllowedActions'] != null) { + allowedActions = []; + json['AllowedActions'].forEach((v) { + allowedActions!.add(new AllowedActions.fromJson(v)); + }); + } + attachments = json['Attachments']; + if (json['FieldGoups'] != null) { + fieldGoups = []; + json['FieldGoups'].forEach((v) { + fieldGoups!.add(new FieldGoups.fromJson(v)); + }); + } + grantFields = json['GrantFields']; + if (json['WFHistory'] != null) { + wFHistory = []; + json['WFHistory'].forEach((v) { + wFHistory!.add(new WFHistory.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.allowedActions != null) { + data['AllowedActions'] = this.allowedActions!.map((v) => v.toJson()).toList(); + } + data['Attachments'] = this.attachments; + if (this.fieldGoups != null) { + data['FieldGoups'] = this.fieldGoups!.map((v) => v.toJson()).toList(); + } + data['GrantFields'] = this.grantFields; + if (this.wFHistory != null) { + data['WFHistory'] = this.wFHistory!.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/models/itg_forms_models/request_detail_model.dart b/lib/models/itg_forms_models/request_detail_model.dart new file mode 100644 index 0000000..b7b5a9c --- /dev/null +++ b/lib/models/itg_forms_models/request_detail_model.dart @@ -0,0 +1,34 @@ +class RequestDetails { + int? iD; + int? itemID; + String? listID; + String? listName; + String? modifiedDate; + String? title; + String? uRL; + String? requestType; + + RequestDetails({this.iD, this.itemID, this.listID, this.listName, this.modifiedDate, this.title, this.uRL,this.requestType}); + + RequestDetails.fromJson(Map json) { + iD = json['ID']; + itemID = json['ItemID']; + listID = json['ListID']; + listName = json['ListName']; + modifiedDate = json['ModifiedDate']; + title = json['Title']; + uRL = json['URL']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ItemID'] = this.itemID; + data['ListID'] = this.listID; + data['ListName'] = this.listName; + data['ModifiedDate'] = this.modifiedDate; + data['Title'] = this.title; + data['URL'] = this.uRL; + return data; + } +} diff --git a/lib/models/itg_forms_models/request_type_model.dart b/lib/models/itg_forms_models/request_type_model.dart new file mode 100644 index 0000000..92d2515 --- /dev/null +++ b/lib/models/itg_forms_models/request_type_model.dart @@ -0,0 +1,33 @@ +import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart'; + +class RequestType { + int? itemCount; + List? requestDetails; + String? requestTypeCode; + String? requestTypeName; + + RequestType({this.itemCount, this.requestDetails, this.requestTypeCode, this.requestTypeName}); + + RequestType.fromJson(Map json) { + itemCount = json['ItemCount']; + if (json['RequestDetails'] != null) { + requestDetails = []; + json['RequestDetails'].forEach((v) { + requestDetails!.add(new RequestDetails.fromJson(v)); + }); + } + requestTypeCode = json['RequestTypeCode']; + requestTypeName = json['RequestTypeName']; + } + + Map toJson() { + final Map data = new Map(); + data['ItemCount'] = this.itemCount; + if (this.requestDetails != null) { + data['RequestDetails'] = this.requestDetails!.map((v) => v.toJson()).toList(); + } + data['RequestTypeCode'] = this.requestTypeCode; + data['RequestTypeName'] = this.requestTypeName; + return data; + } +} diff --git a/lib/models/itg_forms_models/wf_history_model.dart b/lib/models/itg_forms_models/wf_history_model.dart new file mode 100644 index 0000000..8e3dd6d --- /dev/null +++ b/lib/models/itg_forms_models/wf_history_model.dart @@ -0,0 +1,40 @@ +class WFHistory { + String? action; + String? approvalLevel; + String? date; + String? email; + String? employeeID; + String? name; + String? notes; + + WFHistory( + {this.action, + this.approvalLevel, + this.date, + this.email, + this.employeeID, + this.name, + this.notes}); + + WFHistory.fromJson(Map json) { + action = json['Action']; + approvalLevel = json['ApprovalLevel']; + date = json['Date']; + email = json['Email']; + employeeID = json['EmployeeID']; + name = json['Name']; + notes = json['Notes']; + } + + Map toJson() { + final Map data = new Map(); + data['Action'] = this.action; + data['ApprovalLevel'] = this.approvalLevel; + data['Date'] = this.date; + data['Email'] = this.email; + data['EmployeeID'] = this.employeeID; + data['Name'] = this.name; + data['Notes'] = this.notes; + return data; + } +} \ No newline at end of file diff --git a/lib/models/notification_action_model.dart b/lib/models/notification_action_model.dart new file mode 100644 index 0000000..a1214e1 --- /dev/null +++ b/lib/models/notification_action_model.dart @@ -0,0 +1,18 @@ +class NotificationAction { + String? pRETURNMSG; + String? pRETURNSTATUS; + + NotificationAction({this.pRETURNMSG, this.pRETURNSTATUS}); + + NotificationAction.fromJson(Map json) { + pRETURNMSG = json['P_RETURN_MSG']; + pRETURNSTATUS = json['P_RETURN_STATUS']; + } + + Map toJson() { + final Map data = new Map(); + data['P_RETURN_MSG'] = this.pRETURNMSG; + data['P_RETURN_STATUS'] = this.pRETURNSTATUS; + return data; + } +} \ No newline at end of file diff --git a/lib/models/notification_get_respond_attributes_list_model.dart b/lib/models/notification_get_respond_attributes_list_model.dart new file mode 100644 index 0000000..9810e24 --- /dev/null +++ b/lib/models/notification_get_respond_attributes_list_model.dart @@ -0,0 +1,24 @@ +class NotificationGetRespondAttributesList { + String? attributeDisplayName; + String? attributeFormat; + String? attributeName; + String? attributeType; + + NotificationGetRespondAttributesList({this.attributeDisplayName, this.attributeFormat, this.attributeName, this.attributeType}); + + NotificationGetRespondAttributesList.fromJson(Map json) { + attributeDisplayName = json['ATTRIBUTE_DISPLAY_NAME']; + attributeFormat = json['ATTRIBUTE_FORMAT']; + attributeName = json['ATTRIBUTE_NAME']; + attributeType = json['ATTRIBUTE_TYPE']; + } + + Map toJson() { + final Map data = {}; + data['ATTRIBUTE_DISPLAY_NAME'] = attributeDisplayName; + data['ATTRIBUTE_FORMAT'] = attributeFormat; + data['ATTRIBUTE_NAME'] = attributeName; + data['ATTRIBUTE_TYPE'] = attributeType; + return data; + } +} diff --git a/lib/models/profile/basic_details_cols_structions.dart b/lib/models/profile/basic_details_cols_structions.dart new file mode 100644 index 0000000..dceacd6 --- /dev/null +++ b/lib/models/profile/basic_details_cols_structions.dart @@ -0,0 +1,85 @@ +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; + +class GetBasicDetColsStructureList { + String? aPPLICATIONCOLUMNNAME; + String? dATATYPE; + String? dISPLAYFLAG; + int? mAXIMUMSIZE; + String? oBJECTNAME; + String? oBJECTTYPE; + List? objectValuesList; + String? rEQUIREDFLAG; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + GetEmployeeBasicDetailsList? userBasicDetail; + GetBasicDetColsStructureList({ + this.aPPLICATIONCOLUMNNAME, + this.dATATYPE, + this.dISPLAYFLAG, + this.mAXIMUMSIZE, + this.oBJECTNAME, + this.oBJECTTYPE, + this.objectValuesList, + this.rEQUIREDFLAG, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.userBasicDetail, + }); + + GetBasicDetColsStructureList.fromJson(Map json) { + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + dATATYPE = json['DATATYPE']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + mAXIMUMSIZE = json['MAXIMUM_SIZE']; + oBJECTNAME = json['OBJECT_NAME']; + oBJECTTYPE = json['OBJECT_TYPE']; + if (json['ObjectValuesList'] != null) { + objectValuesList = []; + json['ObjectValuesList'].forEach((v) { + objectValuesList!.add(new ObjectValuesList.fromJson(v)); + }); + } + rEQUIREDFLAG = json['REQUIRED_FLAG']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['DATATYPE'] = this.dATATYPE; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['MAXIMUM_SIZE'] = this.mAXIMUMSIZE; + data['OBJECT_NAME'] = this.oBJECTNAME; + data['OBJECT_TYPE'] = this.oBJECTTYPE; + if (this.objectValuesList != null) { + data['ObjectValuesList'] = this.objectValuesList!.map((v) => v.toJson()).toList(); + } + data['REQUIRED_FLAG'] = this.rEQUIREDFLAG; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + return data; + } +} + +class ObjectValuesList { + String? cODE; + String? dESCRIPTION; + String? mEANING; + + ObjectValuesList({this.cODE, this.dESCRIPTION, this.mEANING}); + + ObjectValuesList.fromJson(Map json) { + cODE = json['CODE']; + dESCRIPTION = json['DESCRIPTION']; + mEANING = json['MEANING']; + } + + Map toJson() { + final Map data = new Map(); + data['CODE'] = this.cODE; + data['DESCRIPTION'] = this.dESCRIPTION; + data['MEANING'] = this.mEANING; + return data; + } +} diff --git a/lib/models/profile/basic_details_dff_structure.dart b/lib/models/profile/basic_details_dff_structure.dart new file mode 100644 index 0000000..db3312e --- /dev/null +++ b/lib/models/profile/basic_details_dff_structure.dart @@ -0,0 +1,188 @@ +import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; + +class GetBasicDetDffStructureList { + String? aLPHANUMERICALLOWEDFLAG; + String? aPPLICATIONCOLUMNNAME; + String? cHILDSEGMENTSVS; + Null? cHILDSEGMENTSVSSplited; + String? dEFAULTTYPE; + String? dEFAULTVALUE; + String? dESCFLEXCONTEXTCODE; + String? dESCFLEXCONTEXTNAME; + String? dESCFLEXNAME; + String? dISPLAYFLAG; + String? eNABLEDFLAG; + ESERVICESDV? eSERVICESDV; + List? eSERVICESVS; + String? fLEXVALUESETNAME; + String? fORMATTYPE; + String? fORMATTYPEDSP; + bool? isEmptyOption; + String? lONGLISTFLAG; + int? mAXIMUMSIZE; + String? mAXIMUMVALUE; + String? mINIMUMVALUE; + String? mOBILEENABLED; + String? nUMBERPRECISION; + String? nUMERICMODEENABLEDFLAG; + String? pARENTSEGMENTSDV; + List? pARENTSEGMENTSDVSplited; + String? pARENTSEGMENTSVS; + List? pARENTSEGMENTSVSSplitedVS; + String? rEADONLY; + String? rEQUIREDFLAG; + String? sEGMENTNAME; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? uPPERCASEONLYFLAG; + String? uSEDFLAG; + String? vALIDATIONTYPE; + String? vALIDATIONTYPEDSP; + GetEmployeeBasicDetailsList? userBasicDetail; + + GetBasicDetDffStructureList( + {this.aLPHANUMERICALLOWEDFLAG, + this.aPPLICATIONCOLUMNNAME, + this.cHILDSEGMENTSVS, + this.cHILDSEGMENTSVSSplited, + this.dEFAULTTYPE, + this.dEFAULTVALUE, + this.dESCFLEXCONTEXTCODE, + this.dESCFLEXCONTEXTNAME, + this.dESCFLEXNAME, + this.dISPLAYFLAG, + this.eNABLEDFLAG, + this.eSERVICESDV, + this.eSERVICESVS, + this.fLEXVALUESETNAME, + this.fORMATTYPE, + this.fORMATTYPEDSP, + this.isEmptyOption, + this.lONGLISTFLAG, + this.mAXIMUMSIZE, + this.mAXIMUMVALUE, + this.mINIMUMVALUE, + this.mOBILEENABLED, + this.nUMBERPRECISION, + this.nUMERICMODEENABLEDFLAG, + this.pARENTSEGMENTSDV, + this.pARENTSEGMENTSDVSplited, + this.pARENTSEGMENTSVS, + this.pARENTSEGMENTSVSSplitedVS, + this.rEADONLY, + this.rEQUIREDFLAG, + this.sEGMENTNAME, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.uPPERCASEONLYFLAG, + this.uSEDFLAG, + this.vALIDATIONTYPE, + this.vALIDATIONTYPEDSP, + this.userBasicDetail}); + + GetBasicDetDffStructureList.fromJson(Map json) { + aLPHANUMERICALLOWEDFLAG = json['ALPHANUMERIC_ALLOWED_FLAG']; + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + cHILDSEGMENTSVS = json['CHILD_SEGMENTS_VS']; + cHILDSEGMENTSVSSplited = json['CHILD_SEGMENTS_VS_Splited']; + dEFAULTTYPE = json['DEFAULT_TYPE']; + dEFAULTVALUE = json['DEFAULT_VALUE']; + dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE']; + dESCFLEXCONTEXTNAME = json['DESC_FLEX_CONTEXT_NAME']; + dESCFLEXNAME = json['DESC_FLEX_NAME']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + eNABLEDFLAG = json['ENABLED_FLAG']; + eSERVICESDV = json['E_SERVICES_DV'] != null ? ESERVICESDV.fromJson(json['E_SERVICES_DV']) : null; + if (json['E_SERVICES_VS'] != null) { + eSERVICESVS = []; + json['E_SERVICES_VS'].forEach((v) { + eSERVICESVS!.add(ESERVICESVS.fromJson(v)); + }); + } + fLEXVALUESETNAME = json['FLEX_VALUE_SET_NAME']; + fORMATTYPE = json['FORMAT_TYPE']; + fORMATTYPEDSP = json['FORMAT_TYPE_DSP']; + isEmptyOption = json['IsEmptyOption']; + lONGLISTFLAG = json['LONGLIST_FLAG']; + mAXIMUMSIZE = json['MAXIMUM_SIZE']; + mAXIMUMVALUE = json['MAXIMUM_VALUE']; + mINIMUMVALUE = json['MINIMUM_VALUE']; + mOBILEENABLED = json['MOBILE_ENABLED']; + nUMBERPRECISION = json['NUMBER_PRECISION']; + nUMERICMODEENABLEDFLAG = json['NUMERIC_MODE_ENABLED_FLAG']; + pARENTSEGMENTSDV = json['PARENT_SEGMENTS_DV']; + if (json['PARENT_SEGMENTS_DV_Splited'] != null) { + pARENTSEGMENTSDVSplited = []; + json['PARENT_SEGMENTS_DV_Splited'].forEach((v) { + pARENTSEGMENTSDVSplited!.add((v)); + }); + } + pARENTSEGMENTSVS = json['PARENT_SEGMENTS_VS']; + if (json['PARENT_SEGMENTS_VS_SplitedVS'] != null) { + pARENTSEGMENTSVSSplitedVS = []; + json['PARENT_SEGMENTS_VS_SplitedVS'].forEach((v) { + pARENTSEGMENTSVSSplitedVS!.add(v); + }); + } + rEADONLY = json['READ_ONLY']; + rEQUIREDFLAG = json['REQUIRED_FLAG']; + sEGMENTNAME = json['SEGMENT_NAME']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + uPPERCASEONLYFLAG = json['UPPERCASE_ONLY_FLAG']; + uSEDFLAG = json['USED_FLAG']; + vALIDATIONTYPE = json['VALIDATION_TYPE']; + vALIDATIONTYPEDSP = json['VALIDATION_TYPE_DSP']; + } + + Map toJson() { + final Map data = Map(); + data['ALPHANUMERIC_ALLOWED_FLAG'] = this.aLPHANUMERICALLOWEDFLAG; + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['CHILD_SEGMENTS_VS'] = this.cHILDSEGMENTSVS; + data['CHILD_SEGMENTS_VS_Splited'] = this.cHILDSEGMENTSVSSplited; + data['DEFAULT_TYPE'] = this.dEFAULTTYPE; + data['DEFAULT_VALUE'] = this.dEFAULTVALUE; + data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE; + data['DESC_FLEX_CONTEXT_NAME'] = this.dESCFLEXCONTEXTNAME; + data['DESC_FLEX_NAME'] = this.dESCFLEXNAME; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['ENABLED_FLAG'] = this.eNABLEDFLAG; + if (this.eSERVICESDV != null) { + data['E_SERVICES_DV'] = this.eSERVICESDV!.toJson(); + } + if (this.eSERVICESVS != null) { + data['E_SERVICES_VS'] = this.eSERVICESVS!.map((v) => v.toJson()).toList(); + } + data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME; + data['FORMAT_TYPE'] = this.fORMATTYPE; + data['FORMAT_TYPE_DSP'] = this.fORMATTYPEDSP; + data['IsEmptyOption'] = this.isEmptyOption; + data['LONGLIST_FLAG'] = this.lONGLISTFLAG; + data['MAXIMUM_SIZE'] = this.mAXIMUMSIZE; + data['MAXIMUM_VALUE'] = this.mAXIMUMVALUE; + data['MINIMUM_VALUE'] = this.mINIMUMVALUE; + data['MOBILE_ENABLED'] = this.mOBILEENABLED; + data['NUMBER_PRECISION'] = this.nUMBERPRECISION; + data['NUMERIC_MODE_ENABLED_FLAG'] = this.nUMERICMODEENABLEDFLAG; + data['PARENT_SEGMENTS_DV'] = this.pARENTSEGMENTSDV; + if (this.pARENTSEGMENTSDVSplited != null) { + data['PARENT_SEGMENTS_DV_Splited'] = this.pARENTSEGMENTSDVSplited!.map((v) => v).toList(); + } + data['PARENT_SEGMENTS_VS'] = this.pARENTSEGMENTSVS; + if (this.pARENTSEGMENTSVSSplitedVS != null) { + data['PARENT_SEGMENTS_VS_SplitedVS'] = this.pARENTSEGMENTSVSSplitedVS!.map((v) => v).toList(); + } + data['READ_ONLY'] = this.rEADONLY; + data['REQUIRED_FLAG'] = this.rEQUIREDFLAG; + data['SEGMENT_NAME'] = this.sEGMENTNAME; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['UPPERCASE_ONLY_FLAG'] = this.uPPERCASEONLYFLAG; + data['USED_FLAG'] = this.uSEDFLAG; + data['VALIDATION_TYPE'] = this.vALIDATIONTYPE; + data['VALIDATION_TYPE_DSP'] = this.vALIDATIONTYPEDSP; + return data; + } +} diff --git a/lib/models/profile/phone_number_types_modek.dart b/lib/models/profile/phone_number_types_modek.dart new file mode 100644 index 0000000..47b8a35 --- /dev/null +++ b/lib/models/profile/phone_number_types_modek.dart @@ -0,0 +1,21 @@ +class GetPhoneNumberTypesModel { + String? cODE; + String? dESCRIPTION; + String? mEANING; + + GetPhoneNumberTypesModel({this.cODE, this.dESCRIPTION, this.mEANING}); + + GetPhoneNumberTypesModel.fromJson(Map json) { + cODE = json['CODE']; + dESCRIPTION = json['DESCRIPTION']; + mEANING = json['MEANING']; + } + + Map toJson() { + final Map data = new Map(); + data['CODE'] = this.cODE; + data['DESCRIPTION'] = this.dESCRIPTION; + data['MEANING'] = this.mEANING; + return data; + } +} diff --git a/lib/models/profile_menu.model.dart b/lib/models/profile_menu.model.dart new file mode 100644 index 0000000..c1b77b7 --- /dev/null +++ b/lib/models/profile_menu.model.dart @@ -0,0 +1,12 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ProfileMenu { + final String name; + final String icon; + final String route; + final String dynamicUrl; + final String functionName; + final String requestID; + ProfileMenu({this.name = '', this.icon = '', this.route = '', this.dynamicUrl = '', this.functionName = '', this.requestID = ''}); +} diff --git a/lib/models/subordinates_on_leaves_model.dart b/lib/models/subordinates_on_leaves_model.dart new file mode 100644 index 0000000..d6437f3 --- /dev/null +++ b/lib/models/subordinates_on_leaves_model.dart @@ -0,0 +1,68 @@ +class SubordinatesLeavesList { + String? aBSENCEATTENDANCETYPENAME; + String? cALENDARENTRYDESC; + String? dATEEND; + String? dATESTART; + String? eMPLOYEEIMAGE; + String? eMPLOYEENAME; + String? eMPLOYEENUMBER; + String? eVENTDATE; + String? lEAVETYPE; + int? oRGANIZATIONID; + String? oRGANIZATIONNAME; + String? pOSITIONTITLE; + String? rEPLACEMENTNAME; + String? sTATUS; + + SubordinatesLeavesList( + {this.aBSENCEATTENDANCETYPENAME, + this.cALENDARENTRYDESC, + this.dATEEND, + this.dATESTART, + this.eMPLOYEEIMAGE, + this.eMPLOYEENAME, + this.eMPLOYEENUMBER, + this.eVENTDATE, + this.lEAVETYPE, + this.oRGANIZATIONID, + this.oRGANIZATIONNAME, + this.pOSITIONTITLE, + this.rEPLACEMENTNAME, + this.sTATUS}); + + SubordinatesLeavesList.fromJson(Map json) { + aBSENCEATTENDANCETYPENAME = json['ABSENCE_ATTENDANCE_TYPE_NAME']; + cALENDARENTRYDESC = json['CALENDAR_ENTRY_DESC']; + dATEEND = json['DATE_END']; + dATESTART = json['DATE_START']; + eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE']; + eMPLOYEENAME = json['EMPLOYEE_NAME']; + eMPLOYEENUMBER = json['EMPLOYEE_NUMBER']; + eVENTDATE = json['EVENT_DATE']; + lEAVETYPE = json['LEAVE_TYPE']; + oRGANIZATIONID = json['ORGANIZATION_ID']; + oRGANIZATIONNAME = json['ORGANIZATION_NAME']; + pOSITIONTITLE = json['POSITION_TITLE']; + rEPLACEMENTNAME = json['REPLACEMENT_NAME']; + sTATUS = json['STATUS']; + } + + Map toJson() { + final Map data = new Map(); + data['ABSENCE_ATTENDANCE_TYPE_NAME'] = this.aBSENCEATTENDANCETYPENAME; + data['CALENDAR_ENTRY_DESC'] = this.cALENDARENTRYDESC; + data['DATE_END'] = this.dATEEND; + data['DATE_START'] = this.dATESTART; + data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE; + data['EMPLOYEE_NAME'] = this.eMPLOYEENAME; + data['EMPLOYEE_NUMBER'] = this.eMPLOYEENUMBER; + data['EVENT_DATE'] = this.eVENTDATE; + data['LEAVE_TYPE'] = this.lEAVETYPE; + data['ORGANIZATION_ID'] = this.oRGANIZATIONID; + data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME; + data['POSITION_TITLE'] = this.pOSITIONTITLE; + data['REPLACEMENT_NAME'] = this.rEPLACEMENTNAME; + data['STATUS'] = this.sTATUS; + return data; + } +} diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 52fb6ad..9316182 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -41,7 +41,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { List? getMenuEntriesList; //Attendance Tracking API's & Methods - Future fetchAttendanceTracking() async { + Future fetchAttendanceTracking(context) async { try { attendanceTracking = await DashboardApiClient().getAttendanceTracking(); print("attendanceTracking:" + (attendanceTracking!.pRemainingHours).toString()); @@ -59,7 +59,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { notifyListeners(); } catch (ex) { - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } return true; } @@ -71,8 +71,8 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { return ((hour * 60 * 60) + (mints * 60) + seconds); } - update() { - fetchAttendanceTracking(); + update(context) { + fetchAttendanceTracking(context); // isAttendanceTrackingLoading = !isAttendanceTrackingLoading; // isWorkListLoading = !isWorkListLoading; // attendanceTracking?.pSwipeIn = "a"; @@ -101,12 +101,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { logger.wtf(ex); if (showLoading) Utils.hideLoading(context); notifyListeners(); - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } } //Missing Siwpe API's & Methods - Future fetchMissingSwipe() async { + Future fetchMissingSwipe(context) async { try { GenericResponseModel? genericResponseModel = await DashboardApiClient().getOpenMissingSwipes(); isMissingSwipeLoading = false; @@ -116,12 +116,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { isMissingSwipeLoading = false; logger.wtf(ex); notifyListeners(); - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } } //Leave and Ticket Balance API's & Methods - Future fetchLeaveTicketBalance() async { + Future fetchLeaveTicketBalance(context) async { try { GenericResponseModel? genericResponseModel = await DashboardApiClient().getAccrualBalances(); isLeaveTicketBalanceLoading = false; @@ -132,7 +132,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { isLeaveTicketBalanceLoading = false; logger.wtf(ex); notifyListeners(); - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } } @@ -151,7 +151,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } catch (ex) { logger.wtf(ex); notifyListeners(); - Utils.handleException(ex, null); + Utils.handleException(ex, null, null); } } @@ -166,7 +166,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } catch (ex) { logger.wtf(ex); notifyListeners(); - Utils.handleException(ex, null); + Utils.handleException(ex, null, null); } } @@ -187,4 +187,8 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { // } return menus; } + + void notify() { + notifyListeners(); + } } diff --git a/lib/provider/eit_provider_model.dart b/lib/provider/eit_provider_model.dart new file mode 100644 index 0000000..1543184 --- /dev/null +++ b/lib/provider/eit_provider_model.dart @@ -0,0 +1,36 @@ +import 'dart:convert'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/dashboard_api_client.dart'; +import 'package:mohem_flutter_app/api/eit_api_client.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/main.dart'; +import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart'; +import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; +import 'package:mohem_flutter_app/models/dashboard/menus.dart'; +import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/widgets/Updater.dart'; + +/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool +// ignore: prefer_mixin +class EITProviderModel with ChangeNotifier, DiagnosticableTreeMixin { + List? eitTransactionList; + late bool isEitLoaded = false; + void getEITList(String functionName) async { + try { + eitTransactionList = await EITApiClient().getEITTransactions(functionName); + isEitLoaded = true; + + notifyListeners(); + } catch (ex) { + isEitLoaded = false; + logger.wtf(ex); + notifyListeners(); + Utils.handleException(ex, null, (ts) { + print(ts); + }); + } + } +} diff --git a/lib/ui/attendance/monthly_attendance.dart b/lib/ui/attendance/monthly_attendance.dart new file mode 100644 index 0000000..fa531a3 --- /dev/null +++ b/lib/ui/attendance/monthly_attendance.dart @@ -0,0 +1,804 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:mohem_flutter_app/api/monthlyAttendance_api_client.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/utils.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/models/get_day_hours_type_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; +import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; +import 'package:provider/provider.dart'; +import 'package:syncfusion_flutter_calendar/calendar.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:pie_chart/pie_chart.dart'; + +class MonthlyAttendance extends StatefulWidget { + MonthlyAttendance({Key? key}) : super(key: key); + + @override + _MonthlyAttendanceState createState() { + return _MonthlyAttendanceState(); + } +} + +class _MonthlyAttendanceState extends State { + bool isPresent = true; + bool isAbsent = true; + bool isMissingDays = true; + bool isOffDays = true; + DateTime date = DateTime.now(); + late var formattedDate; + var currentMonth = DateTime.now().month; + String searchMonth = getMonth(DateTime.now().month); + int searchYear = DateTime.now().year; + int? pRTPID; + + List getDayHoursTypeDetailsList = []; + GetTimeCardSummaryList? getTimeCardSummaryList; + + // GetDayHoursTypeDetailsList? getDayHoursTypeDetailsList; + GetScheduleShiftsDetailsList? getScheduleShiftsDetailsList; + + @override + void initState() { + super.initState(); + getTimeCardSummary(searchMonth, searchYear); + getDayHoursTypeDetails(date.day, searchMonth, searchYear); + formattedDate = DateFormat('MMM-yyyy').format(date); + } + + void getTimeCardSummary(searchMonth, searchYear) async { + try { + Utils.showLoading(context); + getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void getDayHoursTypeDetails(index, searchMonth, searchYear) async { + try { + Utils.showLoading(context); + getDayHoursTypeDetailsList = await MonthlyAttendanceApiClient().getDayHoursTypeDetails(searchMonth, searchYear); + Utils.hideLoading(context); + pRTPID = getDayHoursTypeDetailsList[index].rTPID; + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + countAllAttendDays(); + getScheduleShiftsDetails(pRTPID); + } + + getScheduleShiftsDetails(pRTPID) async { + try { + Utils.showLoading(context); + getScheduleShiftsDetailsList = await MonthlyAttendanceApiClient().getScheduleShiftsDetails(pRTPID); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + countAllAttendDays() { + // print(getDayHoursTypeDetailsList.length); + for (int i = 0; i < getDayHoursTypeDetailsList.length; i++) { + if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'Y') { + isPresent = true; + isAbsent = false; + isMissingDays = false; + isOffDays = false; + } else if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[i].aBSENTFLAG == 'Y') { + isPresent = false; + isAbsent = true; + isMissingDays = false; + isOffDays = false; + } else if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[i].dAYTYPE == 'OFF') { + isPresent = false; + isAbsent = false; + isMissingDays = false; + isOffDays = true; + } else { + isPresent = false; + isAbsent = false; + isMissingDays = true; + isOffDays = false; + } + } + } + + final CalendarController _calendarController = CalendarController(); + + final List _colorList = [Color(0xff2AB2AB), Color(0xff202529)]; + + @override + Widget build(BuildContext context) { + Map dataMap = { + "Present": getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble(), + "Absent": getTimeCardSummaryList!.aBSENTDAYS!.toDouble(), + }; + return Scaffold( + appBar: AppBar( + backgroundColor: MyColors.white, + leading: IconButton( + icon: const Icon( + Icons.arrow_back_ios, + color: MyColors.backgroundBlackColor, + ), + onPressed: () => Navigator.pop(context), + ), + ), + backgroundColor: Colors.white, + body: ListView( + scrollDirection: Axis.vertical, + children: [ + Column( + children: [ + 20.height, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Attendance".toText24(isBold: true, color: MyColors.darkIconColor), + Row( + children: [ + Text(formattedDate), + const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor), + ], + ).onPress(() async { + await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2021), + lastDate: DateTime.now(), + builder: (context, child) { + return Theme( + data: ThemeData.dark().copyWith( + colorScheme: const ColorScheme.dark( + primary: MyColors.lightGreenColor, + onPrimary: MyColors.white, + surface: MyColors.lightGreenColor, + onSurface: MyColors.darkTextColor, + ), + dialogBackgroundColor: Colors.white, + ), + child: child!, + ); + }, + ).then((selectedDate) { + if (selectedDate != null) { + var selectedMonth = DateFormat('MMMM').format(selectedDate); + var selectedYear = DateFormat('yyyy').format(selectedDate); + searchMonth = selectedMonth; + searchYear = int.parse(selectedYear); + setState(() { + // date = selectedDate; + formattedDate = DateFormat('MMMM-yyyy').format(selectedDate); + getTimeCardSummary(searchMonth, searchYear); + getDayHoursTypeDetails(selectedDate.day, searchMonth, searchYear); + }); + } + }); + }) + ], + ).paddingOnly(left: 21, right: 21), + 18.height, + AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()).paddingOnly(left: 21, right: 21), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + optionUI("Schedule\nDays", "${getTimeCardSummaryList!.sCHEDULEDAYS}"), + 6.width, + optionUI("Off\nDays", "${getTimeCardSummaryList!.oFFDAYS}"), + 6.width, + optionUI("Non\nAnalyzed", "${getTimeCardSummaryList!.uNAUTHORIZEDLEAVE}"), + 6.width, + optionUI("Shortage\nHour", "${getTimeCardSummaryList!.sHORTAGEHRS}"), + ], + ).paddingOnly(left: 21, right: 21), + 35.height, + Container( + width: double.infinity, + height: 227, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.darkColor.withOpacity(0.1), + ), + ], + ), + child: Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + "Attendance".toText12(isBold: true, color: MyColors.grey3AColor), + "Stats".toText24(isBold: true, color: MyColors.grey3AColor), + ], + ).paddingOnly(left: 21, top: 29, bottom: 36), + Row( + children: [ + Container( + height: 9, + width: 9, + decoration: BoxDecoration( + color: MyColors.lightGreenColor, + borderRadius: BorderRadius.circular(100), + ), + ), + Container( + margin: const EdgeInsets.only(left: 5, right: 5), + child: "PRESENT ${getTimeCardSummaryList!.aTTENDEDDAYS}".toText16(isBold: true, color: MyColors.lightGreenColor), + ), + ], + ).paddingOnly(left: 21, right: 23), + 8.height, + Row( + children: [ + Container( + height: 9, + width: 9, + decoration: BoxDecoration( + color: MyColors.backgroundBlackColor, + borderRadius: BorderRadius.circular(100), + ), + ), + Container( + margin: const EdgeInsets.only(left: 5, right: 5), + child: "ABSENT ${getTimeCardSummaryList!.aBSENTDAYS}".toText16( + isBold: true, + color: MyColors.backgroundBlackColor, + ), + ) + ], + ).paddingOnly(left: 21, top: 8), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 169, + height: 170, + child: PieChart( + dataMap: dataMap, + animationDuration: const Duration(milliseconds: 800), + chartLegendSpacing: 0, + chartRadius: MediaQuery.of(context).size.width / 5.2, + colorList: _colorList, + initialAngleInDegree: 0, + chartType: ChartType.ring, + ringStrokeWidth: 80, + legendOptions: const LegendOptions( + showLegendsInRow: false, + showLegends: false, + ), + chartValuesOptions: const ChartValuesOptions( + showChartValueBackground: false, + showChartValues: true, + showChartValuesInPercentage: true, + showChartValuesOutside: false, + decimalPlaces: 1, + chartValueStyle: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: MyColors.white, + )), + ), + ), + ], + ).paddingOnly(left: 65, top: 27, right: 21, bottom: 28), + ], + ), + ), + ], + ), + ], + ), + ); + } + + Widget optionUI(String title, String value) { + return AspectRatio( + aspectRatio: 1 / 1, + child: Container( + padding: const EdgeInsets.only(top: 10, left: 8, right: 8, bottom: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + offset: const Offset(0, 1), + blurRadius: 15, + color: MyColors.darkColor.withOpacity(0.1), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [title.toText10(color: MyColors.darkTextColor).expanded, value.toText20(color: MyColors.darkTextColor)], + ), + ), + ).expanded; + } + + Widget calendarWidget() { + return SfCalendar( + view: CalendarView.month, + // onViewChanged: viewChanged, + controller: _calendarController, + headerHeight: 0, + todayHighlightColor: MyColors.grey3AColor, + viewHeaderStyle: const ViewHeaderStyle( + dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600), + ), + monthCellBuilder: (cxt, build) { + int val = build.date.day; + val == countAllAttendDays(); + if (isPresent) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + gradient: const LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], + ), + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "${build.date.day}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.white, + ), + ), + ); + } else if (isAbsent) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: MyColors.backgroundBlackColor, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "${build.date.day}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.white, + ), + ), + ); + } else if (isMissingDays) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + border: Border.all(color: MyColors.backgroundBlackColor, width: 2.0, style: BorderStyle.solid), //Border.all + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "${build.date.day}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: Color(0xff1F2428), + ), + ), + ); + } else if (isOffDays) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: MyColors.greyACColor.withOpacity(.12), + shape: BoxShape.circle, + ), + alignment: Alignment.center, + child: Text( + "${build.date.day}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.greyA5Color, + ), + ), + ); + } else { + return Container(); + } + }, + monthViewSettings: const MonthViewSettings( + dayFormat: 'EEE', + showTrailingAndLeadingDates: false, + appointmentDisplayMode: MonthAppointmentDisplayMode.appointment, + showAgenda: false, + navigationDirection: MonthNavigationDirection.horizontal, + monthCellStyle: MonthCellStyle( + textStyle: TextStyle( + fontStyle: FontStyle.normal, + fontSize: 13, + color: Colors.white, + ), + ), + ), + showNavigationArrow: false, + showDatePickerButton: false, + showCurrentTimeIndicator: false, + showWeekNumber: false, + cellBorderColor: Colors.white, + selectionDecoration: BoxDecoration( + border: Border.all(color: MyColors.white, width: 10), + borderRadius: const BorderRadius.all(Radius.circular(100)), + shape: BoxShape.circle, + ), + dataSource: MeetingDataSource(_getDataSource()), + onTap: calendarTapped, + ); + } + + calendarTapped(CalendarTapDetails details) { + dynamic string = getScheduleShiftsDetailsList!.pERCENTAGE; + dynamic percentage = string!.indexOf('%'); + print(percentage); + print(details.date?.day.toString()); + int? index = details.date?.day; + if (index != null) { + index = index - 1; + } + getDayHoursTypeDetails(index, getMonth(details.date!.month), details.date?.year); + showModalBottomSheet( + context: context, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), + isScrollControlled: true, + backgroundColor: MyColors.backgroundBlackColor, + builder: (_) { + return DraggableScrollableSheet( + maxChildSize: 0.9, + expand: false, + builder: (_, controller) { + return Column( + children: [ + Container( + width: 75, + height: 7, + margin: const EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: MyColors.darkGreyColor, + ), + ), + Expanded( + child: ListView.builder( + controller: controller, + itemCount: 1, + itemBuilder: (_, i) => Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.vertical( + top: Radius.circular(35.0), + ), + color: MyColors.backgroundBlackColor, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column(children: [ + "${getScheduleShiftsDetailsList!.sCHEDULEDATE!.substring(0, 9)}".toText24(isBold: true, color: Colors.white), + "Attendance Details".tr().toText16(color: MyColors.lightGreyEFColor), + 21.height, + ]).paddingOnly(top: 25, left: 21, right: 21, bottom: 10), + Center( + child: CircularStepProgressBar( + totalSteps: 16 * 4, + currentStep: percentage, + width: 210, + height: 210, + selectedColor: MyColors.gradiantEndColor, + unselectedColor: MyColors.grey70Color, + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), + "Completed".tr().toText11(color: MyColors.greyACColor), + 19.height, + "Shift Time".tr().toText11(color: MyColors.greyACColor), + "${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), + ], + ), + ), + ), + ), + Container( + padding: const EdgeInsets.only(top: 20, bottom: 20), + ), + Stack( + children: [ + Container( + height: 5, + padding: const EdgeInsets.only(top: 24, bottom: 24), + color: MyColors.backgroundBlackColor, + ), + Container( + width: double.infinity, + decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white), + padding: const EdgeInsets.only(left: 21, right: 21, top: 28, bottom: 24), + child: Column( + children: [ + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 30, left: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Actual Check In ".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true), + ], + ), + ), + 40.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Actual Check Out".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true), + ], + ), + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.whiteColor, + ), + 25.height, + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 30, left: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Approved Check In".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true), + ], + ), + ), + 30.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Approved Check Out".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true), + ], + ), + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.whiteColor, + ), + 25.height, + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 30, left: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Late In".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getDayHoursTypeDetailsList[i].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), + ], + ), + ), + 80.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Excess".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getDayHoursTypeDetailsList[i].eXCESSHRS}".toText22(color: Colors.black, isBold: true), + ], + ), + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.whiteColor, + ), + 25.height, + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 30, left: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Shortage".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getDayHoursTypeDetailsList[i].sHORTAGEHRS}".toText22(color: Colors.black, isBold: true), + ], + ), + ), + 80.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Early Out".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getDayHoursTypeDetailsList[i].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), + ], + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ), + ], + ); + }, + ); + }, + ); + } + + List _getDataSource() { + final List meetings = []; + return meetings; + } + + static getMonth(int month) { + switch (month) { + case 1: + return "January"; + case 2: + return "February"; + case 3: + return "March"; + case 4: + return "April"; + case 5: + return "May"; + case 6: + return "June"; + case 7: + return "July"; + case 8: + return "August"; + case 9: + return "September"; + case 10: + return "October"; + case 11: + return "November"; + case 12: + return "December"; + } + } +} + +class MeetingDataSource extends CalendarDataSource { + MeetingDataSource(List source) { + appointments = source; + } + + @override + DateTime getStartTime(int index) { + return _getMeetingData(index).from; + } + + @override + DateTime getEndTime(int index) { + return _getMeetingData(index).to; + } + + @override + String getSubject(int index) { + return _getMeetingData(index).eventName; + } + + @override + Color getColor(int index) { + return _getMeetingData(index).background; + } + + @override + bool isAllDay(int index) { + return _getMeetingData(index).isAllDay; + } + + Meeting _getMeetingData(int index) { + final dynamic meeting = appointments; + Meeting meetingData; + if (meeting is Meeting) { + meetingData = meeting; + } + return meeting; + } +} + +class Meeting { + Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay); + + String eventName; + DateTime from; + DateTime to; + Color background; + bool isAllDay; +} diff --git a/lib/ui/bottom_sheets/attendence_details_bottom_sheet.dart b/lib/ui/bottom_sheets/attendence_details_bottom_sheet.dart new file mode 100644 index 0000000..ea9f798 --- /dev/null +++ b/lib/ui/bottom_sheets/attendence_details_bottom_sheet.dart @@ -0,0 +1,228 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; + +class AttendenceDetailsBottomSheet extends StatefulWidget { + + AttendenceDetailsBottomSheet({Key? key}) : super(key: key); + + @override + _AttendenceDetailsBottomSheetState createState() => _AttendenceDetailsBottomSheetState(); +} + +class _AttendenceDetailsBottomSheetState extends State { + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + bottomSheet:BottomSheet( + + onClosing: () => print("not getting called"), + builder: (_) => Container( + color: Colors.red, + height: MediaQuery.of(context).size.height*0.9, + child: Column( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( top: Radius.circular(25.0),), + color: MyColors.backgroundBlackColor, + ), + margin:EdgeInsets.only(top: 45) , + padding: EdgeInsets.only(left: 11, right: 11, bottom: 21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Padding( + padding: const EdgeInsets.all(10), + child: Container( + margin:EdgeInsets.only(top: 5) , + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(35.0),), + color: Color(0xff464646), + ), + width: 80, + height: 6, + ), + ), + ), + Container( + padding: EdgeInsets.only(top: 25,left: 11, right: 11, bottom: 10), + child: Column(children: [ + "June 13, 2021".toText24(isBold: true, color: Colors.white), + // LocaleKeys.attendanceDetails.tr().toText16(color: Color(0xffACACAC)), + // LocaleKeys.timeLeftToday.tr().toText16(color: Color(0xffACACAC)), + 21.height, + ] ), + ), + Center( + child: CircularStepProgressBar( + totalSteps: 16 * 4, + currentStep: 16, + width: 210, + height: 210, + selectedColor: MyColors.gradiantEndColor, + unselectedColor: MyColors.grey70Color, + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + "99%".toText32(color: Colors.white, isBold: true), + "Completed".tr().toText12(color: MyColors.greyACColor), + 19.height, + "Shift Time".tr().toText12(color: MyColors.greyACColor), + "08:00 - 17:00".toText22(color: Colors.white, isBold: true), + ], + ), + ), + ), + ), + ], + ), + ), + Stack( + children: [ + Container( + height: 32, + // padding: EdgeInsets.only(top: 24, bottom: 24), + color: MyColors.backgroundBlackColor, + ), + Container( + width: double.infinity, + decoration: BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white), + margin: EdgeInsets.only(top: 10), + padding: EdgeInsets.only(left: 21, right: 21, top: 24, bottom: 24), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children:[ + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + "Actual Check In ".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "08:27".toText22(color: Colors.black, isBold: true), + ], + ), + SizedBox(height: 30,), + Row( + children: [ + "Approved Check In".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "09:27".toText22(color: Color(0xff1FA269), isBold: true), + ], + ), + SizedBox(height: 30,), + Row( + children: [ + "Late In".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "00:27".toText22(color: Color(0xffD02127), isBold: true), + ], + ), + SizedBox(height: 30,), + Row( + children: [ "Shortage".tr().toText12(color: MyColors.black), + ] ), + SizedBox(height: 8,), + Row( + children: [ + "00:00".toText22(color: Colors.black, isBold: true),], + ), + ], + ), + ], + ), + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + "Actual Check Out".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "18:20".toText22(color: Colors.black, isBold: true),], + ), + SizedBox(height: 30,), + Row( + children: [ "Approved Check Out".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "18:20".toText22(color: Color(0xff1FA269), isBold: true),], + ), + SizedBox(height: 30,), + Row( + children: ["Excess".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "00:00".toText22(color: Colors.black, isBold: true),], + ), + SizedBox(height: 30,), + Row( + children: ["Early Out".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "00:00".toText22(color: Colors.black, isBold: true),], + ), + ], + ), + ], + ), + ] ), + ), + ]), + ], + ), + ) + )); + + } + + +} diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index c54dc05..354e0db 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -10,6 +10,7 @@ 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/provider/dashboard_provider_model.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'; import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; @@ -27,15 +28,15 @@ class DashboardScreen extends StatefulWidget { class _DashboardScreenState extends State { late DashboardProviderModel data; - + final GlobalKey _scaffoldState = GlobalKey(); @override void initState() { super.initState(); data = Provider.of(context, listen: false); - data.fetchAttendanceTracking(); + data.fetchAttendanceTracking(context); data.fetchWorkListCounter(context); - data.fetchMissingSwipe(); - data.fetchLeaveTicketBalance(); + data.fetchMissingSwipe(context); + data.fetchLeaveTicketBalance(context); data.fetchMenuEntries(); } @@ -47,344 +48,277 @@ class _DashboardScreenState extends State { @override Widget build(BuildContext context) { List namesD = ["Nostalgia Perfume Perfume", "Al Nafoura", "AlJadi", "Nostalgia Perfume"]; - + final GlobalKey _key = GlobalKey(); // return Scaffold( - body: Column( - children: [ - Row( - children: [ - Row( - mainAxisSize: MainAxisSize.min, - children: [ - CircularAvatar( - width: 34, - height: 34, - url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", + key: _scaffoldState, + body: Column( + children: [ + Row( + children: [ + Builder(builder: (context) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + CircularAvatar( + width: 34, + height: 34, + url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", + ), + 8.width, + SvgPicture.asset("assets/images/side_nav.svg"), + ], + ).onPress(() { + _scaffoldState.currentState!.openDrawer(); + }); + }), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + //AppLogo(), + 8.width, + LocaleKeys.mohemm.tr().toText14() + ], ), - 8.width, - SvgPicture.asset("assets/images/side_nav.svg"), - ], - ).onPress(() {}), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - //AppLogo(), - 8.width, - LocaleKeys.mohemm.tr().toText14() - ], ), - ), - SizedBox( - width: 36, - height: 36, - child: Stack( - alignment: Alignment.centerLeft, + SizedBox( + width: 36, + height: 36, + child: Stack( + alignment: Alignment.centerLeft, + children: [ + SvgPicture.asset("assets/images/announcements.svg"), + Positioned( + right: 0, + top: 0, + child: Container( + padding: const EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)), + child: "3".toText12(color: Colors.white), + ), + ) + ], + ), + ).onPress(() { + data.update(context); + }) + ], + ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), + Expanded( + child: SingleChildScrollView( + child: Column( children: [ - SvgPicture.asset("assets/images/announcements.svg"), - Positioned( - right: 0, - top: 0, - child: Container( - padding: const EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)), - child: "3".toText12(color: Colors.white), - ), - ) - ], - ), - ).onPress(() { - data.update(); - }) - ], - ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), - Expanded( - child: Column( - // padding: EdgeInsets.zero, - // physics: NeverScrollableScrollPhysics(), - children: [ - Expanded( - child: SingleChildScrollView( - child: Column( + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, + LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color), + "Mahmoud Shrouf".toText24(isBold: true), + 16.height, + Row( children: [ - LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color), - "Mahmoud Shrouf".toText24(isBold: true), - 16.height, - Row( - children: [ - Expanded( - child: AspectRatio( - aspectRatio: 159 / 159, - child: Consumer( - builder: (context, model, child) { - return (model.isAttendanceTrackingLoading - ? GetAttendanceTrackingShimmer() - : Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ - MyColors.gradiantEndColor, - MyColors.gradiantStartColor, - ]), - ), - child: Stack( - alignment: Alignment.center, + Expanded( + child: AspectRatio( + aspectRatio: 159 / 159, + child: Consumer( + builder: (context, model, child) { + return (model.isAttendanceTrackingLoading + ? GetAttendanceTrackingShimmer() + : Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ]), + ), + child: Stack( + alignment: Alignment.center, + children: [ + if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), - Column( - crossAxisAlignment: CrossAxisAlignment.start, + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), + if (model.isTimeRemainingInSeconds == 0) "01-02-2022".toText12(color: Colors.white), + if (model.isTimeRemainingInSeconds != 0) + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 9.height, + CountdownTimer( + endTime: model.endTime, + onEnd: null, + endWidget: "00:00:00".toText14(color: Colors.white, isBold: true), + textStyle: TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold), + ), + LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white), + 9.height, + ClipRRect( + borderRadius: BorderRadius.all( + Radius.circular(20), + ), + child: LinearProgressIndicator( + value: model.progress, + minHeight: 8, + valueColor: const AlwaysStoppedAnimation(Colors.white), + backgroundColor: const Color(0xff196D73), + ), + ), + ], + ), + ], + ).paddingOnly(top: 12, right: 15, left: 12), + ), + Row( children: [ Expanded( child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), - if (model.isTimeRemainingInSeconds == 0) "01-02-2022".toText12(color: Colors.white), - if (model.isTimeRemainingInSeconds != 0) - Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 9.height, - CountdownTimer( - endTime: model.endTime, - onEnd: null, - endWidget: "00:00:00".toText14(color: Colors.white, isBold: true), - textStyle: TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold), - ), - LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white), - 9.height, - ClipRRect( - borderRadius: BorderRadius.all( - Radius.circular(20), - ), - child: LinearProgressIndicator( - value: model.progress, - minHeight: 8, - valueColor: const AlwaysStoppedAnimation(Colors.white), - backgroundColor: const Color(0xff196D73), - ), - ), - ], - ), + LocaleKeys.checkIn.tr().toText12(color: Colors.white), + (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn) + .toString() + .toText14(color: Colors.white, isBold: true), + 4.height, ], - ).paddingOnly(top: 12, right: 15, left: 12), + ).paddingOnly(left: 12), ), - Row( - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.checkIn.tr().toText12(color: Colors.white), - (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn) - .toString() - .toText14(color: Colors.white, isBold: true), - 4.height, - ], - ).paddingOnly(left: 12), - ), - Container( - width: 45, - height: 45, - padding: const EdgeInsets.only(left: 14, right: 14), - decoration: const BoxDecoration( - color: Color(0xff259EA4), - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(15), - ), - ), - child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"), + Container( + width: 45, + height: 45, + padding: const EdgeInsets.only(left: 14, right: 14), + decoration: const BoxDecoration( + color: Color(0xff259EA4), + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(15), ), - ], + ), + child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"), ), ], ), ], ), - ).onPress(() { - Navigator.pushNamed(context, AppRoutes.todayAttendance); - })) - .animatedSwither(); - }, - ), - ), + ], + ), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.todayAttendance); + })) + .animatedSwither(); + }, ), - 9.width, - Expanded( - child: MenusWidget(), - ), - ], + ), + ), + 9.width, + Expanded( + child: MenusWidget(), ), - 20.height, ], - ).paddingOnly(left: 21, right: 21, top: 7), - ServicesWidget(), - 8.height, + ), ], - ), - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only(top: 31), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)), - border: Border.all(color: MyColors.lightGreyEDColor, width: 1), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, + ).paddingOnly(left: 21, right: 21, top: 7), + ServicesWidget(), + 8.height, + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 31), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)), + border: Border.all(color: MyColors.lightGreyEDColor, width: 1), + ), + child: Column( + mainAxisSize: MainAxisSize.min, children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - LocaleKeys.offers.tr().toText12(), - Row( + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, 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.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), - ], - ).paddingOnly(left: 21, right: 21), - 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: (cxt, index) { - return SizedBox( - width: 73, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 73, - height: 73, - decoration: BoxDecoration( - borderRadius: const BorderRadius.all( - Radius.circular(100), + ), + LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true), + ], + ).paddingOnly(left: 21, right: 21), + 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: (cxt, index) { + return SizedBox( + width: 73, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 73, + height: 73, + decoration: BoxDecoration( + borderRadius: const BorderRadius.all( + Radius.circular(100), + ), + border: Border.all(color: MyColors.lightGreyEDColor, width: 1), + ), + child: ClipRRect( + borderRadius: const BorderRadius.all( + Radius.circular(50), + ), + child: Image.network( + "https://play-lh.googleusercontent.com/NPo88ojmhah4HDiposucJmfQIop4z4xc8kqJK9ITO9o-yCab2zxIp7PPB_XPj2iUojo", + fit: BoxFit.cover, + ), + ), ), - border: Border.all(color: MyColors.lightGreyEDColor, width: 1), - ), - child: ClipRRect( - borderRadius: const BorderRadius.all( - Radius.circular(50), + 4.height, + Expanded( + child: namesD[6 % (index + 1)].toText12(isCenter: true, maxLine: 2), ), - child: Image.network( - "https://play-lh.googleusercontent.com/NPo88ojmhah4HDiposucJmfQIop4z4xc8kqJK9ITO9o-yCab2zxIp7PPB_XPj2iUojo", - fit: BoxFit.cover, - ), - ), - ), - 4.height, - Expanded( - child: namesD[6 % (index + 1)].toText12(isCenter: true, maxLine: 2), + ], ), - ], - ), - ); - }, - separatorBuilder: (cxt, index) => 8.width, - itemCount: 6), + ); + }, + separatorBuilder: (cxt, index) => 8.width, + itemCount: 6), + ), + ], ), - ], - ), - ) - ], - ), - ) - ], - ), - bottomNavigationBar: BottomNavigationBar( - items: [ - BottomNavigationBarItem( - icon: Padding( - padding: const EdgeInsets.all(4.0), - child: SvgPicture.asset( - "assets/icons/home.svg", - width: 20, - height: 20, - ), - ), - label: 'Home', - ), - BottomNavigationBarItem( - icon: Padding( - padding: const EdgeInsets.all(4.0), - child: SvgPicture.asset( - "assets/icons/create_req.svg", - width: 20, - height: 20, - ), - ), - label: 'Create Request', - ), - BottomNavigationBarItem( - icon: Padding( - padding: const EdgeInsets.all(4.0), - child: SvgPicture.asset( - "assets/icons/work_list.svg", - width: 20, - height: 20, - ), - ), - label: 'Work List', - ), - BottomNavigationBarItem( - icon: Padding( - padding: const EdgeInsets.all(4.0), - child: SvgPicture.asset( - "assets/icons/item_for_sale.svg", - width: 20, - height: 20, + ) + ], + ), ), - ), - label: 'Items for Sale', - ), - ], - currentIndex: 0, - selectedLabelStyle: TextStyle( - fontSize: 8, - color: Color(0xff989898), - fontWeight: FontWeight.w600, - ), - unselectedLabelStyle: TextStyle( - fontSize: 8, - color: Color(0xff989898), - fontWeight: FontWeight.w600, + ) + ], ), - type: BottomNavigationBarType.fixed, - selectedItemColor: Colors.black, - backgroundColor: Color(0xffF8F8F8), - onTap: (v) {}, - ), - ); + drawer: SafeArea(child: AppDrawer())); } } diff --git a/lib/ui/landing/today_attendance_screen.dart b/lib/ui/landing/today_attendance_screen.dart index 2008484..6268425 100644 --- a/lib/ui/landing/today_attendance_screen.dart +++ b/lib/ui/landing/today_attendance_screen.dart @@ -33,7 +33,7 @@ class TodayAttendanceScreen extends StatefulWidget { class _TodayAttendanceScreenState extends State { ValueNotifier result = ValueNotifier(null); late DashboardProviderModel data; - bool isNfcEnabled = false, isNfcLocationEnabled = false, isQrEnabled = false, isQrLocationEnabled = false, isWifiEnabled = false, isWifiLocationEnabled = false; + bool isNfcEnabled = true, isNfcLocationEnabled = false, isQrEnabled = false, isQrLocationEnabled = false, isWifiEnabled = false, isWifiLocationEnabled = false; @override void initState() { @@ -42,19 +42,19 @@ class _TodayAttendanceScreenState extends State { data = Provider.of(context, listen: false); } - checkAttendanceAvailablity() async { + void checkAttendanceAvailablity() async { bool isAvailable = await NfcManager.instance.isAvailable(); setState(() { AppState().privilegeListModel!.forEach((element) { - // Check availability - if (isAvailable) if (element.serviceName == "enableNFC") { - // if (element.previlege ?? false) - isNfcEnabled = true; + print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability + + if (element.serviceName == "enableNFC") { + if (isAvailable) if (element.previlege ?? false) isNfcEnabled = true; } else if (element.serviceName == "enableQR") { if (element.previlege ?? false) isQrEnabled = true; } else if (element.serviceName == "enableWIFI") { if (element.previlege ?? false) isWifiEnabled = true; - } else if (element.serviceName == "enableLocatoinNFC") { + } else if (element.serviceName!.trim() == "enableLocationNFC") { if (element.previlege ?? false) isNfcLocationEnabled = true; } else if (element.serviceName == "enableLocationQR") { if (element.previlege ?? false) isQrLocationEnabled = true; @@ -84,7 +84,7 @@ class _TodayAttendanceScreenState extends State { actions: [ IconButton( onPressed: () { - data.fetchAttendanceTracking(); + data.fetchAttendanceTracking(context); }, icon: Icon( Icons.ac_unit, @@ -190,24 +190,13 @@ class _TodayAttendanceScreenState extends State { gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1 / 1, crossAxisSpacing: 8, mainAxisSpacing: 8), children: [ attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () { - showNfcReader(context, onNcfScan: (String? nfcId) async { - print(nfcId); - Utils.showLoading(context); - try { - GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? ""); - bool status = await model.fetchAttendanceTracking(); - Utils.hideLoading(context); - } catch (ex) { - print(ex); - Utils.hideLoading(context); - Utils.handleException(ex, (msg) { - Utils.confirmDialog(context, msg); - }); - } - }); - // Location.getCurrentLocation((LatLng? latlng) { - // print(latlng!.longitude.toString()); - // }); + if (isNfcLocationEnabled) { + Location.getCurrentLocation((LatLng? latlng) { + performNfcAttendance(model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? ""); + }); + } else { + performNfcAttendance(model); + } }), attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {}), ], @@ -244,6 +233,30 @@ class _TodayAttendanceScreenState extends State { ); } + Future performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async { + if (isNfcLocationEnabled) { + print("nfc location enabled"); + } else { + print("nfc not location enabled"); + } + + showNfcReader(context, onNcfScan: (String? nfcId) async { + print(nfcId); + Utils.showLoading(context); + try { + GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng); + bool status = await model.fetchAttendanceTracking(context); + Utils.hideLoading(context); + } catch (ex) { + print(ex); + Utils.hideLoading(context); + Utils.handleException(ex, context, (msg) { + Utils.confirmDialog(context, msg); + }); + } + }); + } + Widget attendanceMethod(String title, String image, bool isEnabled, VoidCallback onPress) => Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), diff --git a/lib/ui/landing/widget/app_drawer.dart b/lib/ui/landing/widget/app_drawer.dart new file mode 100644 index 0000000..4ef5eb4 --- /dev/null +++ b/lib/ui/landing/widget/app_drawer.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; +import 'package:mohem_flutter_app/ui/landing/widget/drawer_item.dart'; +import 'package:provider/provider.dart'; + +class AppDrawer extends StatefulWidget { + @override + _AppDrawerState createState() => _AppDrawerState(); +} + +class _AppDrawerState extends State { + @override + Widget build(BuildContext context) { + return Container( + color: Colors.white, + child: Drawer( + child: Column(children: [ + const SizedBox( + height: 200, + ), + Expanded( + child: ListView(padding: const EdgeInsets.all(21), physics: const BouncingScrollPhysics(), children: [ + Divider(), + InkWell( + child: DrawerItem( + 'My Profile', + icon: Icons.person, + color: Colors.grey, + ), + onTap: () { + drawerNavigator(context, AppRoutes.profile); + }) + ])) + ]))); + } + + drawerNavigator(context, routeName) { + Navigator.of(context).pushNamed(routeName); + } +} + +String capitalizeOnlyFirstLater(String text) { + if (text.trim().isEmpty) return ""; + + return "${text[0].toUpperCase()}${text.substring(1)}"; +} diff --git a/lib/ui/landing/widget/drawer_item.dart b/lib/ui/landing/widget/drawer_item.dart new file mode 100644 index 0000000..301719b --- /dev/null +++ b/lib/ui/landing/widget/drawer_item.dart @@ -0,0 +1,59 @@ +import 'dart:ui'; +import 'package:flutter/material.dart'; + +class DrawerItem extends StatefulWidget { + final String title; + final String subTitle; + final IconData icon; + final Color color; + final dynamic assetLink; + + const DrawerItem(this.title, {required this.icon, required this.color, this.subTitle = '', this.assetLink}); + + @override + _DrawerItemState createState() => _DrawerItemState(); +} + +class _DrawerItemState extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top: 0, bottom: 5, left: 0, right: 0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (widget.assetLink != null) + Container( + height: 20, + width: 20, + child: Image.asset(widget.assetLink), + ), + if (widget.assetLink == null) + Icon( + widget.icon, + color: widget.color ?? Colors.black87, + size: 25, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.45, + child: Text(widget.title, + style: TextStyle( + color: widget.color ?? Color(0xFF2E303A), + fontSize: 14, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.84, + )), + ), + ], + ), + ), + ], + )); + } +} diff --git a/lib/ui/landing/widget/missing_swipe.dart b/lib/ui/landing/widget/missing_swipe.dart new file mode 100644 index 0000000..ebd011a --- /dev/null +++ b/lib/ui/landing/widget/missing_swipe.dart @@ -0,0 +1,110 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.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/dashboard/menus.dart'; +import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart'; +import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; +import 'package:mohem_flutter_app/provider/eit_provider_model.dart'; +import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart'; +import 'package:mohem_flutter_app/widgets/loading_dialog.dart'; +import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; +import 'package:provider/provider.dart'; + +class MissingSwipe extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Consumer( + builder: (context, data, child) { + return !data.isEitLoaded + ? LoadingDialog() + : SizedBox( + width: double.infinity, + height: double.infinity, + child: ListView.separated( + itemBuilder: (context, index) { + return rowItem(data.eitTransactionList![index]); + }, + separatorBuilder: (context, index) { + return 12.height; + }, + itemCount: data.eitTransactionList?.length ?? 0, + padding: EdgeInsets.only(left: 21, right: 21), + )); + }, + ); + } + + Widget rowItem(CollectionTransaction types) { + return InkWell( + onTap: () { + // Navigator.pushNamed(context, AppRoutes.missingSwipe); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + gradient: LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomRight, colors: [Colors.red, Colors.blue]), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + "assets/images/miss_swipe.svg", + color: Colors.white, + ), + 2.height, + Text(types.aPPLICATIONCOLUMNNAME.toString()) + ], + ).paddingAll(6), + ), + 12.width, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + "Missing Swipe Request".toText16(), + "Missing Swipe Request for Hussain, Mohammad has been approved".toText10(), + 12.height, + Row( + children: [ + Expanded(child: "07 Jan 2021".toText10(color: MyColors.lightTextColor)), + SvgPicture.asset( + "assets/images/arrow_next.svg", + color: MyColors.darkIconColor, + ) + ], + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index 89a0aa6..f69776c 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -1,10 +1,13 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:mohem_flutter_app/classes/utils.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/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; import 'package:provider/provider.dart'; @@ -15,13 +18,13 @@ class ServicesWidget extends StatelessWidget { List namesT = [LocaleKeys.monthlyAttendance.tr(), LocaleKeys.workFromHome.tr(), LocaleKeys.ticketRequest.tr(), LocaleKeys.monthlyAttendance.tr()]; List iconT = [ "assets/images/monthly_attendance.svg", - "assets/images/work_from_home.svg", + "assets/images/dynamic_screens.svg", "assets/images/ticket_request.svg", - "assets/images/work_from_home.svg", - "assets/images/work_from_home.svg", - "assets/images/work_from_home.svg", - "assets/images/work_from_home.svg", - "assets/images/work_from_home.svg" + "assets/images/dynamic_screens.svg", + "assets/images/dynamic_screens.svg", + "assets/images/dynamic_screens.svg", + "assets/images/dynamic_screens.svg", + "assets/images/dynamic_screens.svg" ]; return Consumer( @@ -30,83 +33,89 @@ class ServicesWidget extends StatelessWidget { ? whileLoading() : ListView.separated( itemBuilder: (context, parentIndex) { - return Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - firstWord(data.homeMenus![parentIndex].menuEntry.prompt!).toText12(), - lastWord(data.homeMenus![parentIndex].menuEntry.prompt!).toText24(isBold: true), - ], - ), - ), - LocaleKeys.viewAllServices.tr().toText12(isUnderLine: true), - ], - ).paddingOnly(left: 21, right: 21), - SizedBox( - height: 105 + 26, - child: ListView.separated( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), - scrollDirection: Axis.horizontal, - itemBuilder: (cxt, index) { - return AspectRatio( - aspectRatio: 105 / 105, - child: data.isServicesMenusLoading - ? ServicesMenuShimmer() - : Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], + return Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().expanded, + LocaleKeys.viewAllServices.tr().toText12(isUnderLine: true), + ], + ).paddingOnly(left: 21, right: 21), + SizedBox( + height: 105 + 26, + child: ListView.separated( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), + scrollDirection: Axis.horizontal, + itemBuilder: (cxt, index) { + return AspectRatio( + aspectRatio: 105 / 105, + child: data.isServicesMenusLoading + ? ServicesMenuShimmer() + : Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SvgPicture.asset(iconT[index]), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true), + ), + SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4) + ], + ) + ], + ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12), ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SvgPicture.asset(iconT[index]), - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true), - ), - SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4) - ], - ) - ], - ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12), - ), - ); - }, - separatorBuilder: (cxt, index) => 9.width, - itemCount: data.homeMenus![parentIndex].menuEntiesList.length), - ), - ], + ).onPress(() { + handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]); + }); + }, + separatorBuilder: (cxt, index) => 9.width, + itemCount: data.homeMenus![parentIndex].menuEntiesList.length), + ), + ], + ), ); }, separatorBuilder: (context, index) { return 12.height; }, shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: const NeverScrollableScrollPhysics(), itemCount: data.homeMenus!.length); }, ); } + void handleOnPress(context, GetMenuEntriesList menuEntry) { + print(menuEntry.menuName); + if (menuEntry.menuName == "HMG_OTL_SS" || menuEntry.menuName == "HMG_PT_OTL_SS") { + Navigator.pushNamed(context, AppRoutes.myAttendance); + } else { + Utils.showToast("In Progress"); + } + } + String firstWord(String value) { return value.split(" ").length > 1 ? value.split(" ")[0] : ""; } diff --git a/lib/ui/login/forgot_password_screen.dart b/lib/ui/login/forgot_password_screen.dart index 17b105f..f058d43 100644 --- a/lib/ui/login/forgot_password_screen.dart +++ b/lib/ui/login/forgot_password_screen.dart @@ -69,7 +69,7 @@ class _ForgotPasswordScreenState extends State { } catch (ex) { print(ex); Utils.hideLoading(context); - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } } diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index d5a6061..7910a86 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -69,25 +69,24 @@ class _LoginScreenState extends State { } String? firebaseToken; - + GetMobileLoginInfoListModel? loginInfo; Future checkFirebaseToken() async { try { Utils.showLoading(context); firebaseToken = await _firebaseMessaging.getToken(); - GetMobileLoginInfoListModel? loginInfo = await LoginApiClient().getMobileLoginInfoNEW(firebaseToken ?? "", Platform.isAndroid ? "android" : "ios"); + loginInfo = await LoginApiClient().getMobileLoginInfoNEW(firebaseToken ?? "", Platform.isAndroid ? "android" : "ios"); if (loginInfo == null) { Utils.hideLoading(context); - print("Device token not found"); return; } else { + loginInfo!.deviceToken = firebaseToken; await checkPrefs(); Utils.hideLoading(context); performLogin(); } } catch (ex) { - print(ex); Utils.hideLoading(context); - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } } @@ -112,14 +111,14 @@ class _LoginScreenState extends State { } Utils.hideLoading(context); if (_autoLogin) { - Navigator.pushNamed(context, AppRoutes.verifyLastLogin); + Navigator.pushNamed(context, AppRoutes.verifyLastLogin, arguments: loginInfo); } else { Navigator.pushNamed(context, AppRoutes.verifyLogin, arguments: "$firebaseToken"); } } catch (ex) { print(ex); Utils.hideLoading(context); - Utils.handleException(ex, (msg) { + Utils.handleException(ex, context, (msg) { Utils.confirmDialog(context, msg); }); } @@ -127,8 +126,10 @@ class _LoginScreenState extends State { @override Widget build(BuildContext context) { - username.text="15153"; - password.text="Xy12345@"; + username.text = "15153"; + password.text = "Abcd@1234"; + // username.text = "15444"; + // password.text = "w123456@"; return Scaffold( body: Column( children: [ diff --git a/lib/ui/login/new_password_screen.dart b/lib/ui/login/new_password_screen.dart index e0a8f94..7f011e7 100644 --- a/lib/ui/login/new_password_screen.dart +++ b/lib/ui/login/new_password_screen.dart @@ -46,7 +46,7 @@ class _NewPasswordScreenState extends State { } catch (ex) { print(ex); Utils.hideLoading(context); - Utils.handleException(ex, (msg) { + Utils.handleException(ex, context, (msg) { Utils.confirmDialog(context, msg); }); } diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index 52ec751..2e8e255 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -222,47 +224,60 @@ class _VerifyLastLoginScreenState extends State { // isMoreOption = true; }); } else { - Utils.showLoading(context); - if (_flag == 2 || _flag == 3) { - bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); - if (authenticateWithFaceAndTouchID) { - Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route route) => false); - return; - } else { - Utils.hideLoading(context); - return; - } - } - await LoginApiClient().checkMobileAppVersion(); - await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!); - BasicMemberInformationModel? memberInformationModel = await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType( - checkBiometricIsAvailable(BiometricType.fingerprint) ? 1 : 0, AppState().memberLoginList?.pMOBILENUMBER, _flag, AppState().getUserName); - Utils.hideLoading(context); - OtpDialog( - context, - _flag, - int.tryParse(AppState().memberLoginList?.pMOBILENUMBER ?? ""), - (value) async { - Utils.showLoading(context); - try { - GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName); - if (genericResponseModel?.errorMessage != null) { - Utils.showToast(genericResponseModel?.errorMessage ?? ""); - // Navigator.pop(context); - } - Utils.hideLoading(context); - Navigator.pop(context); + try { + Utils.showLoading(context); + if (_flag == 2 || _flag == 3) { + bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); + if (authenticateWithFaceAndTouchID) { Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route route) => false); - } catch (ex) { - print(ex); + return; + } else { Utils.hideLoading(context); - Utils.handleException(ex, null); + return; } - }, - () => { - Navigator.pop(context), - }, - ).displayDialog(context); + } + await LoginApiClient().checkMobileAppVersion(); + await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!); + BasicMemberInformationModel? memberInformationModel = await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType( + checkBiometricIsAvailable(BiometricType.fingerprint) ? 1 : 0, AppState().memberLoginList?.pMOBILENUMBER, _flag, AppState().getUserName); + Utils.hideLoading(context); + OtpDialog( + context, + _flag, + int.tryParse(AppState().memberLoginList?.pMOBILENUMBER ?? ""), + (value) async { + Utils.showLoading(context); + try { + GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, 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!, + mobileLoginInfoListModel!.deviceToken!, + Platform.isAndroid ? "android" : "ios"); + if (genericResponseModel?.errorMessage != null) { + Utils.showToast(genericResponseModel?.errorMessage ?? ""); + // Navigator.pop(context); + } + Utils.hideLoading(context); + Navigator.pop(context); + Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route route) => false); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + }, + () => { + Navigator.pop(context), + }, + ).displayDialog(context); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } // authenticateUser(_flag, isActive: _loginIndex); } diff --git a/lib/ui/login/verify_login_screen.dart b/lib/ui/login/verify_login_screen.dart index 8e9255f..8c2b367 100644 --- a/lib/ui/login/verify_login_screen.dart +++ b/lib/ui/login/verify_login_screen.dart @@ -666,7 +666,7 @@ class _VerifyLoginScreenState extends State { (value) async { Utils.showLoading(context); try { - GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName); + GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(true, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName); GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW( AppState().memberLoginList?.pEMAILADDRESS ?? "", genericResponseModel?.pSESSIONID ?? 0, @@ -682,6 +682,9 @@ class _VerifyLoginScreenState extends State { AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? []; AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first; MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []); + genericResponseModel.privilegeList!.forEach((element) { + print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability + }); PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []); Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!); Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!); @@ -692,7 +695,7 @@ class _VerifyLoginScreenState extends State { } catch (ex) { print(ex); Utils.hideLoading(context); - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } }, () => { @@ -702,7 +705,7 @@ class _VerifyLoginScreenState extends State { } catch (ex) { print(ex); Utils.hideLoading(context); - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } } }, diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart new file mode 100644 index 0000000..114c53c --- /dev/null +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -0,0 +1,220 @@ +import 'dart:io'; + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; +import 'package:mohem_flutter_app/classes/utils.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/dyanmic_forms/get_set_values_request_model.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_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'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; + +class DynamicInputScreen extends StatefulWidget { + DynamicInputScreen({Key? key}) : super(key: key); + + @override + _DynamicInputScreenState createState() { + return _DynamicInputScreenState(); + } +} + +class _DynamicInputScreenState extends State { + GenericResponseModel? genericResponseModel; + List? getEitDffStructureList; + DynamicListViewParams? dynamicParams; + + @override + void initState() { + super.initState(); + } + + void getTransactionsStructure() async { + try { + Utils.showLoading(context); + genericResponseModel = await MyAttendanceApiClient().getEitDffStructure(dynamicParams!.dynamicId); + getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void calGetValueSetValues(GetEITDFFStructureList structureList) async { + try { + Utils.showLoading(context); + String segmentId = structureList.cHILDSEGMENTSVS!; + List filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? []; + List> values = filteredList + .map((e) => GetSetValuesRequestModel( + sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) + .toJson()) + .toList(); + ESERVICESVS genericResponseModel = await MyAttendanceApiClient().getValueSetValues(structureList.cHILDSEGMENTSVS!, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); + + int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); + getEitDffStructureList![index].eSERVICESVS!.add(genericResponseModel); + // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + if (dynamicParams == null) { + dynamicParams = ModalRoute.of(context)!.settings.arguments as DynamicListViewParams; + getTransactionsStructure(); + } + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget( + context, + title: dynamicParams!.title, + ), + body: Column( + children: [ + (getEitDffStructureList == null + ? const SizedBox() + : (getEitDffStructureList!.isEmpty + ? LocaleKeys.noDataAvailable.tr().toText16().center + : ListView.separated( + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.all(21), + itemBuilder: (cxt, int parentIndex) => parseDynamicFormatType(getEitDffStructureList![parentIndex], parentIndex), + separatorBuilder: (cxt, index) => 0.height, + itemCount: getEitDffStructureList!.length))) + .expanded, + // 12.height, + DefaultButton( + LocaleKeys.next.tr(), + (getEitDffStructureList ?? []).isEmpty + ? null + : () => { + //Navigator.of(context).pushNamed(LOGIN_TYPE) + }, + ).insideContainer, + ], + ), + ); + } + + Widget parseDynamicFormatType(GetEITDFFStructureList model, int index) { + if (model.dISPLAYFLAG != "N") { + } else { + return const SizedBox(); + } + + if (model.fORMATTYPE == "C") { + if (model.eSERVICESVS?.isNotEmpty ?? false) { + return PopupMenuButton( + child: DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? "", + isEnable: false, + isPopup: true, + ).paddingOnly(bottom: 12), + itemBuilder: (_) => >[ + for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i), + ], + onSelected: (int index) { + ESERVICESDV eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: model.eSERVICESVS![index].vALUECOLUMNNAME, + pRETURNMSG: "null", + pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, + pVALUECOLUMNNAME: model.eSERVICESVS![index].vALUECOLUMNNAME); + + print(model.eSERVICESVS![index].toJson()); + }); + } + + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? "", + isReadOnly: model.rEADONLY == "Y", + onChange: (text) { + model.fieldAnswer = text; + }, + ).paddingOnly(bottom: 12); + } else if (model.fORMATTYPE == "X") { + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? (getEitDffStructureList![index].fieldAnswer ?? ""), + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + DateTime date = await _selectDate(context); + DateTime date1 = DateTime(date.year, date.month, date.day); + getEitDffStructureList![index].fieldAnswer = date.toString(); + ESERVICESDV eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1), + pRETURNMSG: "null", + pRETURNSTATUS: getEitDffStructureList![index].dEFAULTVALUE, + pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + getEitDffStructureList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) { + calGetValueSetValues(model); + } + }, + ).paddingOnly(bottom: 12); + } + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [], + ).objectContainerView(); + } + + DateTime selectedDate = DateTime.now(); + + Future _selectDate(BuildContext context) async { + DateTime time = selectedDate; + if (!Platform.isIOS) { + await showCupertinoModalPopup( + context: context, + builder: (cxt) => Container( + height: 250, + color: Colors.white, + child: CupertinoDatePicker( + backgroundColor: Colors.white, + mode: CupertinoDatePickerMode.date, + onDateTimeChanged: (value) { + if (value != null && value != selectedDate) { + time = value; + } + }, + initialDateTime: selectedDate, + ), + ), + ); + } else { + final DateTime? picked = + await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); + if (picked != null && picked != selectedDate) { + time = picked; + } + } + return time; + } +} diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart new file mode 100644 index 0000000..37ba465 --- /dev/null +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart @@ -0,0 +1,106 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/utils.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/get_eit_transaction_list_model.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; + +class DynamicListViewParams { + String title; + String dynamicId; + String uRL; + String requestID; + String colsURL; + DynamicListViewParams(this.title, this.dynamicId, {this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = ''}); +} + +class DynamicListViewScreen extends StatefulWidget { + DynamicListViewScreen({Key? key}) : super(key: key); + + @override + _DynamicListViewScreenState createState() { + return _DynamicListViewScreenState(); + } +} + +class _DynamicListViewScreenState extends State { + List? getEITTransactionList; + DynamicListViewParams? dynamicParams; + @override + void initState() { + super.initState(); + } + + void getTransactions() async { + try { + Utils.showLoading(context); + getEITTransactionList = await MyAttendanceApiClient().getEitTransaction(dynamicParams!.dynamicId); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + if (dynamicParams == null) { + dynamicParams = ModalRoute.of(context)!.settings.arguments as DynamicListViewParams; + getTransactions(); + } + + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget( + context, + title: dynamicParams!.title, + ), + body: getEITTransactionList == null + ? const SizedBox() + : (getEITTransactionList!.isEmpty + ? LocaleKeys.noDataAvailable.tr().toText16().center + : ListView.separated( + physics: const BouncingScrollPhysics(), + padding: EdgeInsets.all(21), + itemBuilder: (cxt, int parentIndex) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++) + if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y") + ItemDetailView( + getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!, getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""), + ], + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: getEITTransactionList!.length)), + floatingActionButton: Container( + height: 50, + width: 50, + decoration: const BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient(transform: GradientRotation(.83), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ]), + ), + child: const Icon(Icons.add, color: Colors.white, size: 30), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.addDynamicInput, arguments: dynamicParams); + }), + ); + } +} diff --git a/lib/ui/my_attendance/my_attendance_screen.dart b/lib/ui/my_attendance/my_attendance_screen.dart new file mode 100644 index 0000000..2b74c98 --- /dev/null +++ b/lib/ui/my_attendance/my_attendance_screen.dart @@ -0,0 +1,65 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.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/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; + +class MyAttendanceScreen extends StatelessWidget { + MyAttendanceScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget( + context, + title: LocaleKeys.myAttendance.tr(), + ), + body: SizedBox( + width: double.infinity, + height: double.infinity, + child: ListView( + children: [ + itemView( + "assets/images/pdf.svg", + LocaleKeys.missingSwipes.tr(), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS")); + + }), + 12.height, + itemView( + "assets/images/pdf.svg", + LocaleKeys.workFromHome.tr(), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.workFromHome.tr(), "HMG_OTL_WFH_EIT_SS")); + }), + 12.height, + itemView( + "assets/images/pdf.svg", + LocaleKeys.workOnBreak.tr(), + ), + ], + ).paddingAll(21)), + ); + } + + Widget itemView(String icon, String title) { + return Row( + children: [ + (title).toText16().expanded, + 12.width, + SvgPicture.asset( + "assets/images/arrow_next.svg", + color: MyColors.darkIconColor, + ) + ], + ).objectContainerView(); + } +} diff --git a/lib/ui/profile/basic_details.dart b/lib/ui/profile/basic_details.dart new file mode 100644 index 0000000..8a316fd --- /dev/null +++ b/lib/ui/profile/basic_details.dart @@ -0,0 +1,238 @@ +import 'package:easy_localization/src/public_ext.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/classes/utils.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; + +class BasicDetails extends StatefulWidget { + const BasicDetails({Key? key}) : super(key: key); + + @override + _BasicDetailsState createState() => _BasicDetailsState(); +} + +class _BasicDetailsState extends State { + String? fullName = ""; + String? maritalStatus = ""; + String? birthDate = ""; + String? civilIdentityNumber = ""; + String? emailAddress = ""; + String? employeeNo = ""; + + List getEmployeeBasicDetailsList = []; + + @override + void initState() { + super.initState(); + getEmployeeBasicDetails(); + basicDetails(); + } + + void getEmployeeBasicDetails() async { + try { + Utils.showLoading(context); + getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails(); + Utils.hideLoading(context); + basicDetails(); + print("getEmployeeBasicDetailsList.length"); + print(getEmployeeBasicDetailsList.length); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + basicDetails() { + for (int i = 0; i < getEmployeeBasicDetailsList.length; i++) { + if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'FULL_NAME') { + fullName = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'MARITAL_STATUS') { + maritalStatus = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'DATE_OF_BIRTH') { + birthDate = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'NATIONAL_IDENTIFIER') { + civilIdentityNumber = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'EMAIL_ADDRESS') { + emailAddress = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'EMPLOYEE_NUMBER') { + employeeNo = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } + } + } + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBarWidget( + context, + title: LocaleKeys.profile_basicDetails.tr(), + ), + // appBar: AppBar( + // backgroundColor: MyColors.white, + // leading: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // IconButton( + // icon: const Icon( + // Icons.arrow_back_ios, + // color: MyColors.backgroundBlackColor, + // ), + // onPressed: () => Navigator.pop(context), + // ), + // "Basic Details".toText24(isBold: true, color: MyColors.blackColor), + // ], + // ), + // ), + backgroundColor: MyColors.backgroundColor, + bottomSheet: footer(), + body: Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 28, + left: 26, + right: 26, + ), + padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 5), + height: 280, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), + ), + ], + color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + LocaleKeys.fullName.tr().toText13(color: MyColors.lightGrayColor), + "${fullName}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20, + ), + LocaleKeys.maritalStatus.tr().toText13(color: MyColors.lightGrayColor), + "${maritalStatus}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20, + ), + LocaleKeys.dateOfBirth.tr().toText13(color: MyColors.lightGrayColor), + "${birthDate}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20, + ), + LocaleKeys.civilIdentityNumber.tr().toText13(color: MyColors.lightGrayColor), + "${civilIdentityNumber}".toText16(isBold: true, color: MyColors.blackColor), + ]), + ), + ], + )); + } + + footer() { + return Container( + decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + color: MyColors.white, + boxShadow: [ + BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), + ], + ), + child: DefaultButton(LocaleKeys.update.tr(), () async { + showAlertDialog(context); + }).insideContainer, + ); + } + + showAlertDialog(BuildContext context) { + dynamic changeOrNew = 1; + Widget cancelButton = TextButton( + child: Text("Cancel"), + onPressed: () { + Navigator.pop(context); + }, + ); + Widget continueButton = TextButton( + child: Text("Next"), + onPressed: () { + continueDynamicForms(); + }, + ); + StatefulBuilder alert = StatefulBuilder(builder: (context, setState) { + return AlertDialog( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))), + title: Text("Confirm"), + content: Builder(builder: (context) { + // Get available height and width of the build area of this widget. Make a choice depending on the size. + var height = MediaQuery.of(context).size.height * .5; + return Container( + height: height, + child: Column(children: [ + Text( + "Select the type of change you want to make.", + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + ), + Divider(), + Column( + children: [ + ListTile( + title: Text("correct or complete the current details"), + leading: Radio( + value: 1, + groupValue: changeOrNew, + onChanged: (value) { + setState(() { + changeOrNew = int.parse(value.toString()); + }); + }, + activeColor: Colors.green, + ), + ), + ListTile( + title: Text("Enter new Information because of a real change to the current details (e.g because of a change in marital status)"), + leading: Radio( + value: 2, + groupValue: changeOrNew, + onChanged: (value) { + setState(() { + changeOrNew = int.parse(value.toString()); + }); + }, + activeColor: Colors.green, + ), + ), + ], + ) + ])); + }), + actions: [ + cancelButton, + continueButton, + ], + ); + }); + + showDialog( + context: context, + builder: (BuildContext context) { + return alert; + }, + ); + } + + void continueDynamicForms() { + Navigator.pushNamed(context, AppRoutes.addDynamicInputProfile, + arguments: DynamicProfileParams(LocaleKeys.profile_basicDetails.tr(), 'HR_PERINFO_SS', + uRL: 'GET_BASIC_DET_DFF_STRUCTURE', requestID: 'BASIC_DETAILS', getEmployeeBasicDetailsList: getEmployeeBasicDetailsList)); + } +} diff --git a/lib/ui/profile/contact_details.dart b/lib/ui/profile/contact_details.dart new file mode 100644 index 0000000..d36b19a --- /dev/null +++ b/lib/ui/profile/contact_details.dart @@ -0,0 +1,236 @@ +import 'package:easy_localization/src/public_ext.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/classes/utils.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/get_employee_address_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; +import 'package:mohem_flutter_app/ui/profile/phone_numbers.dart'; +import 'package:mohem_flutter_app/ui/profile/profile.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; + +class ContactDetails extends StatefulWidget { + const ContactDetails({Key? key}) : super(key: key); + + @override + _ContactDetailsState createState() => _ContactDetailsState(); +} + +class _ContactDetailsState extends State { + String? fullName = ""; + String? maritalStatus = ""; + String? birthDate = ""; + String? civilIdentityNumber = ""; + String? emailAddress = ""; + String? employeeNo = ""; + + List getEmployeePhonesList = []; + List getEmployeeAddressList = []; + + @override + void initState() { + super.initState(); + + getEmployeePhones(); + + setState(() {}); + } + + void getEmployeePhones() async { + try { + Utils.showLoading(context); + getEmployeePhonesList = await ProfileApiClient().getEmployeePhones(); + getEmployeeAddress(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void getEmployeeAddress() async { + try { + Utils.showLoading(context); + getEmployeeAddressList = await ProfileApiClient().getEmployeeAddress(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBarWidget( + context, + title: LocaleKeys.profile_contactDetails.tr(), + ), + backgroundColor: MyColors.backgroundColor, + bottomSheet: footer(), + body: Column(children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 20, + left: 26, + right: 26, + ), + padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20), + height: 200, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), + ), + ], + color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + IconButton( + icon: Icon( + Icons.edit_location_alt_outlined, + size: 20, + ), + onPressed: () { + updatePhone(); + }, + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: getEmployeePhonesList + .map((e) => Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + "${e.pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), + "${e.pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), + ])) + .toList()) + ]) + + // [ + // "${getEmployeePhonesList[0].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), + // "${getEmployeePhonesList[0].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), + // SizedBox( + // height: 20,), + // "${getEmployeePhonesList[1].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), + // "${getEmployeePhonesList[1].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), + // ] + ), + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 20, + left: 26, + right: 26, + ), + padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20), + height: 400, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), + ), + ], + color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + child: SingleChildScrollView( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + IconButton( + icon: Icon( + Icons.edit_location_alt_outlined, + size: 20, + ), + onPressed: () {}, + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: getEmployeeAddressList + .map((e) => Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + "${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20, + ), + ])) + .toList()) + ]))) + // "${getEmployeeAddressList[0].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + // "${getEmployeeAddressList[0].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + // SizedBox( + // height: 20, + // ), + // "${getEmployeeAddressList[2].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + // "${getEmployeeAddressList[2].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + // SizedBox( + // height: 20, + // ), + // "${getEmployeeAddressList[3].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + // "${getEmployeeAddressList[3].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + // SizedBox( + // height: 20, + // ), + // "${getEmployeeAddressList[4].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + // "${getEmployeeAddressList[4].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + // SizedBox( + // height: 20, + // ), + // "${getEmployeeAddressList[5].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + // "${getEmployeeAddressList[5].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + // SizedBox( + // height: 20, + // ), + // "${getEmployeeAddressList[6].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + // "${getEmployeeAddressList[6].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + //]), + //), + //], + ])); + } + + footer() { + return Container( + decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + color: MyColors.white, + boxShadow: [ + BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), + ], + ), + child: DefaultButton(LocaleKeys.update.tr(), () async { + // context.setLocale(const Locale("en", "US")); // to change Loacle + Profile(); + }).insideContainer, + ); + } + + updatePhone() { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => PhoneNumbers(getEmployeePhonesList: this.getEmployeePhonesList)), + ); + } +} diff --git a/lib/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart b/lib/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart new file mode 100644 index 0000000..6ce01bc --- /dev/null +++ b/lib/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart @@ -0,0 +1,326 @@ +import 'dart:io'; + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; +import 'package:mohem_flutter_app/api/profile_api_client.dart'; +import 'package:mohem_flutter_app/classes/utils.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/dyanmic_forms/get_set_values_request_model.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; +import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.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/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; + +class DynamicProfileParams { + String title; + String dynamicId; + String uRL; + String requestID; + String colsURL; + List? getEmployeeBasicDetailsList; + + DynamicProfileParams(this.title, this.dynamicId, + {this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.getEmployeeBasicDetailsList = const []}); +} + +class DynamicInputScreenProfile extends StatefulWidget { + DynamicInputScreenProfile({Key? key}) : super(key: key); + + @override + _DynamicInputScreenState createState() { + return _DynamicInputScreenState(); + } +} + +class _DynamicInputScreenState extends State { + GenericResponseModel? genericResponseModel; + List? getBasicDetDffStructureList; + List? getBasicDetColsStructureList; + DynamicProfileParams? dynamicParams; + + @override + void initState() { + super.initState(); + } + + void getTransactionsStructure() async { + try { + Utils.showLoading(context); + genericResponseModel = await ProfileApiClient().getDffStructure(dynamicParams!.dynamicId, dynamicParams!.uRL, dynamicParams!.requestID); + getBasicDetDffStructureList = genericResponseModel?.getBasicDetDffStructureList ?? []; + + getBasicDetDffStructureList?.forEach((element) { + element.userBasicDetail = dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME); + }); + + genericResponseModel = await ProfileApiClient().getColStructure(dynamicParams!.dynamicId, 'GET_BASIC_DET_COLS_STRUCTURE', dynamicParams!.requestID); + getBasicDetColsStructureList = genericResponseModel?.getBasicDetColsStructureList ?? []; + getBasicDetColsStructureList?.forEach((element) { + element.userBasicDetail = dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME); + }); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void calGetValueSetValues(GetBasicDetDffStructureList structureList) async { + try { + Utils.showLoading(context); + String segmentId = structureList.cHILDSEGMENTSVS!; + List filteredList = getBasicDetDffStructureList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? []; + List> values = filteredList + .map((e) => GetSetValuesRequestModel( + sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) + .toJson()) + .toList(); + ESERVICESVS genericResponseModel = await MyAttendanceApiClient().getValueSetValues(structureList.cHILDSEGMENTSVS!, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); + + int index = getBasicDetDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); + getBasicDetDffStructureList![index].eSERVICESVS!.add(genericResponseModel); + // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + if (dynamicParams == null) { + dynamicParams = ModalRoute.of(context)!.settings.arguments as DynamicProfileParams; + getTransactionsStructure(); + } + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget( + context, + title: dynamicParams!.title, + ), + body: Column( + children: [ + (getBasicDetDffStructureList == null && getBasicDetColsStructureList == null + ? const SizedBox() + : (getBasicDetDffStructureList!.isEmpty && getBasicDetColsStructureList!.isEmpty + ? LocaleKeys.noDataAvailable.tr().toText16().center + : ListView( + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.all(21), + children: [ + ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (BuildContext cxt, int parentIndex) { + return parseDynamicFormatTypeCols(getBasicDetColsStructureList![parentIndex], parentIndex); + }, + separatorBuilder: (cxt, index) => 0.height, + itemCount: getBasicDetColsStructureList!.length), + 12.height, + ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (BuildContext cxt, int parentIndex) { + return parseDynamicFormatType(getBasicDetDffStructureList![parentIndex], parentIndex); + }, + separatorBuilder: (cxt, index) => 0.height, + itemCount: getBasicDetDffStructureList!.length), + ], + ))) + .expanded, + // 12.height, + DefaultButton( + LocaleKeys.next.tr(), + (getBasicDetDffStructureList ?? []).isEmpty + ? null + : () => { + //Navigator.of(context).pushNamed(LOGIN_TYPE) + }, + ).insideContainer, + ], + ), + ); + } + + Widget parseDynamicFormatType(GetBasicDetDffStructureList model, int index) { + if (model.dISPLAYFLAG != "N") { + } else { + return const SizedBox(); + } + + if (model.fORMATTYPE == "C") { + if (model.eSERVICESVS?.isNotEmpty ?? false) { + return PopupMenuButton( + child: DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.userBasicDetail?.sEGMENTVALUEDSP ?? "", + isEnable: false, + isPopup: true, + ).paddingOnly(bottom: 12), + itemBuilder: (_) => >[ + for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i), + ], + onSelected: (int popupIndex) { + getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME!; + setState(() {}); + }); + } + + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? "", + isReadOnly: model.rEADONLY == "Y", + onChange: (text) { + getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = text; + + }, + ).paddingOnly(bottom: 12); + } else if (model.fORMATTYPE == "X") { + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? (getBasicDetDffStructureList![index].userBasicDetail?.sEGMENTVALUEDSP ?? ""), + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + DateTime date = await _selectDate(context); + DateTime date1 = DateTime(date.year, date.month, date.day); + getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = date.toString(); + ESERVICESDV eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1), + pRETURNMSG: "null", + pRETURNSTATUS: getBasicDetDffStructureList![index].dEFAULTVALUE, + pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + getBasicDetDffStructureList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + calGetValueSetValues(model); + } + }, + ).paddingOnly(bottom: 12); + } + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [], + ).objectContainerView(); + } + + Widget parseDynamicFormatTypeCols(GetBasicDetColsStructureList model, int index) { + if (model.dISPLAYFLAG != "N") { + } else { + return const SizedBox(); + } + + if (model.dATATYPE == "VARCHAR2") { + if (model.objectValuesList?.isNotEmpty ?? false) { + return PopupMenuButton( + child: DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.userBasicDetail?.sEGMENTVALUEDSP ?? "", + isEnable: false, + isPopup: true, + ).paddingOnly(bottom: 12), + itemBuilder: (_) => >[ + for (int i = 0; i < model.objectValuesList!.length; i++) PopupMenuItem(child: Text(model.objectValuesList![i].mEANING!), value: i), + ], + onSelected: (int popupIndex) { + ESERVICESDV eservicesdv = + ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![index].dESCRIPTION, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME); + getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].dESCRIPTION!; + setState(() {}); + }); + } + + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.userBasicDetail?.sEGMENTVALUEDSP ?? "", + //model.aPPLICATIONCOLUMNNAME ?? "", + //"", + isReadOnly: false, + onChange: (text) { + getBasicDetColsStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = text; + }, + ).paddingOnly(bottom: 12); + } else if (model.dATATYPE == "DATE") { + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.aPPLICATIONCOLUMNNAME ?? (getBasicDetColsStructureList![index].userBasicDetail?.sEGMENTVALUEDSP ?? ""), + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + DateTime date = await _selectDate(context); + DateTime date1 = DateTime(date.year, date.month, date.day); + getBasicDetColsStructureList![index].userBasicDetail?.sEGMENTVALUEDSP = date.toString(); + // ESERVICESDV eservicesdv = ESERVICESDV( + // pIDCOLUMNNAME: DateFormat('yyyy-MM-dd').format(date1), + // pRETURNMSG: "null", + // pRETURNSTATUS: getBasicDetDffStructureList![index].dEFAULTVALUE, + // pVALUECOLUMNNAME: DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + // getBasicDetDffStructureList![index].eSERVICESDV = eservicesdv; + setState(() {}); + // if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + // calGetValueSetValues(model); + // } + }, + ).paddingOnly(bottom: 12); + } + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [], + ).objectContainerView(); + } + + DateTime selectedDate = DateTime.now(); + + Future _selectDate(BuildContext context) async { + DateTime time = selectedDate; + if (!Platform.isIOS) { + await showCupertinoModalPopup( + context: context, + builder: (cxt) => Container( + height: 250, + color: Colors.white, + child: CupertinoDatePicker( + backgroundColor: Colors.white, + mode: CupertinoDatePickerMode.date, + onDateTimeChanged: (value) { + if (value != null && value != selectedDate) { + time = value; + } + }, + initialDateTime: selectedDate, + ), + ), + ); + } else { + final DateTime? picked = + await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); + if (picked != null && picked != selectedDate) { + time = picked; + } + } + return time; + } +} diff --git a/lib/ui/profile/dynamic_screens/dynamic_listview_screen.dart b/lib/ui/profile/dynamic_screens/dynamic_listview_screen.dart new file mode 100644 index 0000000..5ba4109 --- /dev/null +++ b/lib/ui/profile/dynamic_screens/dynamic_listview_screen.dart @@ -0,0 +1,105 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/utils.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/get_eit_transaction_list_model.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; + +class DynamicListViewParams { + String title; + String dynamicId; + String uRL; + String requestID; + DynamicListViewParams(this.title, this.dynamicId, {this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = ''}); +} + +class DynamicListViewScreen extends StatefulWidget { + DynamicListViewScreen({Key? key}) : super(key: key); + + @override + _DynamicListViewScreenState createState() { + return _DynamicListViewScreenState(); + } +} + +class _DynamicListViewScreenState extends State { + List? getEITTransactionList; + DynamicListViewParams? dynamicParams; + @override + void initState() { + super.initState(); + } + + void getTransactions() async { + try { + Utils.showLoading(context); + getEITTransactionList = await MyAttendanceApiClient().getEitTransaction(dynamicParams!.dynamicId); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + if (dynamicParams == null) { + dynamicParams = ModalRoute.of(context)!.settings.arguments as DynamicListViewParams; + getTransactions(); + } + + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget( + context, + title: dynamicParams!.title, + ), + body: getEITTransactionList == null + ? const SizedBox() + : (getEITTransactionList!.isEmpty + ? LocaleKeys.noDataAvailable.tr().toText16().center + : ListView.separated( + physics: const BouncingScrollPhysics(), + padding: EdgeInsets.all(21), + itemBuilder: (cxt, int parentIndex) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++) + if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y") + ItemDetailView( + getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!, getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""), + ], + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: getEITTransactionList!.length)), + floatingActionButton: Container( + height: 50, + width: 50, + decoration: const BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient(transform: GradientRotation(.83), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ]), + ), + child: const Icon(Icons.add, color: Colors.white, size: 30), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.addDynamicInput, arguments: dynamicParams); + }), + ); + } +} diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart new file mode 100644 index 0000000..d62f101 --- /dev/null +++ b/lib/ui/profile/family_members.dart @@ -0,0 +1,251 @@ + + + + + +import 'package:easy_localization/src/public_ext.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/classes/utils.dart'; +import 'package:mohem_flutter_app/dialogs/otp_dialog.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/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; +import 'package:mohem_flutter_app/ui/profile/profile.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; + +class FamilyMembers extends StatefulWidget { + const FamilyMembers({Key? key}) : super(key: key); + + @override + _FamilyMembersState createState() => _FamilyMembersState(); +} + +class _FamilyMembersState extends State { + + List getEmployeeContactsList = []; + + + @override + void initState() { + super.initState(); + getEmployeeContacts(); + + } + + void getEmployeeContacts() async { + try { + Utils.showLoading(context); + getEmployeeContactsList = await ProfileApiClient().getEmployeeContacts(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBarWidget( + context, + title: LocaleKeys.profile_familyDetails.tr(), + ), + backgroundColor: MyColors.backgroundColor, + bottomSheet:footer(), + body: Column( + children: [ + SizedBox(height: 20,), + getEmployeeContactsList.length != 0 + ? SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: getEmployeeContactsList.length, + itemBuilder: (context, index) { + return Container( + child: Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 26, right: 26,), + padding: EdgeInsets.only(left: 14, right: 14,top: 13, ), + height: 110, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), + ), + ], + color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor), + "${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor), + SizedBox(height: 5,), + Divider( + color: MyColors.lightGreyEFColor, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + child: InkWell( + onTap: () { + + }, + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.edit, + size: 15, + color: MyColors.grey67Color, + ), + ), + TextSpan( + text: LocaleKeys.update.tr(), + style: TextStyle( + color: MyColors.grey67Color, + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ) + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: SizedBox( + child: Container( + width: 3, + color: MyColors.lightGreyEFColor, + ), + ), + ), + Container( + child: InkWell( + onTap: () { + showAlertDialog(context); + }, + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.delete, + size: 15, + color: Color(0x99FF0000), + ), + ), + TextSpan( + text:LocaleKeys.remove.tr(), + style: TextStyle( + color: MyColors.DarkRedColor, + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ) + ), + // ElevatedButton.icon( + // icon: Icon( + // Icons.delete, + // size: 15, + // color: Color(0x99FF0000), + // ), + // style: ElevatedButton.styleFrom( + // shadowColor: Colors.white, + // primary: Colors.white, + // ), + // label: "remove".toText12(color: MyColors.DarkRedColor), + // onPressed: (){}, + // ), + ], + ), + ] + ), + ), + ], + ) + ); + }) + ], + ), + ):Container(), + ], + ) + + + ); + } + + footer(){ + return Container( + decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + color: MyColors.white, + boxShadow: [ + BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), + ], + ), + child: DefaultButton(LocaleKeys.update.tr(), () async { + // context.setLocale(const Locale("en", "US")); // to change Loacle + Profile(); + }).insideContainer, + ); + } + + showAlertDialog(BuildContext context) { + Widget cancelButton = TextButton( + child: Text("CANCEL"), + onPressed: () { + Navigator.pop(context); + }, + ); + Widget continueButton = TextButton( + child: Text("OK"), + onPressed: () {}, + ); + AlertDialog alert = AlertDialog( + title: Text("Confirm"), + content: Text("Are You Sure You Want to Remove this Member?"), + actions: [ + cancelButton, + continueButton, + ], + ); + showDialog( + context: context, + builder: (BuildContext context) { + return alert; + }, + ); + } + +} diff --git a/lib/ui/profile/personal_info.dart b/lib/ui/profile/personal_info.dart new file mode 100644 index 0000000..0ad9e2f --- /dev/null +++ b/lib/ui/profile/personal_info.dart @@ -0,0 +1,113 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/member_information_list_model.dart'; + +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; + +class PesonalInfo extends StatefulWidget { + const PesonalInfo({Key? key}) : super(key: key); + + @override + _PesonalInfoState createState() => _PesonalInfoState(); +} + +class _PesonalInfoState extends State { + String? fullName = ""; + String? maritalStatus = ""; + String? birthDate = ""; + String? civilIdentityNumber = ""; + String? emailAddress = ""; + String? employeeNo = ""; + + // List getEmployeeBasicDetailsList = []; + // MemberInformationListModel? _memberInformationList; + + late MemberInformationListModel memberInformationList; + + List getEmployeeBasicDetailsList = []; + + @override + void initState() { + super.initState(); + memberInformationList = AppState().memberInformationList!; + } + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBarWidget( + context, + title: LocaleKeys.profile_personalInformation.tr(), + ), + backgroundColor: MyColors.backgroundColor, + // bottomSheet:footer(), + body: Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 28, + left: 26, + right: 26, + ), + padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 20), + height: 350, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), + ), + ], + color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + LocaleKeys.category.tr().toText13(color: MyColors.lightGrayColor), + "${memberInformationList!.eMPLOYMENTCATEGORYMEANING}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20, + ), + LocaleKeys.address.tr().toText13(color: MyColors.lightGrayColor), + "${memberInformationList!.lOCATIONNAME}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20, + ), + LocaleKeys.phoneNumber.tr().toText13(color: MyColors.lightGrayColor), + "${memberInformationList!.eMPLOYEEMOBILENUMBER}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20, + ), + LocaleKeys.businessGroup.tr().toText13(color: MyColors.lightGrayColor), + "${memberInformationList!.bUSINESSGROUPNAME}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20, + ), + LocaleKeys.Payroll.tr().toText13(color: MyColors.lightGrayColor), + "${memberInformationList!.pAYROLLNAME}".toText16(isBold: true, color: MyColors.blackColor), + ]), + ), + ], + )); + } + + footer() { + return Container( + decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + color: MyColors.white, + boxShadow: [ + BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), + ], + ), + child: DefaultButton(LocaleKeys.update.tr(), () async {}).insideContainer, + ); + } +} diff --git a/lib/ui/profile/phone_numbers.dart b/lib/ui/profile/phone_numbers.dart new file mode 100644 index 0000000..aabf50e --- /dev/null +++ b/lib/ui/profile/phone_numbers.dart @@ -0,0 +1,115 @@ +import 'package:easy_localization/src/public_ext.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/classes/utils.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/get_employee_address_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; +import 'package:mohem_flutter_app/models/profile/phone_number_types_modek.dart'; +import 'package:mohem_flutter_app/ui/profile/profile.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; + +class PhoneNumbers extends StatefulWidget { + List getEmployeePhonesList; + + PhoneNumbers({Key? key, required this.getEmployeePhonesList}) : super(key: key); + + @override + _PhoneNumbersState createState() => _PhoneNumbersState(); +} + +class _PhoneNumbersState extends State { + List getPhoneNumberTypesList = []; + @override + void initState() { + super.initState(); + getPhoneNumberTypes(); + } + + void getPhoneNumberTypes() async { + Utils.showLoading(context); + getPhoneNumberTypesList = await ProfileApiClient().getPhoneNumberTypes(); + setState(() {}); + Utils.hideLoading(context); + } + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBarWidget( + context, + title: LocaleKeys.profile_contactDetails.tr(), + ), + backgroundColor: MyColors.backgroundColor, + bottomSheet: footer(), + body: Column(children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 20, + left: 26, + right: 26, + ), + padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20), + height: 400, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), + ), + ], + color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: widget.getEmployeePhonesList + .map((e) => Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + PopupMenuButton( + child: DynamicTextFieldWidget( + "Please Select *", + e.pHONETYPEMEANING ?? "", + isEnable: true, + isPopup: true, + ).paddingOnly(bottom: 12), + itemBuilder: (_) => >[ + for (int i = 0; i < getPhoneNumberTypesList.length; i++) PopupMenuItem(child: Text(getPhoneNumberTypesList![i].mEANING!), value: i), + ], + onSelected: (int index) { + e.pHONETYPEMEANING = getPhoneNumberTypesList[index].mEANING; + setState(() {}); + }), + "${e.pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), + ])) + .toList()))) + ])); + } + + footer() { + return Container( + decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + color: MyColors.white, + boxShadow: [ + BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), + ], + ), + child: DefaultButton(LocaleKeys.update.tr(), () async { + // context.setLocale(const Locale("en", "US")); // to change Loacle + Profile(); + }).insideContainer, + ); + } + + updatePhone() {} +} diff --git a/lib/ui/profile/profile.dart b/lib/ui/profile/profile.dart new file mode 100644 index 0000000..6cbf953 --- /dev/null +++ b/lib/ui/profile/profile.dart @@ -0,0 +1,289 @@ +import 'package:easy_localization/src/public_ext.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/classes/utils.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/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; + +class Profile extends StatefulWidget { + const Profile({Key? key}) : super(key: key); + + @override + _ProfileState createState() => _ProfileState(); +} + +class _ProfileState extends State { + String? fullName = ""; + String? maritalStatus = ""; + String? birthDate = ""; + String? civilIdentityNumber = ""; + String? emailAddress = ""; + String? employeeNo = ""; + + List getEmployeeBasicDetailsList = []; + + @override + void initState() { + super.initState(); + getEmployeeBasicDetails(); + basicDetails(); + } + + void getEmployeeBasicDetails() async { + try { + Utils.showLoading(context); + getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails(); + Utils.hideLoading(context); + basicDetails(); + print("getEmployeeBasicDetailsList.length"); + print(getEmployeeBasicDetailsList.length); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + basicDetails() { + for (int i = 0; i < getEmployeeBasicDetailsList.length; i++) { + if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'FULL_NAME') { + fullName = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'MARITAL_STATUS') { + maritalStatus = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'DATE_OF_BIRTH') { + birthDate = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'NATIONAL_IDENTIFIER') { + civilIdentityNumber = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'EMAIL_ADDRESS') { + emailAddress = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'EMPLOYEE_NUMBER') { + employeeNo = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } + } + } + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: MyColors.lightGreenColor, + leading: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IconButton( + icon: const Icon( + Icons.arrow_back_ios, + color: MyColors.backgroundBlackColor, + ), + onPressed: () => Navigator.pop(context), + ), + ], + ), + ), + backgroundColor: MyColors.lightGreenColor, + body: Stack(children: [ + Align( + alignment: Alignment.topRight, + child: Container( + height: 30, + width: 80, + padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 5, bottom: 5), + decoration: BoxDecoration( + border: Border.all( + color: MyColors.gradiantEndColor, + style: BorderStyle.solid, + ), + color: MyColors.gradiantEndColor, + borderRadius: BorderRadius.circular(100.0)), + child: InkWell( + onTap: () {}, + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.image, + size: 20, + color: Colors.white, + ), + ), + TextSpan( + text: " Edit", + ), + ], + ), + ), + ) + ), + ), + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 48), + height: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(30.0), topRight: Radius.circular(30.0)), + ), + child: Column( + children: [ + "${fullName}".toText20(isBold: true, color: MyColors.blackColor), + "${employeeNo}".toText12(isBold: false, color: MyColors.lightGrayColor), + "${emailAddress}".toText12(isBold: false, color: MyColors.black), + SizedBox( + height: 5, + ), + Divider( + color: MyColors.lightGreyE6Color, + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + + }, + child: Row( + children: [ + + SizedBox( + width: 15, + ), + "Personal Information".toText16(isBold: true, color: MyColors.grey3AColor), + ], + ), + ), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + + }, + child: Row( + children: [ + + SizedBox( + width: 15, + ), + "Basic Details".toText16(isBold: true, color: MyColors.grey3AColor), + ], + ), + ), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + + }, + child: Row( + children: [ + + SizedBox( + width: 20, + ), + "Contact Details".toText16(isBold: true, color: MyColors.grey3AColor), + ], + ), + ), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + + }, + child: Row( + children: [ + + SizedBox( + width: 20, + ), + "Family Members".toText16(isBold: true, color: MyColors.grey3AColor), + ], + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ], + ).paddingOnly( top: 35, bottom: 36), + ), + Align( + alignment: Alignment.topCenter, + child: SizedBox( + child: CircleAvatar( + radius: 40.0, + backgroundColor: Colors.white, + child: CircleAvatar( + child: Align( + alignment: Alignment.bottomRight, + // child: CircleAvatar( + // backgroundColor: Colors.white, + // radius: 12.0, + // child: Icon( + // Icons.camera_alt, + // size: 15.0, + // color: Color(0xFF404040), + // ), + // ), + ), + radius: 38.0, + // url:"", + ), + ), + )), + ]) + // Container( + // margin: const EdgeInsets.only(top:50), + // decoration: const BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(30.0), + // topRight: Radius.circular(30.0)) + // ), + // // color: MyColors.white, + // child: Stack( + // children: [ + // Container( + // height: 30, + // color: MyColors.lightGreenColor, + // margin: const EdgeInsets.only(bottom: 20,), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // CircleAvatar( + // backgroundColor: Colors.grey.shade800, + // ), + // ], + // ), + // ), + // ListView( + // scrollDirection: Axis.vertical, + // children: [ + // Column( + // children: [ + // // 20.height, + // ], + // ) + // ], + // ), + // ] + // ), + // ), + ); + } +} diff --git a/lib/ui/screens/eit/add_eit.dart b/lib/ui/screens/eit/add_eit.dart new file mode 100644 index 0000000..0dbcd1c --- /dev/null +++ b/lib/ui/screens/eit/add_eit.dart @@ -0,0 +1,64 @@ +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; +import 'package:mohem_flutter_app/models/dashboard/menus.dart'; +import 'package:mohem_flutter_app/provider/eit_provider_model.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/ui/landing/widget/missing_swipe.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:provider/provider.dart'; + +class AddEITScreen extends StatelessWidget { + late GetMenuEntriesList getMenu; + late EITProviderModel data; + + @override + Widget build(BuildContext context) { + getMenu = ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList; + + data = Provider.of(context, listen: false); + data.getEITList(getMenu.functionName.toString()); + return DefaultTabController( + length: 2, + child: Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget(context, title: getMenu.prompt.toString()), + //AppBar( + + // title: getMenu.prompt.toString(), + // ), + body: Container( + width: double.infinity, + height: double.infinity, + child: Column(children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(20), bottomRight: Radius.circular(20)), + gradient: LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomRight, colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ]), + ), + clipBehavior: Clip.antiAlias, + child: TabBar( + indicatorColor: Colors.white, + labelColor: Colors.white, + tabs: [ + Tab( + text: "Missing Swipe", + ), + Tab( + text: "Swipe Request", + ), + ], + ), + ), + Expanded( + child: TabBarView( + children: [MissingSwipe(), Container()], + ), + ) + ])), + )); + } +} diff --git a/lib/ui/screens/profile/profile_screen.dart b/lib/ui/screens/profile/profile_screen.dart new file mode 100644 index 0000000..76f8a20 --- /dev/null +++ b/lib/ui/screens/profile/profile_screen.dart @@ -0,0 +1,135 @@ +import 'dart:ui'; +import 'dart:convert'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:mohem_flutter_app/api/profile_api_client.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/member_information_list_model.dart'; +import 'package:mohem_flutter_app/ui/screens/profile/widgets/header.dart'; +import 'package:mohem_flutter_app/ui/screens/profile/widgets/profile_panel.dart'; +import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; + +class ProfileScreen extends StatefulWidget { + const ProfileScreen({Key? key}) : super(key: key); + + @override + _ProfileScreenState createState() => _ProfileScreenState(); +} + +class _ProfileScreenState extends State { + late MemberInformationListModel memberInformationList; + final ImagePicker _picker = ImagePicker(); + List getEmployeeBasicDetailsList = []; + + @override + void initState() { + super.initState(); + memberInformationList = AppState().memberInformationList!; + //getEmployeeBasicDetails(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + extendBody: true, + backgroundColor: const Color(0xffefefef), + body: Stack(children: [ + Container( + height: 300, + margin: EdgeInsets.only(top: 50), + decoration: BoxDecoration(image: DecorationImage(image: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)), fit: BoxFit.cover)), + child: new BackdropFilter( + filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), + child: new Container( + decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)), + ), + )), + SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ + SizedBox( + height: 80, + ), + Container( + padding: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton( + onPressed: () { + Navigator.pop(context); + }, + icon: Icon( + Icons.arrow_back_ios, + color: Colors.white, + )), + InkWell( + onTap: () { + startImageSheet(); + }, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 5), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.black.withOpacity(.3)), + child: Row(children: [ + Icon(Icons.photo, color: Colors.white), + Text( + 'Edit', + style: TextStyle(color: Colors.white, fontSize: 12), + ) + ]))), + ], + )), + HeaderPanel(memberInformationList), + ProfilePanle(memberInformationList) + ]), + ) + ])); + } + + startImageSheet() { + showMyBottomSheet(context, + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 20, right: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text('OK'), Text('CANCEL')], + )), + BottomSheetItem( + onTap: () { + openGallery(false); + }, + title: 'Open Gallery', + icon: Icons.browse_gallery_outlined, + ), + BottomSheetItem( + onTap: () { + openGallery(true); + }, + title: 'Open Camera', + icon: Icons.camera, + ) + ], + )); + } + + void openGallery(bool isCamera) async { + final XFile? image = await _picker.pickImage(source: isCamera ? ImageSource.camera : ImageSource.gallery); + + if (image != null) { + String img = base64.encode(await image!.readAsBytes()); + Utils.showLoading(context); + dynamic empImageUpdteResp = await ProfileApiClient().updateEmpImage(img); + Utils.hideLoading(context); + if (empImageUpdteResp['P_RETURN_STATUS'] == 'S') { + setState(() { + memberInformationList.eMPLOYEEIMAGE = img; + }); + } + } + } +} diff --git a/lib/ui/screens/profile/widgets/header.dart b/lib/ui/screens/profile/widgets/header.dart new file mode 100644 index 0000000..ca3d829 --- /dev/null +++ b/lib/ui/screens/profile/widgets/header.dart @@ -0,0 +1,19 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/models/member_information_list_model.dart'; + +class HeaderPanel extends StatelessWidget { + HeaderPanel(this.memberInformationList); + late MemberInformationListModel memberInformationList; + @override + Widget build(BuildContext context) { + double _width = MediaQuery.of(context).size.width; + return Container( + padding: EdgeInsets.symmetric(horizontal: _width / 10, vertical: 0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [], + )); + } +} diff --git a/lib/ui/screens/profile/widgets/profile_info.dart b/lib/ui/screens/profile/widgets/profile_info.dart new file mode 100644 index 0000000..6f30b7a --- /dev/null +++ b/lib/ui/screens/profile/widgets/profile_info.dart @@ -0,0 +1,131 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/member_information_list_model.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:mohem_flutter_app/models/profile_menu.model.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'; + +class ProfileInFo extends StatelessWidget { + ProfileInFo(this.memberInfo); + MemberInformationListModel memberInfo; + String data = '.'; + double sliderValue = 75; + List menu = [ + ProfileMenu(name: LocaleKeys.profile_personalInformation.tr(), icon: 'personal-info.svg', route: AppRoutes.personalInfo, dynamicUrl: ''), + ProfileMenu( + name: LocaleKeys.profile_basicDetails.tr(), + icon: 'basic-details.svg', + route: AppRoutes.basicDetails, + ), + ProfileMenu(name: LocaleKeys.profile_contactDetails.tr(), icon: 'contact-details.svg', route: AppRoutes.contactDetails, dynamicUrl: ''), + ProfileMenu(name: LocaleKeys.profile_familyDetails.tr(), icon: 'family-members.svg', route: AppRoutes.familyMembers, dynamicUrl: ''), + ]; + @override + Widget build(BuildContext context) { + return Container( + child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ + /// card header + customLabel(memberInfo.eMPLOYEENAME.toString(), 22, Colors.black, true), + + customLabel(memberInfo.eMPLOYEENUMBER.toString() + ' | ' + memberInfo.jOBNAME.toString(), 14, Colors.grey, false), + + customLabel(memberInfo.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true), + + Divider(height: 40, thickness: 8, color: const Color(0xffefefef)), + + customLabel(LocaleKeys.completingYear.tr(), 10, Colors.black, true), + + SizedBox(height: 10), + Container( + child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [ + Column( + children: [customLabel(LocaleKeys.year.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEYEARS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], + ), + Column( + children: [customLabel(LocaleKeys.month.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEMONTHS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], + ), + Column( + children: [customLabel(LocaleKeys.day.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEDAYS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], + ) + ])), + + Divider(height: 40, thickness: 8, color: const Color(0xffefefef)), + Container( + padding: EdgeInsets.only( + left: 20, + right: 20, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + customLabel(LocaleKeys.profile_profileCompletionPer.tr() + ' 75%', 18, Colors.black, true), + const SizedBox(height: 10), + Row( + children: [ + for (var i = 0; i < 4; i++) + if (i < 3) Expanded(child: drawSlider(Color(0xff2BB8A6))) else Expanded(child: drawSlider(const Color(0xffefefef))) + ], + ), + const SizedBox(height: 10), + Text( + LocaleKeys.profile_completeProfile.tr(), + style: TextStyle(color: Color(0xff2BB8A6), fontWeight: FontWeight.bold, decoration: TextDecoration.underline), + ), + ], + )), + + /// description + Divider(height: 50, thickness: 8, color: const Color(0xffefefef)), + + Column( + children: menu.map((i) => rowItem(i, context)).toList(), + ) + ])); + } + + Widget drawSlider(color) { + return Row(children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.circular(10), + child: Container( + height: 6, + width: 20, + color: color, + ), + )), + Container(height: 6, width: 3, color: Colors.white), + ]); + } + + Widget rowItem(obj, context) { + return InkWell( + onTap: () { + //if (obj.dynamicUrl == '') { + Navigator.pushNamed(context, obj.route); + // } else { + // Navigator.pushNamed(context, AppRoutes.addDynamicInputProfile, arguments: DynamicListViewParams(obj.name, obj.functionName, uRL: obj.dynamicUrl, requestID: obj.requestID)); + //} + }, + child: ListTile( + leading: SvgPicture.asset('assets/images/' + obj.icon), + title: Text(obj.name), + trailing: Icon(Icons.arrow_forward), + ), + ); + } + + Widget customLabel(String label, double size, Color color, bool isBold, {double padding = 0.0}) => Container( + padding: EdgeInsets.all(padding), + // height: 50, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))])); +} diff --git a/lib/ui/screens/profile/widgets/profile_panel.dart b/lib/ui/screens/profile/widgets/profile_panel.dart new file mode 100644 index 0000000..fd99abb --- /dev/null +++ b/lib/ui/screens/profile/widgets/profile_panel.dart @@ -0,0 +1,36 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/models/member_information_list_model.dart'; +import 'package:mohem_flutter_app/ui/screens/profile/widgets/profile_info.dart'; + +class ProfilePanle extends StatelessWidget { + ProfilePanle(this.memberInformationList); + late MemberInformationListModel memberInformationList; + @override + Widget build(BuildContext context) { + double _width = MediaQuery.of(context).size.width; + return Container( + margin: EdgeInsets.fromLTRB(5, 0, 5, 10), + height: MediaQuery.of(context).size.height, + child: Stack(children: [ + Container( + width: _width, + margin: EdgeInsets.only(top: 50), + padding: EdgeInsets.only(top: 50), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), + boxShadow: [BoxShadow(color: Colors.white60, blurRadius: 10, spreadRadius: 10)]), + child: ProfileInFo(memberInformationList), + ), + Container(height: 100, alignment: Alignment.center, child: ProfileImage()) + ])); + } + + Widget ProfileImage() => CircleAvatar( + radius: 70, + backgroundImage: MemoryImage(Utils.getPostBytes(memberInformationList.eMPLOYEEIMAGE)), + backgroundColor: Colors.black, + ); +} diff --git a/lib/ui/screens/submenu_screen.dart b/lib/ui/screens/submenu_screen.dart new file mode 100644 index 0000000..fbb1c40 --- /dev/null +++ b/lib/ui/screens/submenu_screen.dart @@ -0,0 +1,62 @@ +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; +import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; +import 'package:mohem_flutter_app/models/dashboard/menus.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; + +class SubMenuScreen extends StatelessWidget { + late Menus menu; + @override + Widget build(BuildContext context) { + menu = ModalRoute.of(context)!.settings.arguments as Menus; + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget(context, title: menu.menuEntry.prompt.toString()), + // AppBar( + // context, + // title: menu.menuEntry.prompt.toString(), + // ), + + body: Container( + width: double.infinity, + height: double.infinity, + child: Column( + children: menu.menuEntiesList.map((i) => rowItem(i, context)).toList(), + )), + ); + } + + Widget rowItem(obj, context) { + return InkWell( + onTap: () { + Navigator.pushNamed( + context, + AppRoutes.addEitScreen, + arguments: obj, + ); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(12), + margin: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.1), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text(obj.prompt.toString()), Icon(Icons.arrow_right)], + ).paddingAll(6), + ), + ); + } +} diff --git a/lib/ui/screens/tangheem_detail_screen.dart b/lib/ui/screens/tangheem_detail_screen.dart index b4ca256..0f4ea7b 100644 --- a/lib/ui/screens/tangheem_detail_screen.dart +++ b/lib/ui/screens/tangheem_detail_screen.dart @@ -99,7 +99,7 @@ // setState(() {}); // } catch (ex) { // print(ex); -// Utils.handleException(ex, null); +// Utils.handleException(ex, context, null); // Utils.hideLoading(context); // } // } @@ -132,7 +132,7 @@ // Utils.hideLoading(context); // Navigator.pop(context); // } catch (ex) { -// Utils.handleException(ex, null); +// Utils.handleException(ex, context, null); // Utils.hideLoading(context); // } // } diff --git a/lib/ui/work_list/item_history_screen.dart b/lib/ui/work_list/item_history_screen.dart new file mode 100644 index 0000000..6cf80ca --- /dev/null +++ b/lib/ui/work_list/item_history_screen.dart @@ -0,0 +1,182 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart'; +import 'package:mohem_flutter_app/classes/utils.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/models/get_mo_Item_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_po_Item_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_quotation_analysis_list_model.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; + +class ItemHistoryScreenParams { + String? title; + bool isItemHistory; + bool isMO; + int? pItemId; + int? pPoHeaderId; + int? pOrgId; + + ItemHistoryScreenParams({@required this.title, this.isItemHistory = true, this.isMO = true, this.pItemId, this.pPoHeaderId, this.pOrgId}); +} + +class ItemHistoryScreen extends StatefulWidget { + ItemHistoryScreen({Key? key}) : super(key: key); + + @override + _ItemHistoryScreenState createState() { + return _ItemHistoryScreenState(); + } +} + +class _ItemHistoryScreenState extends State { + ItemHistoryScreenParams? _screenParams; + + List moItemHistoryList = []; + List poItemHistoryList = []; + List quotationAnalysisList = []; + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + void loadData() { + if (_screenParams == null) { + _screenParams = ModalRoute.of(context)!.settings.arguments as ItemHistoryScreenParams; + getDataFromApi(); + } + } + + void getDataFromApi() async { + try { + Utils.showLoading(context); + if (_screenParams!.isItemHistory) { + if (_screenParams!.isMO) { + moItemHistoryList = await WorkListApiClient().getMoItemHistory(_screenParams!.pItemId!, _screenParams!.pOrgId!); + } else { + poItemHistoryList = await WorkListApiClient().getPoItemHistory(_screenParams!.pItemId!); + } + } else { + quotationAnalysisList = await WorkListApiClient().getQuotationAnalysis(_screenParams!.pItemId!, _screenParams!.pPoHeaderId!); + } + + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + @override + Widget build(BuildContext context) { + loadData(); + return Scaffold( + appBar: AppBarWidget(context, title: _screenParams?.title ?? ""), + backgroundColor: Colors.white, + body: ListView( + padding: const EdgeInsets.all(21), + physics: const BouncingScrollPhysics(), + children: [ + if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData(), + if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData(), + if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData() + ], + ), + ); + } + + Widget loadMoItemHistoryData() { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.requestNumber.tr(), moItemHistoryList[index].rEQUESTNUMBER ?? ""), + ItemDetailView(LocaleKeys.uom.tr(), moItemHistoryList[index].uNITOFMEASURE ?? ""), + ItemDetailView(LocaleKeys.quantity.tr(), moItemHistoryList[index].qUANTITY?.toString() ?? ""), + ItemDetailView(LocaleKeys.dateRequired.tr(), moItemHistoryList[index].dATEREQUIRED ?? ""), + ItemDetailView(LocaleKeys.lineStatus.tr(), moItemHistoryList[index].lINESTATUSDIS ?? ""), + ItemDetailView(LocaleKeys.statusDate.tr(), moItemHistoryList[index].sTATUSDATE ?? ""), + ItemDetailView(LocaleKeys.transactionType.tr(), moItemHistoryList[index].tRANSACTIONTYPENAME ?? ""), + ItemDetailView(LocaleKeys.organization.tr(), moItemHistoryList[index].oRGANIZATIONNAME ?? ""), + ItemDetailView(LocaleKeys.operatingCode.tr(), moItemHistoryList[index].oRGANIZATIONCODE ?? ""), + ItemDetailView(LocaleKeys.operatingUnit.tr(), moItemHistoryList[index].oPERATINGUNITNAME ?? ""), + ItemDetailView(LocaleKeys.fromSubInventory.tr(), moItemHistoryList[index].fROMSUBINVENTORYCODE ?? ""), + ItemDetailView(LocaleKeys.fromLocator.tr(), moItemHistoryList[index].fROMLOCATOR ?? ""), + ItemDetailView(LocaleKeys.toSubInventory.tr(), moItemHistoryList[index].tOSUBINVENTORYCODE ?? ""), + ItemDetailView(LocaleKeys.toLocator.tr(), moItemHistoryList[index].tOLOCATOR ?? ""), + ItemDetailView(LocaleKeys.shipToLocation.tr(), moItemHistoryList[index].sHIPTOLOCATION ?? ""), + ], + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: moItemHistoryList.length); + } + + Widget loadPoItemHistoryData() { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.operatingUnit.tr(), poItemHistoryList[index].oUNAME ?? ""), + ItemDetailView(LocaleKeys.poNumber.tr(), poItemHistoryList[index].pONUMBER ?? ""), + ItemDetailView(LocaleKeys.revision.tr(), poItemHistoryList[index].rEVISIONNUM?.toString() ?? ""), + ItemDetailView(LocaleKeys.creationDate.tr(), poItemHistoryList[index].cREATIONDATE ?? ""), + ItemDetailView(LocaleKeys.supplier.tr(), poItemHistoryList[index].sUPPLIER ?? ""), + ItemDetailView(LocaleKeys.buyer.tr(), poItemHistoryList[index].bUYER ?? ""), + ItemDetailView(LocaleKeys.uom.tr(), poItemHistoryList[index].uOM ?? ""), + ItemDetailView(LocaleKeys.quantityOrdered.tr(), poItemHistoryList[index].qUANTITYORDERED?.toString() ?? ""), + ItemDetailView(LocaleKeys.quantityReceived.tr(), poItemHistoryList[index].qUANTITYRECEIVED?.toString() ?? ""), + ItemDetailView(LocaleKeys.bonusQuantity.tr(), poItemHistoryList[index].bONUSQUANTITY?.toString() ?? ""), + ItemDetailView(LocaleKeys.purchasePrice.tr(), poItemHistoryList[index].pURCHASEPRICE?.toString() ?? ""), + ItemDetailView(LocaleKeys.discountPer.tr(), poItemHistoryList[index].dISCOUNTPERCENTAGE?.toString() ?? ""), + ItemDetailView(LocaleKeys.balanceQuantity.tr(), poItemHistoryList[index].bALANCEQUANTITY?.toString() ?? ""), + ItemDetailView(LocaleKeys.netPrice.tr(), poItemHistoryList[index].nETPRICE?.toString() ?? ""), + ItemDetailView(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""), + ], + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: poItemHistoryList.length); + } + + Widget loadQuotationAnalysisData() { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.quotationNumber.tr(), quotationAnalysisList[index].qUOTNUM ?? ""), + ItemDetailView(LocaleKeys.vendorName.tr(), quotationAnalysisList[index].vENDORNAME ?? ""), + ItemDetailView(LocaleKeys.itemCode.tr(), quotationAnalysisList[index].iTEMCODE ?? ""), + ItemDetailView(LocaleKeys.description.tr(), quotationAnalysisList[index].iTEMDESC ?? ""), + ItemDetailView(LocaleKeys.quotationQty.tr(), quotationAnalysisList[index].qUOTQTY?.toString() ?? ""), + ItemDetailView(LocaleKeys.quotationUOM.tr(), quotationAnalysisList[index].qUOTUOM ?? ""), + ItemDetailView(LocaleKeys.quotationNetPrice.tr(), quotationAnalysisList[index].qUOTUNITPRICE?.toString() ?? ""), + ItemDetailView(LocaleKeys.quotationLineTotal.tr(), quotationAnalysisList[index].qUOTLINETOTAL?.toString() ?? ""), + ItemDetailView(LocaleKeys.quotationBonusQuantity.tr(), quotationAnalysisList[index].qUOTBONUSQTY ?? ""), + ItemDetailView(LocaleKeys.quotationDeliveryDate.tr(), quotationAnalysisList[index].qUOTDELIVERYDATE ?? ""), + ItemDetailView(LocaleKeys.quotationMFGPartNumber.tr(), quotationAnalysisList[index].qUOTMFGPARTNUM ?? ""), + ItemDetailView(LocaleKeys.rfqNumber.tr(), quotationAnalysisList[index].rFQNUM ?? ""), + ItemDetailView(LocaleKeys.rfqQty.tr(), quotationAnalysisList[index].rFQQTY?.toString() ?? ""), + ItemDetailView(LocaleKeys.rfqUOM.tr(), quotationAnalysisList[index].rFQUOM ?? ""), + ], + ).objectContainerView(title: "${quotationAnalysisList[index].iTEMCODE}-${quotationAnalysisList[index].iTEMDESC}"), + separatorBuilder: (cxt, index) => 12.height, + itemCount: quotationAnalysisList.length); + } +} diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart new file mode 100644 index 0000000..4d6d7bd --- /dev/null +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -0,0 +1,376 @@ +import 'dart:convert'; + +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:mohem_flutter_app/api/worklist/worklist_api_client.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/utils.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/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_notification_buttons_list_model.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/allowed_actions_model.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart'; +import 'package:mohem_flutter_app/ui/work_list/itg_fragments/approval_level_fragment.dart'; +import 'package:mohem_flutter_app/ui/work_list/itg_fragments/request_detail_fragment.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dart'; + +class ItgDetailScreen extends StatefulWidget { + ItgDetailScreen({Key? key}) : super(key: key); + + @override + _ItgDetailScreenState createState() { + return _ItgDetailScreenState(); + } +} + +class _ItgDetailScreenState extends State { + int tabIndex = 0; + PageController controller = PageController(); + bool showFabOptions = false; + + bool isCloseAvailable = false; + bool isApproveAvailable = false; + bool isRejectAvailable = false; + + List allowedActionList = []; + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + RequestDetails? requestDetails; + ITGRequest? itgRequest; + + void getItgData() async { + try { + Utils.showLoading(context); + itgRequest = await WorkListApiClient().getITGFormDetails(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, ""); + allowedActionList = itgRequest?.allowedActions ?? []; + if (allowedActionList.isNotEmpty) { + isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE"); + isApproveAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Approve"); + // isAnswerAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Answer"); + isRejectAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Reject"); + } + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void getDataFromState() { + if (requestDetails == null) { + requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; + getItgData(); + } + } + + @override + Widget build(BuildContext context) { + getDataFromState(); + + return Scaffold( + appBar: AppBarWidget(context, title: LocaleKeys.details.tr()), + backgroundColor: Colors.white, + body: Stack( + children: [ + Column( + children: [ + 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, + ], + ), + ), + child: Row( + children: [ + myTab(LocaleKeys.requestDetails.tr(), 0), + myTab(LocaleKeys.approvalLevel.tr(), 1), + myTab(LocaleKeys.requesterDetails.tr(), 2), + ], + ), + ), + PageView( + controller: controller, + onPageChanged: (pageIndex) { + setState(() { + tabIndex = pageIndex; + }); + }, + children: [ + RequestDetailFragment(fields: itgRequest?.fieldGoups?[1].fields ?? []), + ApprovalLevelfragment( + wFHistory: itgRequest?.wFHistory ?? [], + ), + RequestDetailFragment(fields: itgRequest?.fieldGoups?[0].fields ?? []), + ], + ).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, + ), + ), + ), + child: Row( + children: [ + 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 (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; + }); + }) + ], + ), + ) + ], + ), + IgnorePointer( + ignoring: !showFabOptions, + child: AnimatedOpacity( + opacity: showFabOptions ? 1 : 0, + duration: const Duration(milliseconds: 250), + child: Container( + padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75 - 12), + width: double.infinity, + height: double.infinity, + color: Colors.white.withOpacity(.67), + alignment: Alignment.bottomRight, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + myFab("Skip", "assets/images/skip.svg").onPress(() { + // if (AppState().workList!.length - 1 > AppState().workListIndex!) { + // AppState().setWorkListIndex = AppState().workListIndex! + 1; + // workListData = null; + // showFabOptions = false; + // getDataFromState(); + // } else if (AppState().workList!.length - 1 == AppState().workListIndex!) { + // Navigator.pop(context); + // } + }), + 12.height, + ...viewApiButtonsList(allowedActionList), + ], + ), + ), + ).onPress(() { + setState(() { + showFabOptions = false; + }); + }), + ), + ], + ), + 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 allowedActionList) { + List fabs = []; + for (int i = 0; i < allowedActionList.length; i++) { + if (allowedActionList[i].action! == "Reject" || allowedActionList[i].action! == "Approve" || allowedActionList[i].action! == "CLOSE") { + continue; + } + fabs.add(myFab(allowedActionList[i].action!, "", isIconAsset: false).paddingOnly(bottom: 12).onPress(() => handleFabAction(allowedActionList[i]))); + } + return fabs; + } + + void handleFabAction(AllowedActions action) { + switch (action.action) { + case "DELEGATE": + // do something + break; + case "REQUEST_INFO": + // do something else + break; + case "RFC": + // do something else + break; + case "UPDATE_ACTION": + // do something else + break; + } + } + + Widget myTab(String title, int index) { + bool isSelected = (index == tabIndex); + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + title.toText12(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(() { + setState(() { + showFabOptions = true; + }); + }) + ], + ).onPress(() { + controller.jumpToPage(index); + }).expanded; + } + + Widget myFab(String title, String icon, {bool isIconAsset = true}) { + return Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + title.toText16(), + 14.width, + Container( + height: 43, + width: 43, + 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, + ], + ), + ), + child: isIconAsset + ? SvgPicture.asset(icon) + : Image.memory( + base64Decode(icon), + fit: BoxFit.cover, + ), + ) + ], + ); + } + + void performAction(String actionMode) { + showDialog( + context: context, + builder: (cxt) => AcceptRejectInputDialog( + message: LocaleKeys.requestedItems.tr(), + // notificationGetRespond: notificationNoteInput, + onTap: (note) { + Map payload = { + "P_ACTION_MODE": actionMode, + "P_APPROVER_INDEX": null, + "P_COMMENTS": "", + "P_FORWARD_TO_USER_NAME": "", + // "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID!, + "RespondAttributeList": [ + // if (notificationNoteInput != null) {notificationNoteInput!.attributeName: note} + ], + }; + + performNotificationAction(payload); + }, + ), + ); + } + + void performNotificationAction(Map payload) async { + try { + Utils.showLoading(context); + GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload); + Utils.hideLoading(context); + Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); + Navigator.pop(context, true); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } +} diff --git a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart new file mode 100644 index 0000000..5a6be84 --- /dev/null +++ b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart @@ -0,0 +1,128 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/wf_history_model.dart'; +import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; +import 'package:mohem_flutter_app/ui/work_list/sheets/request_more_info_sheet.dart'; +import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; +import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; + +class ApprovalLevelfragment extends StatelessWidget { + List wFHistory; + + ApprovalLevelfragment({Key? key, this.wFHistory = const []}) : super(key: key); + + @override + Widget build(BuildContext context) { + if (wFHistory.isNotEmpty) wFHistory = wFHistory.reversed.toList(); + return Container( + width: double.infinity, + height: double.infinity, + child: ListView.separated( + itemCount: wFHistory.length, + padding: const EdgeInsets.all(21), + itemBuilder: (context, index) { + return showItem(context, wFHistory[index]); + }, + separatorBuilder: (BuildContext context, int index) { + return 12.height; + }, + ), + ); + } + + Widget showItem(BuildContext context, WFHistory history) { + return Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + clipBehavior: Clip.antiAlias, + child: Stack( + clipBehavior: Clip.antiAlias, + children: [ + Positioned( + left: -20, + top: -10, + child: Transform.rotate( + angle: 15, + child: Container( + width: 50, + height: 30, + color: getStatusColor(history.action!), + ), + ), + ), + Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CircularAvatar(url: null, isImageBase64: false, height: 34, width: 34), + 9.width, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + history.name!.toText16(), + if ((history.notes ?? "").isNotEmpty) history.notes!.toText12(color: MyColors.grey57Color), + 4.height, + Row( + children: [ + history.action!.toText10( + color: getStatusColor(history.action!), + ), + 8.width, + if (history.date!.isNotEmpty) history.date!.toText12(color: MyColors.lightTextColor), + ], + ) + ], + ), + ) + ], + ).paddingOnly(top: 19, left: 16, right: 16, bottom: 12), + Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor), + Row( + children: [ + LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() { + showMyBottomSheet(context, child: RequestMoreInfoSheet()); + }).expanded, + Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), + LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { + showMyBottomSheet(context, child: DelegateSheet()); + }).expanded, + ], + ), + ], + ), + ], + ), + ); + } + + Color getStatusColor(String code) { + if (code == "SUBMIT") { + return const Color(0xff2E303A); + } else if (code == "REJECTED") { + return const Color(0xffD02127); + } else if (code == "APPROVED" || code == "Requested Information") { + return const Color(0xff1FA269); + } else if (code == "REQUEST_INFO") { + return const Color(0xff2E303A); + } else { + return const Color(0xff2E303A); + } + } +} diff --git a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart new file mode 100644 index 0000000..6c69c47 --- /dev/null +++ b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart @@ -0,0 +1,44 @@ +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/fields_model.dart'; +import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; + +class RequestDetailFragment extends StatelessWidget { + List fields; + + RequestDetailFragment({Key? key, this.fields = const []}) : super(key: key); + + @override + Widget build(BuildContext context) { + List uiList = [detailView()]; + return Container( + width: double.infinity, + height: double.infinity, + child: fields.isEmpty + ? LocaleKeys.noDataAvailable.tr().toText16().center + : ListView( + padding: const EdgeInsets.all(21), + children: uiList, + ), + ); + } + + Widget detailView() { + 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(); + } +} diff --git a/lib/ui/work_list/missing_swipe/fragments/actions_fragment.dart b/lib/ui/work_list/missing_swipe/fragments/actions_fragment.dart deleted file mode 100644 index 9c2de89..0000000 --- a/lib/ui/work_list/missing_swipe/fragments/actions_fragment.dart +++ /dev/null @@ -1,152 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/classes/colors.dart'; -import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; -import 'package:mohem_flutter_app/ui/work_list/sheets/request_more_info_sheet.dart'; -import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; -import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; -import 'package:mohem_flutter_app/extensions/string_extensions.dart'; -import 'package:mohem_flutter_app/extensions/int_extensions.dart'; -import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -import 'dart:math' as math; - -class ActionsFragment extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - height: double.infinity, - child: ListView.separated( - itemCount: actionsList.length, - padding: EdgeInsets.all(21), - itemBuilder: (context, index) { - return showItem(context, actionsList[index]); - }, - separatorBuilder: (BuildContext context, int index) { - return 16.height; - }, - ), - ); - } - - Widget showItem(BuildContext context, Color color) { - return Container( - width: double.infinity, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], - ), - clipBehavior: Clip.antiAlias, - child: Stack( - clipBehavior: Clip.antiAlias, - children: [ - Positioned( - left: -21, - child: Transform.rotate( - angle: 125, - child: Container( - width: 60, - height: 20, - color: color, - ), - ), - ), - Column( - children: [ - Padding( - padding: const EdgeInsets.only(left: 12, right: 12, top: 12), - child: Column( - children: [ - Row( - children: [ - CircularAvatar(), - 12.width, - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - "Mahmoud Shrouf".toText16(), - 6.height, - "Missing Swipe Request for Hussain, Mohammad has been approved" - .toText12(), - 3.height, - Row( - children: [ - "Submitted".toText10(), - 12.width, - "On 07 Jan 2021" - .toText12(color: MyColors.lightTextColor) - ], - ) - ], - ), - ) - ], - ), - ], - ), - ), - 12.height, - Container( - width: double.infinity, - height: 1, - color: MyColors.lightTextColor, - ), - Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - showMyBottomSheet(context, - child: RequestMoreInfoSheet()); - }, - child: Center( - child: "Request Info" - .toText12(isBold: true) - .paddingOnly( - left: 21, right: 21, top: 8, bottom: 8), - ), - ), - ), - Center( - child: Container( - width: 1, - height: 45, - color: MyColors.lightTextColor, - ), - ), - Expanded( - child: InkWell( - onTap: () { - showMyBottomSheet(context, child: DelegateSheet()); - }, - child: Center( - child: "Delegate" - .toText12( - color: MyColors.gradiantEndColor, isBold: true) - .paddingOnly( - left: 21, right: 21, top: 8, bottom: 8), - ), - ), - ), - ], - ), - ], - ), - ], - ), - ); - } -} - -List actionsList = [ - Colors.black, - Colors.red, - Colors.green, -]; diff --git a/lib/ui/work_list/missing_swipe/fragments/attachments_fragment.dart b/lib/ui/work_list/missing_swipe/fragments/attachments_fragment.dart deleted file mode 100644 index 652eba8..0000000 --- a/lib/ui/work_list/missing_swipe/fragments/attachments_fragment.dart +++ /dev/null @@ -1,61 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:mohem_flutter_app/extensions/string_extensions.dart'; -import 'package:mohem_flutter_app/extensions/int_extensions.dart'; - -class AttachmentsFragment extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - height: double.infinity, - child: ListView.separated( - itemCount: 2, - padding: EdgeInsets.all(21), - itemBuilder: (context, index) { - return showItem(attachmentsList[index]); - }, - separatorBuilder: (BuildContext context, int index) { - return 21.height; - }, - ), - ); - } - - Widget showItem(Attachments attachments) { - return Container( - width: double.infinity, - padding: EdgeInsets.all(21), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], - ), - child: Row( - children: [ - SvgPicture.asset(attachments.icon), - 12.width, - attachments.title.toText16() - ], - ), - ); - } -} - -class Attachments { - String title; - String icon; - - Attachments(this.title, this.icon); -} - -List attachmentsList = [ - Attachments("Attachment File Name.png", "assets/images/png.svg"), - Attachments("Attachment File Name.pdf", "assets/images/pdf.svg"), -]; diff --git a/lib/ui/work_list/missing_swipe/fragments/info_fragments.dart b/lib/ui/work_list/missing_swipe/fragments/info_fragments.dart deleted file mode 100644 index b115df9..0000000 --- a/lib/ui/work_list/missing_swipe/fragments/info_fragments.dart +++ /dev/null @@ -1,69 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/classes/colors.dart'; -import 'package:mohem_flutter_app/extensions/int_extensions.dart'; -import 'package:mohem_flutter_app/extensions/string_extensions.dart'; - -class InfoFragment extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - height: double.infinity, - child: Column( - children: [ - Container( - width: double.infinity, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], - ), - margin: EdgeInsets.all(21), - padding: EdgeInsets.only(top: 21, bottom: 21, right: 16, left: 16), - child: Column( - children: [ - Row( - children: [ - Expanded( - child: "Info Details".toText16(), - ), - // Icon(Icons.keyboard_arrow_down_rounded), - ], - ), - Column( - children: [ - 12.height, - showItem("From:", "Alma Linde Mendoza"), - showItem("To:", "Al Yabis, Norah"), - showItem("Sent:", "1/26/2020 10:41:07 AM"), - showItem("ID:", "30581045"), - showItem("Closed:", "-"), - ], - ), - ], - ), - ), - ], - ), - ); - } - - Widget showItem(String title, String value) { - return Padding( - padding: const EdgeInsets.only(top: 2, bottom: 2), - child: Row( - children: [ - title.toText12(isBold: true), - 6.width, - title.toText12(isBold: false, color: MyColors.normalTextColor), - ], - ), - ); - } -} diff --git a/lib/ui/work_list/missing_swipe/fragments/request_fragment.dart b/lib/ui/work_list/missing_swipe/fragments/request_fragment.dart deleted file mode 100644 index f87995a..0000000 --- a/lib/ui/work_list/missing_swipe/fragments/request_fragment.dart +++ /dev/null @@ -1,87 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/classes/colors.dart'; -import 'package:mohem_flutter_app/extensions/string_extensions.dart'; -import 'package:mohem_flutter_app/extensions/int_extensions.dart'; - -class RequestFragment extends StatefulWidget { - @override - State createState() => _RequestFragmentState(); -} - -class _RequestFragmentState extends State { - bool isOpened = false; - - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - height: double.infinity, - child: Column( - children: [ - Container( - width: double.infinity, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], - ), - margin: EdgeInsets.all(21), - padding: EdgeInsets.only(top: 21, bottom: 21, right: 16, left: 16), - child: Column( - children: [ - Row( - children: [ - Expanded( - child: "Hardware Mobility 161 Messenger".toText16(), - ), - Icon(Icons.keyboard_arrow_down_rounded), - ], - ), - Column( - children: [ - 12.height, - showItem("Code:", "3188000067"), - showItem("Quantity:", "1"), - showItem("Line Status:", "Pending Approval"), - showItem("Transection Type:", "Move Order Issue:"), - showItem("Organization Code:", "SWD"), - showItem("From Subinventory:", "SWD_MSPS"), - showItem("To Subinventory:", "SWD_MSPS"), - showItem("Ship To Location :", - "SWD 11206-E.R. (Emergency Room)"), - showItem("Unit:", "Each"), - showItem("Date Required:", "12/23/2019 4:54:04 PM"), - showItem("Status Date:", "12/23/2019 4:54:04 PM"), - showItem("Operation Unit:", "Sehat Al Sewedi"), - showItem("Organization:", "Sehat Al Sewedi"), - showItem("From Locator:", "-"), - showItem("To Locator :", "-"), - ], - ), - ], - ), - ), - ], - ), - ); - } - - Widget showItem(String title, String value) { - return Padding( - padding: const EdgeInsets.only(top: 2, bottom: 2), - child: Row( - children: [ - title.toText12(isBold: true), - 6.width, - title.toText12(isBold: false, color: MyColors.normalTextColor), - ], - ), - ); - } -} diff --git a/lib/ui/work_list/missing_swipe/missing_swipe_screen.dart b/lib/ui/work_list/missing_swipe/missing_swipe_screen.dart deleted file mode 100644 index 0a27afc..0000000 --- a/lib/ui/work_list/missing_swipe/missing_swipe_screen.dart +++ /dev/null @@ -1,228 +0,0 @@ -import 'package:easy_localization/src/public_ext.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:mohem_flutter_app/classes/colors.dart'; -import 'package:mohem_flutter_app/extensions/int_extensions.dart'; -import 'package:mohem_flutter_app/extensions/string_extensions.dart'; -import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; -import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/actions_fragment.dart'; -import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/attachments_fragment.dart'; -import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/info_fragments.dart'; -import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/request_fragment.dart'; -import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; -import 'package:mohem_flutter_app/widgets/button/default_button.dart'; - -class MissingSwipeScreen extends StatefulWidget { - MissingSwipeScreen({Key? key}) : super(key: key); - - @override - _MissingSwipeScreenState createState() { - return _MissingSwipeScreenState(); - } -} - -class _MissingSwipeScreenState extends State { - int tabIndex = 0; - PageController controller = PageController(); - bool showFabOptions = false; - - @override - void initState() { - super.initState(); - } - - @override - void dispose() { - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBarWidget(context, title: LocaleKeys.details.tr()), - backgroundColor: Colors.white, - body: Stack( - children: [ - Column( - children: [ - 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, - ], - ), - ), - child: Row( - children: [ - myTab("Request", 0), - myTab("Actions", 1), - myTab("Attachments", 2), - myTab("Info.", 3), - ], - ), - ), - Expanded( - child: PageView( - controller: controller, - onPageChanged: (pageIndex) { - setState(() { - tabIndex = pageIndex; - }); - }, - children: [ - RequestFragment(), - ActionsFragment(), - AttachmentsFragment(), - InfoFragment(), - ], - ), - ), - 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: [ - DefaultButton( - LocaleKeys.reject.tr(), - () {}, - colors: const [ - Color(0xffEB8C90), - Color(0xffDE6C70), - ], - ).expanded, - 8.width, - DefaultButton( - LocaleKeys.approve.tr(), - () {}, - 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; - }); - }) - ], - ), - ) - ], - ), - IgnorePointer( - ignoring: !showFabOptions, - child: AnimatedOpacity( - opacity: showFabOptions ? 1 : 0, - duration: const Duration(milliseconds: 250), - child: Container( - padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75), - width: double.infinity, - height: double.infinity, - color: Colors.white.withOpacity(.67), - alignment: Alignment.bottomRight, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - myFab("Skip", "assets/images/skip.svg"), - 12.height, - myFab("Request Info", "assets/images/request_info.svg"), - 12.height, - myFab("Delegate", "assets/images/delegate.svg"), - ], - ), - ), - ).onPress(() { - setState(() { - showFabOptions = false; - }); - }), - ), - ], - ), - ); - } - - Widget myTab(String title, int index) { - bool isSelected = (index == tabIndex); - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - title.toText12(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(() { - setState(() { - showFabOptions = true; - }); - }) - ], - ).onPress(() { - controller.jumpToPage(index); - }).expanded; - } - - Widget myFab(String title, String icon) { - return Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - title.toText16(), - 14.width, - Container( - height: 43, - width: 43, - 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, - ], - ), - ), - child: SvgPicture.asset(icon), - ) - ], - ); - } -} diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 1e46783..56bd496 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:mohem_flutter_app/api/worklist/worklist_api_client.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/utils.dart'; @@ -11,6 +12,8 @@ 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_forms_models/request_detail_model.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/request_type_model.dart'; import 'package:mohem_flutter_app/models/worklist_item_type_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; @@ -56,6 +59,11 @@ class _WorkListScreenState extends State { super.initState(); providerData = Provider.of(context, listen: false); + calculateCounter(); + getWorkList(); + } + + void calculateCounter() { workListItemTypes.forEach((workListElement) { if (workListElement.key == "ITG") { workListElement.value = providerData.itgFormsModel?.totalCount ?? 0; @@ -66,7 +74,6 @@ class _WorkListScreenState extends State { } } }); - getWorkList(); } ItgFormsModel? itgFormsModel; @@ -76,11 +83,15 @@ class _WorkListScreenState extends State { try { Utils.showLoading(context); if (workListItemTypes[workListItemIndex].key == "ITG") { - itgFormsModel = await WorkListApiClient().GetITGTaskCountRequestType(); + itgFormsModel = await WorkListApiClient().getITGTaskCountRequestType(); List requestAllList = []; for (int i = 0; i < (itgFormsModel?.requestType!.length ?? 0); i++) { + itgFormsModel?.requestType![i].requestDetails?.forEach((element) { + element.requestType = itgFormsModel?.requestType![i].requestTypeCode; + }); 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) { itgRequestTypeIndex = 0; @@ -88,12 +99,13 @@ class _WorkListScreenState extends State { } else { itgRequestTypeIndex = null; workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex].key); + AppState().setWorkList = workList; } Utils.hideLoading(context); setState(() {}); } catch (ex) { Utils.hideLoading(context); - Utils.handleException(ex, null); + Utils.handleException(ex, context, null); } } @@ -184,11 +196,11 @@ class _WorkListScreenState extends State { child: ListView.separated( physics: BouncingScrollPhysics(), itemBuilder: (context, index) { - return itgRowItem(workListItemTypes[workListItemIndex], itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails![index]); + return itgRowItem(workListItemTypes[workListItemIndex], itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails![index], index); }, separatorBuilder: (context, index) => 12.height, itemCount: itgFormsModel!.requestType![itgRequestTypeIndex!].requestDetails?.length ?? 0, - padding: EdgeInsets.only(top: 16, left: 21, right: 21), + padding: const EdgeInsets.all(21), ), ) : Expanded( @@ -196,13 +208,13 @@ class _WorkListScreenState extends State { ? ((workList!).isEmpty ? "No History Available".toText16().center : ListView.separated( - physics: BouncingScrollPhysics(), + physics: const BouncingScrollPhysics(), itemBuilder: (context, index) { - return rowItem(workListItemTypes[workListItemIndex], workList![index]); + return rowItem(workListItemTypes[workListItemIndex], workList![index], index); }, separatorBuilder: (context, index) => 12.height, itemCount: workList?.length ?? 0, - padding: EdgeInsets.only(top: 21, left: 21, right: 21), + padding: const EdgeInsets.all(21), )) : const SizedBox(), ), @@ -212,10 +224,29 @@ class _WorkListScreenState extends State { ); } - Widget itgRowItem(WorkListItemTypeModelData data, RequestDetails requestDetails) { + Widget itgRowItem(WorkListItemTypeModelData data, RequestDetails requestDetails, int index) { return InkWell( - onTap: () { - Navigator.pushNamed(context, AppRoutes.missingSwipe); + onTap: () async { + AppState().setItgWorkListIndex = index; + var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.itgDetail); + // if (shouldReloadData != null) { + // workList!.remove(data); + // AppState().setWorkList = workList; + // if (data.iTEMTYPE == "ITG") { + // + // + // } else { + // providerData.getOpenNotificationsList?.forEach((element) { + // if (element.itemType == data.iTEMTYPE) { + // element.openNtfNumber = element.openNtfNumber! - 1; + // } + // }); + // providerData.workListCounter = providerData.workListCounter - 1; + // providerData.notify(); + // } + // calculateCounter(); + // if (mounted) setState(() {}); + // } }, child: Container( width: double.infinity, @@ -271,10 +302,28 @@ class _WorkListScreenState extends State { ); } - Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData) { + Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData, int index) { return InkWell( - onTap: () { - Navigator.pushNamed(context, AppRoutes.missingSwipe); + onTap: () async { + AppState().setWorkListIndex = index; + var data = workList![index]; + var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.workListDetail, arguments: workData); + if (shouldReloadData != null) { + workList!.remove(data); + AppState().setWorkList = workList; + if (data.iTEMTYPE == "ITG") { + } else { + providerData.getOpenNotificationsList?.forEach((element) { + if (element.itemType == data.iTEMTYPE) { + element.openNtfNumber = element.openNtfNumber! - 1; + } + }); + providerData.workListCounter = providerData.workListCounter - 1; + providerData.notify(); + } + calculateCounter(); + if (mounted) setState(() {}); + } }, child: Container( width: double.infinity, diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart new file mode 100644 index 0000000..c64d91b --- /dev/null +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -0,0 +1,442 @@ +import 'dart:convert'; + +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:mohem_flutter_app/api/worklist/worklist_api_client.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/utils.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/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_absence_collection_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_action_history_list_model.dart'; +import 'package:mohem_flutter_app/models/get_attachement_list_model.dart'; +import 'package:mohem_flutter_app/models/get_item_creation_ntf_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_mo_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_notification_buttons_list_model.dart'; +import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart'; +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/worklist_response_model.dart'; +import 'package:mohem_flutter_app/ui/work_list/worklist_fragments/actions_fragment.dart'; +import 'package:mohem_flutter_app/ui/work_list/worklist_fragments/attachments_fragment.dart'; +import 'package:mohem_flutter_app/ui/work_list/worklist_fragments/detail_fragment.dart'; +import 'package:mohem_flutter_app/ui/work_list/worklist_fragments/info_fragments.dart'; +import 'package:mohem_flutter_app/ui/work_list/worklist_fragments/request_fragment.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dart'; + +class WorkListDetailScreen extends StatefulWidget { + WorkListDetailScreen({Key? key}) : super(key: key); + + @override + _WorkListDetailScreenState createState() { + return _WorkListDetailScreenState(); + } +} + +class _WorkListDetailScreenState extends State { + int tabIndex = 0; + PageController controller = PageController(); + bool showFabOptions = false; + + WorkListResponseModel? workListData; + MemberInformationListModel? memberInformationListModel; + List notificationButtonsList = []; + List actionHistoryList = []; + List getAttachmentList = []; + List getStampMsNotifications = []; + List getStampNsNotifications = []; + List getMoNotificationBodyList = []; + List? getAbsenceCollectionNotifications; + List getNotificationRespondAttributes = []; + NotificationGetRespondAttributesList? notificationNoteInput; + + GenericResponseModel? getBasicNTFBody; + GenericResponseModel? getICBody; + GenericResponseModel? subordinatesLeavesModel; + GetPoNotificationBodyList? getPoNotificationBody; + GetItemCreationNtfBodyList? getItemCreationNtfBody; + + bool isCloseAvailable = false; + bool isApproveAvailable = false; + bool isRejectAvailable = false; + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + void getData() async { + try { + Utils.showLoading(context); + if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { + memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); + } + if (workListData!.iTEMTYPE == "HRSSA") { + getBasicNTFBody = await WorkListApiClient().getBasicDetNTFBody(workListData!.nOTIFICATIONID!, -999); + getAbsenceCollectionNotifications = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID!, -999); + subordinatesLeavesModel = await WorkListApiClient().getSubordinatesLeaves("", ""); + } + if (workListData!.iTEMTYPE == "STAMP") { + if (workListData!.rEQUESTTYPE == "STAMP_MS") { + getStampMsNotifications = await WorkListApiClient().getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999); + } else { + getStampNsNotifications = await WorkListApiClient().getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999); + } + } + if (workListData!.iTEMTYPE == "INVMOA") { + getMoNotificationBodyList = await WorkListApiClient().getMoNotificationBody(workListData!.nOTIFICATIONID!, -999); + } + if (workListData!.iTEMTYPE == "INVITEM") { + getItemCreationNtfBody = await WorkListApiClient().getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999); + } + if (workListData!.iTEMTYPE == "POAPPRV") { + getPoNotificationBody = await WorkListApiClient().getPoNotificationBody(workListData!.nOTIFICATIONID!, -999); + } + getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); + if (getNotificationRespondAttributes.isNotEmpty) { + notificationNoteInput = getNotificationRespondAttributes.first; + } + notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!); + actionHistoryList = await WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!); + getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); + + if (notificationButtonsList.isNotEmpty) { + isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE"); + isApproveAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "APPROVED"); + isRejectAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "REJECTED"); + } + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void getDataFromState() { + if (workListData == null) { + workListData = AppState().workList![AppState().workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; + getData(); + } + } + + @override + Widget build(BuildContext context) { + getDataFromState(); + + return Scaffold( + appBar: AppBarWidget(context, title: LocaleKeys.details.tr()), + backgroundColor: Colors.white, + body: Stack( + children: [ + Column( + children: [ + 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, + ], + ), + ), + child: Row( + children: [ + myTab(LocaleKeys.info.tr(), 0), + (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), + ], + ), + ), + PageView( + controller: controller, + onPageChanged: (pageIndex) { + setState(() { + tabIndex = pageIndex; + }); + }, + children: [ + InfoFragment( + poHeaderList: getPoNotificationBody?.pOHeader ?? [], + workListData: workListData, + getAbsenceCollectionNotifications: getAbsenceCollectionNotifications, + itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [], + getStampMsNotifications: getStampMsNotifications), + (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") + ? DetailFragment(workListData, memberInformationListModel) + : RequestFragment( + moNotificationBodyList: getMoNotificationBodyList, + poLinesList: getPoNotificationBody?.pOLines ?? [], + itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [], + ), + ActionsFragment(actionHistoryList), + AttachmentsFragment(getAttachmentList), + ], + ).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, + ), + ), + ), + child: Row( + children: [ + 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 (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; + }); + }) + ], + ), + ) + ], + ), + IgnorePointer( + ignoring: !showFabOptions, + child: AnimatedOpacity( + opacity: showFabOptions ? 1 : 0, + duration: const Duration(milliseconds: 250), + child: Container( + padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75 - 12), + width: double.infinity, + height: double.infinity, + color: Colors.white.withOpacity(.67), + alignment: Alignment.bottomRight, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + myFab("Skip", "assets/images/skip.svg").onPress(() { + if (AppState().workList!.length - 1 > AppState().workListIndex!) { + AppState().setWorkListIndex = AppState().workListIndex! + 1; + workListData = null; + showFabOptions = false; + getDataFromState(); + } else if (AppState().workList!.length - 1 == AppState().workListIndex!) { + Navigator.pop(context); + } + }), + 12.height, + ...viewApiButtonsList(notificationButtonsList), + ], + ), + ), + ).onPress(() { + setState(() { + showFabOptions = false; + }); + }), + ), + ], + ), + 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 fabs = []; + for (int i = 0; i < notificationButtonsList.length; i++) { + if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || notificationButtonsList[i].bUTTONACTION! == "APPROVED" || notificationButtonsList[i].bUTTONACTION! == "CLOSE") { + continue; + } + fabs.add(myFab(notificationButtonsList[i].bUTTONLABEL!, notificationButtonsList[i].bUTTONICON ?? "", isIconAsset: false) + .paddingOnly(bottom: 12) + .onPress(() => handleFabAction(notificationButtonsList[i]))); + } + return fabs; + } + + void handleFabAction(GetNotificationButtonsList notificationButton) { + switch (notificationButton.bUTTONACTION) { + case "DELEGATE": + // do something + break; + case "REQUEST_INFO": + // do something else + break; + case "RFC": + // do something else + break; + case "UPDATE_ACTION": + // do something else + break; + } + } + + Widget myTab(String title, int index) { + bool isSelected = (index == tabIndex); + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + title.toText12(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(() { + setState(() { + showFabOptions = true; + }); + }) + ], + ).onPress(() { + controller.jumpToPage(index); + }).expanded; + } + + Widget myFab(String title, String icon, {bool isIconAsset = true}) { + return Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + title.toText16(), + 14.width, + Container( + height: 43, + width: 43, + 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, + ], + ), + ), + child: isIconAsset + ? SvgPicture.asset(icon) + : Image.memory( + base64Decode(icon), + fit: BoxFit.cover, + ), + ) + ], + ); + } + + void performAction(String actionMode) { + showDialog( + context: context, + builder: (cxt) => AcceptRejectInputDialog( + message: LocaleKeys.requestedItems.tr(), + notificationGetRespond: notificationNoteInput, + onTap: (note) { + Map payload = { + "P_ACTION_MODE": actionMode, + "P_APPROVER_INDEX": null, + "P_COMMENTS": "", + "P_FORWARD_TO_USER_NAME": "", + "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID!, + "RespondAttributeList": [ + if (notificationNoteInput != null) {notificationNoteInput!.attributeName: note} + ], + }; + + performNotificationAction(payload); + }, + ), + ); + } + + void performNotificationAction(Map payload) async { + try { + Utils.showLoading(context); + GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload); + Utils.hideLoading(context); + Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); + Navigator.pop(context, true); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } +} diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart new file mode 100644 index 0000000..bd722b7 --- /dev/null +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -0,0 +1,133 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.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/models/get_action_history_list_model.dart'; +import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; +import 'package:mohem_flutter_app/ui/work_list/sheets/request_more_info_sheet.dart'; +import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; +import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; + +class ActionsFragment extends StatelessWidget { + List actionHistoryList; + + ActionsFragment(this.actionHistoryList, {Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: double.infinity, + child: ListView.separated( + itemCount: actionHistoryList.length, + padding: EdgeInsets.all(21), + itemBuilder: (context, index) { + return showItem(context, actionHistoryList[index]); + }, + separatorBuilder: (BuildContext context, int index) { + return 12.height; + }, + ), + ); + } + + Widget showItem(BuildContext context, GetActionHistoryList actionHistory) { + return Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + clipBehavior: Clip.antiAlias, + child: Stack( + clipBehavior: Clip.antiAlias, + children: [ + Positioned( + left: -20, + top: -10, + child: Transform.rotate( + angle: 15, + child: Container( + width: 50, + height: 30, + color: getStatusColor(actionHistory.aCTIONCODE!), + ), + ), + ), + Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CircularAvatar(url: actionHistory.eMPLOYEEIMAGE ?? "", isImageBase64: true, height: 34, width: 34), + 9.width, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + actionHistory.nAME!.toText16(), + if ((actionHistory.nOTE ?? "").isNotEmpty) actionHistory.nOTE!.toText12(color: MyColors.grey57Color), + 4.height, + Row( + children: [ + actionHistory.aCTION!.toText10(), + 8.width, + if (actionHistory.nOTIFICATIONDATE!.isNotEmpty) + DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(actionHistory.nOTIFICATIONDATE!), false).toText12(color: MyColors.lightTextColor), + ], + ) + ], + ), + ) + ], + ).paddingOnly(top: 19, left: 16, right: 16, bottom: 12), + Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor), + Row( + children: [ + LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() { + showMyBottomSheet(context, child: RequestMoreInfoSheet()); + }).expanded, + Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), + LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { + showMyBottomSheet(context, child: DelegateSheet()); + }).expanded, + ], + ), + ], + ), + ], + ), + ); + } + + Color getStatusColor(String code) { + if (code == "SUBMIT") { + return const Color(0xff2E303A); + } else if (code == "REJECTED") { + return const Color(0xffD02127); + } else if (code == "APPROVED") { + return const Color(0xff1FA269); + } else if (code == "REQUEST_INFO") { + return const Color(0xff2E303A); + } else { + return const Color(0xff2E303A); + } + } +} + +List actionsList = [ + Colors.black, + Colors.red, + Colors.green, +]; diff --git a/lib/ui/work_list/worklist_fragments/attachments_fragment.dart b/lib/ui/work_list/worklist_fragments/attachments_fragment.dart new file mode 100644 index 0000000..692f5d8 --- /dev/null +++ b/lib/ui/work_list/worklist_fragments/attachments_fragment.dart @@ -0,0 +1,54 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_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/models/get_attachement_list_model.dart'; + +class AttachmentsFragment extends StatelessWidget { + final List getAttachmentList; + + AttachmentsFragment(this.getAttachmentList); + + @override + Widget build(BuildContext context) { + return ListView.separated( + itemCount: getAttachmentList.length, + itemBuilder: (context, index) { + return Row( + children: [ + SvgPicture.asset(determineFileIcon(getAttachmentList[index].fILECONTENTTYPE ?? "")), + 12.width, + (getAttachmentList[index].fILENAME?.capitalizeFirstofEach ?? "").toText16().expanded, + ], + ).objectContainerView().onPress(() {}); + }, + separatorBuilder: (BuildContext context, int index) => 12.height, + ).paddingAll(21); + } + + String determineFileIcon(String fileContentType) { + String icon = ""; + switch (fileContentType) { + case "pdf": + icon = "assets/images/pdf.svg"; + break; + case "xls": + icon = "assets/images/xls.svg"; + break; + case "xlsx": + icon = "assets/images/xls.svg"; + break; + case "png": + icon = "assets/images/png.svg"; + break; + case "jpg": + icon = "assets/images/jpg.svg"; + break; + case "jpeg": + icon = "assets/images/jpg.svg"; + break; + } + return icon; + } +} diff --git a/lib/ui/work_list/worklist_fragments/detail_fragment.dart b/lib/ui/work_list/worklist_fragments/detail_fragment.dart new file mode 100644 index 0000000..a8e6282 --- /dev/null +++ b/lib/ui/work_list/worklist_fragments/detail_fragment.dart @@ -0,0 +1,72 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/member_information_list_model.dart'; +import 'package:mohem_flutter_app/models/worklist_response_model.dart'; +import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; + +class DetailFragment extends StatefulWidget { + WorkListResponseModel? workListData; + MemberInformationListModel? memberInformationListModel; + + DetailFragment(this.workListData, this.memberInformationListModel); + + @override + State createState() => _DetailFragmentState(); +} + +class _DetailFragmentState extends State { + bool isOpened = false; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.from.tr(), widget.workListData!.fROMUSER ?? ""), + ItemDetailView(LocaleKeys.to.tr(), widget.workListData!.tOUSER ?? ""), + ItemDetailView(LocaleKeys.sent.tr(), widget.workListData!.bEGINDATE ?? ""), + ItemDetailView(LocaleKeys.closed.tr(), widget.workListData!.eNDDATE ?? ""), + ItemDetailView(LocaleKeys.id.tr(), widget.workListData!.nOTIFICATIONID?.toString() ?? ""), + ItemDetailView(LocaleKeys.responder.tr(), widget.workListData!.rESPONDER ?? ""), + ], + ).objectContainerView(), + 12.height, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.employeeNumber.tr(), widget.memberInformationListModel!.eMPLOYEENUMBER ?? ""), + ItemDetailView(LocaleKeys.employeeName.tr(), + (AppState().isArabic(context) ? widget.memberInformationListModel!.eMPLOYEENAMEAr : widget.memberInformationListModel!.eMPLOYEENAMEEn) ?? ""), + ItemDetailView(LocaleKeys.jobTitle.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")), + ItemDetailView(LocaleKeys.grade.tr(), widget.memberInformationListModel!.gRADENAME ?? ""), + ItemDetailView(LocaleKeys.jobCategory.tr(), makePositionName(widget.memberInformationListModel!.pOSITIONNAME ?? "")), + ItemDetailView(LocaleKeys.category.tr(), widget.memberInformationListModel!.eMPLOYMENTCATEGORYMEANING ?? ""), + ItemDetailView(LocaleKeys.employeeEmailAddress.tr(), widget.memberInformationListModel!.eMPLOYEEEMAILADDRESS ?? ""), + ItemDetailView(LocaleKeys.payrollBranch.tr(), widget.memberInformationListModel!.pAYROLLNAME ?? ""), + ], + ).objectContainerView(), + ], + ).paddingAll(21); + } + + String makePositionName(String job) { + String jobName = ""; + List list = job.split(".").toList(); + if (list.length > 1) { + list.removeLast(); + jobName = list.join(" "); + } + return jobName; + } + +} diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart new file mode 100644 index 0000000..ba0e57e --- /dev/null +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -0,0 +1,180 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.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/models/get_absence_collection_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_item_creation_ntf_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/worklist_response_model.dart'; +import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; + +class InfoFragment extends StatelessWidget { + WorkListResponseModel? workListData; + List poHeaderList; + List? getAbsenceCollectionNotifications; + List? getStampMsNotifications; + List? getStampNsNotifications; + List itemCreationHeader; + + InfoFragment( + {this.workListData, + this.poHeaderList = const [], + this.itemCreationHeader = const [], + this.getAbsenceCollectionNotifications, + this.getStampMsNotifications, + this.getStampNsNotifications}); + + @override + Widget build(BuildContext context) { + List uiList = [ + if ((workListData?.iTEMTYPE ?? "") == "INVMOA") + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), + ItemDetailView(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), + ItemDetailView(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), + ItemDetailView(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), + ItemDetailView(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), + ItemDetailView(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), + ItemDetailView(LocaleKeys.subject.tr(), workListData!.sUBJECT ?? ""), + ], + ).objectContainerView(), + if ((getAbsenceCollectionNotifications?.length ?? 0) > 0) getAbsenceCollectionNotificationsListView(getAbsenceCollectionNotifications ?? []).objectContainerView(title: "Absence Notifications"), + if (getStampMsNotifications?.isNotEmpty ?? false) getStampMsNotificationsListView(getStampMsNotifications ?? []).objectContainerView(title: "Stamp Notifications"), + if (getStampNsNotifications?.isNotEmpty ?? false) getStampNsNotificationsListView(getStampNsNotifications ?? []).objectContainerView(title: "Stamp Notifications"), + if (poHeaderList.isNotEmpty) getPoNotificationsListView(), + if (itemCreationHeader.isNotEmpty) getItemCreationHeaderView() + ]; + return Container( + width: double.infinity, + height: double.infinity, + child: uiList.isEmpty + ? LocaleKeys.noDataAvailable.tr().toText16().center + : ListView( + padding: const EdgeInsets.all(21), + children: uiList, + ), + ); + } + + Widget getPoNotificationsListView() { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.description.tr(), workListData!.fROMUSER ?? ""), + ItemDetailView(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), + ItemDetailView(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), + ItemDetailView(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), + ItemDetailView(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), + ItemDetailView(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), + ItemDetailView(LocaleKeys.supplier.tr(), poHeaderList[index].vENDORNAME ?? ""), + ItemDetailView(LocaleKeys.site.tr(), poHeaderList[index].vENDORSITECODE ?? ""), + ItemDetailView(LocaleKeys.buyer.tr(), poHeaderList[index].bUYER ?? ""), + ItemDetailView(LocaleKeys.preparer.tr(), poHeaderList[index].pREPARER ?? ""), + ItemDetailView(LocaleKeys.creationDate.tr(), poHeaderList[index].cREATIONDATE ?? ""), + ItemDetailView(LocaleKeys.shipToLocation.tr(), poHeaderList[index].sHIPTOLOCATIONNAME ?? ""), + ItemDetailView(LocaleKeys.quotationNumber.tr(), poHeaderList[index].qUOTATIONNUMBER ?? ""), + ItemDetailView(LocaleKeys.quotationDate.tr(), poHeaderList[index].qUOTATIONDATE ?? ""), + ItemDetailView(LocaleKeys.paymentTerms.tr(), poHeaderList[index].pAYMENTTERMS ?? ""), + ItemDetailView(LocaleKeys.currency.tr(), poHeaderList[index].cURRENCYNAME ?? ""), + ItemDetailView(LocaleKeys.grossAmount.tr(), poHeaderList[index].gROSSAMOUNT?.toString() ?? ""), + ItemDetailView(LocaleKeys.discountAmount.tr(), poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""), + ItemDetailView(LocaleKeys.customDuty.tr(), poHeaderList[index].cUSTOMDUTY?.toString() ?? ""), + ItemDetailView(LocaleKeys.shipHandle.tr(), poHeaderList[index].sHIPHANDLE?.toString() ?? ""), + ItemDetailView(LocaleKeys.otherCharges.tr(), poHeaderList[index].oTHERCHARGES?.toString() ?? ""), + ItemDetailView(LocaleKeys.totalPOAmountWithVAT.tr(), poHeaderList[index].qUOTATIONDATE ?? ""), + ItemDetailView(LocaleKeys.totalPOAmountInWords.tr(), poHeaderList[index].tOTPOAMTWORD ?? ""), + ], + ).objectContainerView(), + separatorBuilder: (cxt, index) => 4.height, + itemCount: poHeaderList.length); + } + + Widget getAbsenceCollectionNotificationsListView(List list) { + List dataList = list.isEmpty ? [] : (list.first.collectionNotification ?? []); + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => ItemDetailView(dataList[index].sEGMENTPROMPT!, dataList[index].sEGMENTVALUEDSP!), + separatorBuilder: (cxt, index) => 4.height, + itemCount: dataList.length); + } + + Widget getStampMsNotificationsListView(List list) { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()), + ItemDetailView(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()), + ItemDetailView(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()), + ItemDetailView(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)), + ItemDetailView(LocaleKeys.shiftType.tr(), list[index].sHTTYPEDESC.toString()), + ItemDetailView(LocaleKeys.shift.tr(), list[index].sHTNAME.toString()), + ItemDetailView(LocaleKeys.breakText.tr(), list[index].bREAKNAME.toString()), + ItemDetailView(LocaleKeys.actualSwipeStart.tr(), list[index].sHTACTUALSTARTTIME.toString()), + ItemDetailView(LocaleKeys.actualSwipeEnd.tr(), list[index].sHTACTUALENDTIME.toString()), + ItemDetailView(LocaleKeys.approvedSwipeStart.tr(), list[index].aPPROVEDSTARTTIME.toString()), + ItemDetailView(LocaleKeys.approvedSwipeStartReason.tr(), list[index].aPPROVEDSTARTREASON.toString()), + ItemDetailView(LocaleKeys.approvedSwipeEnd.tr(), ""), + ItemDetailView(LocaleKeys.approvedSwipeEndReason.tr(), list[index].aPPROVEDENDREASONDESC.toString()), + ], + ), + separatorBuilder: (cxt, index) => 18.height, + itemCount: list.length); + } + + Widget getStampNsNotificationsListView(List list) { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()), + ItemDetailView(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()), + ItemDetailView(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()), + ItemDetailView(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)), + ], + ), + separatorBuilder: (cxt, index) => 18.height, + itemCount: list.length); + } + + Widget getItemCreationHeaderView() { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.operatingUnit.tr(), itemCreationHeader[index].oPERATINGUNIT?.toString() ?? ""), + ItemDetailView(LocaleKeys.category.tr(), itemCreationHeader[index].cATEGORY?.toString() ?? ""), + ItemDetailView(LocaleKeys.requester.tr(), itemCreationHeader[index].rEQUESTER?.toString() ?? ""), + ItemDetailView(LocaleKeys.analyzedBy.tr(), itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""), + ItemDetailView(LocaleKeys.approvedDate.tr(), itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""), + ItemDetailView(LocaleKeys.itemType.tr(), itemCreationHeader[index].iTEMTYPE?.toString() ?? ""), + ItemDetailView(LocaleKeys.relatedTo.tr(), itemCreationHeader[index].rELATEDTO?.toString() ?? ""), + ItemDetailView(LocaleKeys.requestDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(itemCreationHeader[index].rEQUESTDATE.toString()), false) ?? ""), + ItemDetailView(LocaleKeys.analyzedDate.tr(), itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""), + ItemDetailView(LocaleKeys.urgent.tr(), itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? ""), + ], + ).objectContainerView(), + separatorBuilder: (cxt, index) => 18.height, + itemCount: itemCreationHeader.length); + } +} diff --git a/lib/ui/work_list/worklist_fragments/request_fragment.dart b/lib/ui/work_list/worklist_fragments/request_fragment.dart new file mode 100644 index 0000000..5773ffa --- /dev/null +++ b/lib/ui/work_list/worklist_fragments/request_fragment.dart @@ -0,0 +1,159 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/config/routes.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/models/get_item_creation_ntf_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_mo_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; + +class RequestFragment extends StatelessWidget { + final List moNotificationBodyList; + final List itemCreationLines; + final List poLinesList; + + RequestFragment({ + Key? key, + this.moNotificationBodyList = const [], + this.itemCreationLines = const [], + this.poLinesList = const [], + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return ListView( + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.all(21), + children: [ + if (moNotificationBodyList.isNotEmpty) moNotificationDataView(), + if (poLinesList.isNotEmpty) poLinesDataView(), + if (itemCreationLines.isNotEmpty) itemCreationLinesView(), + ], + ); + } + + Widget poLinesDataView() { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.code.tr(), poLinesList[index].iTEMCODE ?? ""), + ItemDetailView(LocaleKeys.mfg.tr(), poLinesList[index].uOM ?? ""), + ItemDetailView(LocaleKeys.lineType.tr(), poLinesList[index].qUANTITY?.toString() ?? ""), + ItemDetailView(LocaleKeys.unit.tr(), poLinesList[index].uOM ?? ""), + ItemDetailView(LocaleKeys.price.tr(), poLinesList[index].uNITPRICE?.toString() ?? ""), + ItemDetailView(LocaleKeys.lineAmount.tr(), poLinesList[index].lINEAMOUNT?.toString() ?? ""), + ItemDetailView(LocaleKeys.quantity.tr(), poLinesList[index].qUANTITY?.toString() ?? ""), + ItemDetailView(LocaleKeys.lineDiscount.tr(), poLinesList[index].lINEDISCPERCENTAGE?.toString() ?? ""), + ItemDetailView(LocaleKeys.needByDate.tr(), poLinesList[index].nEEDBYDATE ?? ""), + ItemDetailView(LocaleKeys.promisedDate.tr(), poLinesList[index].pROMISEDDATE ?? ""), + ItemDetailView(LocaleKeys.deliverToLocation.tr(), poLinesList[index].dELIVERTOLOCATION ?? ""), + ItemDetailView(LocaleKeys.requisitionNumber.tr(), poLinesList[index].rEQUESTOR ?? ""), + ItemDetailView(LocaleKeys.requester.tr(), poLinesList[index].pRNUM ?? ""), + 12.height, + Row( + children: [ + DefaultButton(LocaleKeys.itemHistory.tr(), () { + Navigator.pushNamed( + cxt, + AppRoutes.itemHistory, + arguments: ItemHistoryScreenParams(title: LocaleKeys.itemHistory.tr(), isMO: false, pItemId: poLinesList[index].iTEMID), + ); + }).expanded, + 12.width, + DefaultButton(LocaleKeys.quotationAnalysis.tr(), () { + Navigator.pushNamed( + cxt, + AppRoutes.itemHistory, + arguments: ItemHistoryScreenParams( + isItemHistory: false, isMO: false, title: LocaleKeys.quotationAnalysis.tr(), pItemId: poLinesList[index].iTEMID, pPoHeaderId: poLinesList[index].pOHEADERID), + ); + }).expanded, + ], + ) + ], + ).objectContainerView(title: poLinesList[index].iTEMDESCRIPTION!), + separatorBuilder: (cxt, index) => 12.height, + itemCount: poLinesList.length); + } + + Widget moNotificationDataView() { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.code.tr(), moNotificationBodyList[index].iTEMCODE ?? ""), + ItemDetailView(LocaleKeys.unit.tr(), moNotificationBodyList[index].uOM ?? ""), + ItemDetailView(LocaleKeys.quantity.tr(), moNotificationBodyList[index].qUANTITY?.toString() ?? ""), + ItemDetailView(LocaleKeys.dateRequired.tr(), moNotificationBodyList[index].dATEREQUIRED ?? ""), + ItemDetailView(LocaleKeys.lineStatus.tr(), moNotificationBodyList[index].lINESTATUS ?? ""), + ItemDetailView(LocaleKeys.statusDate.tr(), moNotificationBodyList[index].sTATUSDATE ?? ""), + ItemDetailView(LocaleKeys.transactionType.tr(), moNotificationBodyList[index].tRANSACTIONTYPENAME ?? ""), + ItemDetailView(LocaleKeys.operatingUnit.tr(), moNotificationBodyList[index].oPERATINGUNIT ?? ""), + ItemDetailView(LocaleKeys.organizationCode.tr(), moNotificationBodyList[index].oRGANIZATIONCODE ?? ""), + ItemDetailView(LocaleKeys.organization.tr(), moNotificationBodyList[index].oRGANIZATIONNAME ?? ""), + ItemDetailView(LocaleKeys.fromSubInventory.tr(), moNotificationBodyList[index].fROMSUBINVENTORY ?? ""), + ItemDetailView(LocaleKeys.fromLocator.tr(), moNotificationBodyList[index].fROMLOCATOR ?? ""), + ItemDetailView(LocaleKeys.toSubInventory.tr(), moNotificationBodyList[index].tOSUBINVENTORY ?? ""), + ItemDetailView(LocaleKeys.toLocator.tr(), moNotificationBodyList[index].tOLOCATOR ?? ""), + ItemDetailView(LocaleKeys.shipToLocator.tr(), moNotificationBodyList[index].sHIPTOLOCATION ?? ""), + 12.height, + DefaultButton(LocaleKeys.itemHistory.tr(), () { + Navigator.pushNamed( + cxt, + AppRoutes.itemHistory, + arguments: ItemHistoryScreenParams(title: LocaleKeys.itemHistory.tr(), pItemId: moNotificationBodyList[index].iTEMID, pOrgId: moNotificationBodyList[index].oRGID), + ); + }) + ], + ).objectContainerView(title: moNotificationBodyList[index].dESCRIPTION ?? ""), + separatorBuilder: (cxt, index) => 12.height, + itemCount: moNotificationBodyList.length); + } + + Widget itemCreationLinesView() { + return ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailView(LocaleKeys.productName.tr(), itemCreationLines[index].pRODUCTNAME ?? ""), + ItemDetailView(LocaleKeys.productDescription.tr(), itemCreationLines[index].pRODUCTDESCRIPTION ?? ""), + ItemDetailView(LocaleKeys.unitPrice.tr(), itemCreationLines[index].uNITPRICE?.toString() ?? ""), + ItemDetailView(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].uSERMANUFACTURERNAME ?? ""), + ItemDetailView(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].uSERMFGPARTNUM ?? ""), + ItemDetailView(LocaleKeys.supplierName.tr(), itemCreationLines[index].sUPPLIERNAME ?? ""), + ItemDetailView(LocaleKeys.supplierContact.tr(), itemCreationLines[index].sUPPLIERCONTACT ?? ""), + ItemDetailView(LocaleKeys.chargeToPatient.tr(), itemCreationLines[index].cHARGETOPATIENT ?? ""), + ItemDetailView(LocaleKeys.justification.tr(), itemCreationLines[index].jUSTIFICATION ?? ""), + ItemDetailView(LocaleKeys.itemCode.tr(), itemCreationLines[index].iTEMCODE ?? ""), + ItemDetailView(LocaleKeys.itemDescription.tr(), itemCreationLines[index].iTEMDESCRIPTION ?? ""), + ItemDetailView(LocaleKeys.groupCode.tr(), itemCreationLines[index].iTEMGROUPCODE ?? ""), + ItemDetailView(LocaleKeys.groupDescription.tr(), itemCreationLines[index].iTEMGROUP ?? ""), + ItemDetailView(LocaleKeys.subgroupCode.tr(), itemCreationLines[index].iTEMSUBGROUPCODE ?? ""), + ItemDetailView(LocaleKeys.subgroupDescription.tr(), itemCreationLines[index].iTEMSUBGROUP ?? ""), + ItemDetailView(LocaleKeys.primaryUOM.tr(), itemCreationLines[index].pRIMARYUOM ?? ""), + ItemDetailView(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].sTANDARDMANUFACTURERNAME ?? ""), + ItemDetailView(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].sTANDARDMFGPARTNUM ?? ""), + ItemDetailView(LocaleKeys.templateName.tr(), itemCreationLines[index].tEMPLATENAME ?? ""), + ItemDetailView(LocaleKeys.itemCreationStatus.tr(), itemCreationLines[index].iTEMCREATIONSTATUS ?? ""), + ItemDetailView(LocaleKeys.standardizationApprovalStatus.tr(), itemCreationLines[index].sTANDARDSTATUS ?? ""), + ItemDetailView(LocaleKeys.standardizationApprovalRejectionReason.tr(), itemCreationLines[index].sTANDARDREJECTREASON ?? ""), + ], + ).objectContainerView(title: itemCreationLines[index].iTEMDESCRIPTION!), + separatorBuilder: (cxt, index) => 12.height, + itemCount: itemCreationLines.length); + } +} diff --git a/lib/widgets/bottom_sheet.dart b/lib/widgets/bottom_sheet.dart index a44fd7b..f0bf3f8 100644 --- a/lib/widgets/bottom_sheet.dart +++ b/lib/widgets/bottom_sheet.dart @@ -39,3 +39,42 @@ showMyBottomSheet(BuildContext context, {required Widget child}) { }, ); } + +class BottomSheetItem extends StatelessWidget { + final Function onTap; + final IconData icon; + final String title; + final Color color; + + const BottomSheetItem({Key? key, required this.onTap, required this.title, required this.icon, this.color = Colors.black}) : super(key: key); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () { + if (onTap != null) { + Navigator.pop(context); + onTap(); + } + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 18.0), + child: Row( + children: [ + if (icon != null) + Icon( + icon, + color: color, + size: 18.0, + ), + if (icon != null) SizedBox(width: 24.0), + Text( + title ?? "", + style: TextStyle(color: color), + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/circular_avatar.dart b/lib/widgets/circular_avatar.dart index cd60e06..ad94052 100644 --- a/lib/widgets/circular_avatar.dart +++ b/lib/widgets/circular_avatar.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; class CircularAvatar extends StatelessWidget { @@ -5,8 +7,9 @@ class CircularAvatar extends StatelessWidget { final double radius; final double width; final double height; + final bool isImageBase64; - CircularAvatar({Key? key, this.radius = 70.0, this.width = 70, this.height = 60, this.url}) : super(key: key); + CircularAvatar({Key? key, this.radius = 70.0, this.width = 70, this.height = 60, this.url, this.isImageBase64 = false}) : super(key: key); @override Widget build(BuildContext context) { @@ -15,10 +18,23 @@ class CircularAvatar extends StatelessWidget { height: height, decoration: BoxDecoration( shape: BoxShape.circle, - image: DecorationImage( - fit: BoxFit.cover, - image: NetworkImage(url ?? "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png"), - ), + image: isImageBase64 + ? null + : DecorationImage( + fit: BoxFit.cover, + image: NetworkImage(url ?? "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png"), + ), + ), + child: isImageBase64 ? imageFromBase64String(url!) : null, + ); + } + + Widget imageFromBase64String(String base64String) { + return ClipRRect( + borderRadius: BorderRadius.circular(100), + child: Image.memory( + base64Decode(base64String), + fit: BoxFit.cover, ), ); } diff --git a/lib/widgets/dialogs/accept_reject_input_dialog.dart b/lib/widgets/dialogs/accept_reject_input_dialog.dart new file mode 100644 index 0000000..479a47b --- /dev/null +++ b/lib/widgets/dialogs/accept_reject_input_dialog.dart @@ -0,0 +1,103 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.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/models/notification_get_respond_attributes_list_model.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/input_widget.dart'; + +class AcceptRejectInputDialog extends StatelessWidget { + final String? title; + final String? message; + final String? okTitle; + final NotificationGetRespondAttributesList? notificationGetRespond; + final Function(String) onTap; + + AcceptRejectInputDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.notificationGetRespond}) : super(key: key); + + String note = ""; + + @override + Widget build(BuildContext context) { + return Dialog( + backgroundColor: Colors.white, + shape: const RoundedRectangleBorder(), + insetPadding: const EdgeInsets.only(left: 21, right: 21), + child: Padding( + padding: const EdgeInsets.only(left: 20, right: 20, top: 18, bottom: 28), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.only(top: 16.0), + child: Text( + title ?? LocaleKeys.confirm.tr(), + style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Color(0xff2B353E), height: 35 / 24, letterSpacing: -0.96), + ), + ), + ), + IconButton( + padding: EdgeInsets.zero, + icon: const Icon(Icons.close), + color: const Color(0xff2B353E), + constraints: const BoxConstraints(), + onPressed: () { + Navigator.pop(context); + }, + ) + ], + ), + Text( + message ?? "", + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff808080), letterSpacing: -0.48), + ), + if (notificationGetRespond != null) ...[ + 14.height, + InputWidget( + "Enter a Note", + notificationGetRespond!.attributeDisplayName!, + TextEditingController(), + isBackgroundEnable: true, + lines: 3, + onChange: (String note) { + this.note = note; + }, + ), + ], + 28.height, + Row( + children: [ + DefaultButton( + LocaleKeys.cancel.tr(), + () => Navigator.pop(context), + colors: const [MyColors.lightGreyEAColor, MyColors.lightGreyEAColor], + textColor: MyColors.darkTextColor, + ).expanded, + 10.width, + DefaultButton( + LocaleKeys.ok.tr(), + () { + Navigator.pop(context); + onTap(note); + }, + colors: const [ + Color(0xff28C884), + Color(0xff1BB271), + ], + ).expanded, + ], + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/dynamic_forms/dynamic_textfield_widget.dart b/lib/widgets/dynamic_forms/dynamic_textfield_widget.dart new file mode 100644 index 0000000..23404ca --- /dev/null +++ b/lib/widgets/dynamic_forms/dynamic_textfield_widget.dart @@ -0,0 +1,108 @@ +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; + +class DynamicTextFieldWidget extends StatelessWidget { + final String labelText; + final String hintText; + // final TextEditingController controller; + final VoidCallback? onTap; + final IconData? suffixIconData; + final bool isEnable; + final bool isReadOnly; + final bool isPopup; + final int? lines; + final bool isInputTypeNum; + final bool isObscureText; + final bool isBackgroundEnable; + final void Function(String)? onChange; + + DynamicTextFieldWidget(this.labelText, this.hintText, //this.controller, + {this.isObscureText = false, + this.onTap, + this.suffixIconData, + this.isEnable = true, + this.isReadOnly = false, + this.isPopup = false, + this.lines = 1, + this.onChange, + this.isInputTypeNum = false, + this.isBackgroundEnable = false}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: isReadOnly ? MyColors.lightGreyEFColor : Colors.white, + border: Border.all( + color: MyColors.lightGreyEFColor, + width: 1, + ), + ), + child: InkWell( + onTap: onTap, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + labelText, + style: const TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, readOnly: isReadOnly, + keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, + //controller: controller, + maxLines: lines, + obscuringCharacter: "*", + obscureText: isObscureText, + onChanged: onChange, + style: const TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: hintText, + fillColor: isReadOnly ? MyColors.borderColor : null, + hintStyle: const TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + // suffixIconConstraints: const BoxConstraints(minWidth: 50), + // suffixIcon: suffixIconData == null ? null : Icon(suffixIconData, color: MyColors.darkTextColor), + // suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(suffixIconData, color: MyColors.darkTextColor), onPressed: suffixTap), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (isPopup) const Icon(Icons.keyboard_arrow_down_outlined, color: MyColors.darkTextColor), + if (onTap != null) Icon(suffixIconData ?? Icons.keyboard_arrow_down_outlined, color: MyColors.darkTextColor), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/item_detail_view_widget.dart b/lib/widgets/item_detail_view_widget.dart new file mode 100644 index 0000000..99f77d7 --- /dev/null +++ b/lib/widgets/item_detail_view_widget.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; + +class ItemDetailView extends StatelessWidget { + final String title; + final String value; + const ItemDetailView(this.title, this.value, {Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "$title:".toText12(isBold: true, color: const Color(0xff2D3238)), + 6.width, + (value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor).expanded, + ], + ); + } +} diff --git a/lib/widgets/radio/show_radio.dart b/lib/widgets/radio/show_radio.dart index fda5bf9..65e0e36 100644 --- a/lib/widgets/radio/show_radio.dart +++ b/lib/widgets/radio/show_radio.dart @@ -7,8 +7,7 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart'; class ShowRadio extends StatelessWidget { String title, value, groupValue; - ShowRadio( - {required this.title, required this.value, required this.groupValue}); + ShowRadio({required this.title, required this.value, required this.groupValue}); @override Widget build(BuildContext context) { @@ -34,7 +33,7 @@ class ShowRadio extends StatelessWidget { ), ), 12.width, - title.toText12(isBold: true) + title.toText12(isBold: true, maxLine: 2) ], ); } diff --git a/pubspec.yaml b/pubspec.yaml index d38cc5a..b613514 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,6 +44,9 @@ dependencies: sizer: ^2.0.15 local_auth: ^1.1.9 fluttertoast: ^8.0.8 + syncfusion_flutter_calendar: ^19.4.48 + flutter_calendar_carousel: ^2.1.0 + pie_chart: ^5.1.0 shared_preferences: ^2.0.12 firebase_messaging: ^11.2.8 shimmer: ^2.0.0 @@ -51,7 +54,7 @@ dependencies: flutter_countdown_timer: ^4.1.0 nfc_manager: ^3.1.1 uuid: ^3.0.6 - + image_picker: ^0.8.5+3 # maps google_maps_flutter: ^2.0.2 google_maps_utils: ^1.4.0+1