Merge branch 'payment_worklist_CR_6939' of http://34.17.75.184/Haroon6138/mohemm-flutter-app into mohem_flutter_upgrade

# Conflicts:
#	lib/app_state/app_state.dart
#	lib/classes/consts.dart
#	lib/generated/codegen_loader.g.dart
#	lib/generated/locale_keys.g.dart
#	lib/ui/work_list/worklist_detail_screen.dart
payment_worklist_CR_6939
taha.alam 1 year ago
commit adc26a2435

@ -36,6 +36,7 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_bo
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart';
import 'package:mohem_flutter_app/models/worklist/payment_details_list.dart';
class WorkListApiClient { class WorkListApiClient {
static final WorkListApiClient _instance = WorkListApiClient._internal(); static final WorkListApiClient _instance = WorkListApiClient._internal();
@ -290,6 +291,22 @@ class WorkListApiClient {
return responseData.getPrNotificationBodyList; return responseData.getPrNotificationBodyList;
}, url, postParams); }, url, postParams);
} }
Future<GetPaymentNotificationBodyList?> getPaymentNotificationBody(int pNotificationID, int pTransactionID) async {
String url = "${ApiConsts.erpRest}GET_PAY_REQ_NOTIFICATION_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": pNotificationID,
"P_TRANSACTION_ID": pTransactionID,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getPaymentNotificationBodyList;
}, url, postParams);
}
Future<List<GetMoItemHistoryList>> getMoItemHistory(int pItemID, int pOrgID) async { Future<List<GetMoItemHistoryList>> getMoItemHistory(int pItemID, int pOrgID) async {
String url = "${ApiConsts.erpRest}GET_MO_ITEM_HISTORY"; String url = "${ApiConsts.erpRest}GET_MO_ITEM_HISTORY";
@ -718,4 +735,18 @@ class WorkListApiClient {
return responseData.getPRInformationList; return responseData.getPRInformationList;
}, url, postParams); }, url, postParams);
} }
Future<List<GetAbsenceCollectionNotificationBodyList>?> getPaymentDetailsNotification(int? notificationId) async {
String url = "${ApiConsts.erpRest}GET_PAY_REQ_NOTIFICATION_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": notificationId,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getAbsenceCollectionNotificationBodyList;
}, url, postParams);
}
} }

@ -90,7 +90,7 @@ class AppState {
String get getHuaweiPushToken => _huaweiPushToken; String get getHuaweiPushToken => _huaweiPushToken;
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.2, mobileType: Platform.isAndroid ? "android" : "ios"); final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 6.0, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() { void setPostParamsInitConfig() {
isAuthenticated = false; isAuthenticated = false;

@ -3,13 +3,12 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
class ApiConsts { class ApiConsts {
// static String baseUrl = "http://10.200.204.11"; // Local server // static String baseUrl = "http://10.200.204.11"; // Local server
// static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024"; // static String baseUrl = "http://10.20.200.111:1010/";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrl = "https://mohemm.hmg.com"; // New Live server
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://mohemm.hmg.com";
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";

@ -524,4 +524,14 @@ class DateUtil {
// } // }
// return ""; // return "";
// } // }
static String replaceArabicNumber(String input) {
const english = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
const arabic = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];
for (int i = 0; i < english.length; i++) {
input = input.replaceAll(arabic[i], english[i]);
}
return input;
}
} }

@ -551,6 +551,31 @@ class CodegenLoader extends AssetLoader {
"uploadedDocuments": "المستندات التي تم تحميلها", "uploadedDocuments": "المستندات التي تم تحميلها",
"youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني",
"pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون",
"paymentRequest":"طلب الدفع",
"paymentDetails":"تفاصيل الدفع",
"requestNo":"رقم الطلب",
"requesterEmpNum":"رقم الموظف الذي قدم الطلب",
"requesterEmpName":"اسم الموظف مقدم الطلب",
"prepareEmpName":"إعداد اسم الموظف",
"requesterPositionName":"اسم الوظيفة لمقدم الطلب",
"preparePositionName":"إعداد اسم الوظيفة",
"requesterPayrollName":"اسم مقدم الطلب",
"payingORGName":"اسم المنظمة الدافعة",
"requestAmount":"مبلغ الطلب",
"typeofPayment":"نوع الدفع",
"beneficiaryDetails":"تفاصيل المستفيد",
"beneficiaryName":"اسم المستفيد",
"idIqama":"الهوية السعودية / الإقامة",
"beneficiaryBankName":"اسم البنك المستفيد",
"sadadNumber":"رقم سداد",
"beneficiaryIBAN":"رقم IBAN للمستفيد",
"purchaseOrders":"طلبات الشراء",
"approvalDate":"تاريخ الموافقة",
"pOAmount":"مبلغ الطلب",
"versionStatus":"حالة الإصدار",
"supplierNo":"رقم المورد",
"general":"عام",
"generate": "يولد", "generate": "يولد",
}; };
static const Map<String, dynamic> en_US = { static const Map<String, dynamic> en_US = {
@ -1109,7 +1134,31 @@ class CodegenLoader extends AssetLoader {
"userId": "UserID", "userId": "UserID",
"pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.",
"youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.",
"generate": "Generate" "generate": "Generate",
"paymentRequest":"Pay Request",
"paymentDetails":"Payment Details",
"requestNo":"Request No",
"requesterEmpNum":"Requester Employee Num",
"requesterEmpName":"Requester Employee Name",
"prepareEmpName":"Prepare Employee Name",
"requesterPositionName":"Requester Position Name",
"preparePositionName":"Prepare Position Name",
"requesterPayrollName":"Requester Payroll Name",
"payingORGName":"Paying Organization Name",
"requestAmount":"Request Amount",
"typeofPayment":"Type of Payment",
"beneficiaryDetails":"Beneficiary Details",
"beneficiaryName":"Beneficiary Name",
"idIqama":"Saudi ID / Iqama",
"beneficiaryBankName":"Beneficiary Bank Name",
"sadadNumber":"Sadad Number",
"beneficiaryIBAN":"Beneficiary IBAN",
"purchaseOrders":"Purchase Orders",
"approvalDate":"Approval Date",
"pOAmount":"PO Amount",
"versionStatus":"Version Status",
"supplierNo":"Supplier No",
"general":"General"
}; };
static const Map<String, Map<String, dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; static const Map<String, Map<String, dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
} }

@ -403,6 +403,7 @@ abstract class LocaleKeys {
static const purchaseOrder = 'purchaseOrder'; static const purchaseOrder = 'purchaseOrder';
static const ITGForms = 'ITGForms'; static const ITGForms = 'ITGForms';
static const itemCreation = 'itemCreation'; static const itemCreation = 'itemCreation';
static const paymentRequest = 'paymentRequest';
static const stamp = 'stamp'; static const stamp = 'stamp';
static const addFavoriteList = 'addFavoriteList'; static const addFavoriteList = 'addFavoriteList';
static const feedbackUserExperience = 'feedbackUserExperience'; static const feedbackUserExperience = 'feedbackUserExperience';
@ -551,4 +552,28 @@ abstract class LocaleKeys {
static const youCannotJoinTheMarathon ='youCannotJoinTheMarathon'; static const youCannotJoinTheMarathon ='youCannotJoinTheMarathon';
static const open ='open'; static const open ='open';
static const generate = 'generate'; static const generate = 'generate';
static const paymentDetails ='paymentDetails';
static const requestNo ='requestNo';
static const requesterEmpNum ='requesterEmpNum';
static const requesterEmpName ='requesterEmpName';
static const prepareEmpName ='prepareEmpName';
static const requesterPositionName ='requesterPositionName';
static const preparePositionName ='preparePositionName';
static const requesterPayrollName ='requesterPayrollName';
static const payingORGName ='payingORGName';
static const requestAmount ='requestAmount';
static const typeofPayment ='typeofPayment';
static const beneficiaryDetails ='beneficiaryDetails';
static const beneficiaryName ='beneficiaryName';
static const idIqama ='idIqama';
static const beneficiaryBankName ='beneficiaryBankName';
static const sadadNumber ='sadadNumber';
static const beneficiaryIBAN ='beneficiaryIBAN';
static const purchaseOrders ='purchaseOrders';
static const pOAmount ='pOAmount';
static const approvalDate ='approvalDate';
static const versionStatus ='versionStatus';
static const supplierNo ='supplierNo';
static const general ="general";
} }

@ -110,6 +110,7 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_bo
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/payment_details_list.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/resubmit_eit_response_model.dart'; import 'package:mohem_flutter_app/models/worklist/resubmit_eit_response_model.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart';
@ -187,6 +188,7 @@ class GenericResponseModel {
List<String>? getCEIDFFStructureList; List<String>? getCEIDFFStructureList;
List<String>? getCEITransactionList; List<String>? getCEITransactionList;
List<String>? getCcpTransactionsList; List<String>? getCcpTransactionsList;
List<GetContactColsStructureList>? getContactColsStructureList; List<GetContactColsStructureList>? getContactColsStructureList;
List<GetContactDetailsList>? getContactDetailsList; List<GetContactDetailsList>? getContactDetailsList;
List<GetContactDffStructureList>? getContactDffStructureList; List<GetContactDffStructureList>? getContactDffStructureList;
@ -232,6 +234,7 @@ class GenericResponseModel {
List<GetPoItemHistoryList>? getPoItemHistoryList; List<GetPoItemHistoryList>? getPoItemHistoryList;
GetPoNotificationBodyList? getPoNotificationBodyList; GetPoNotificationBodyList? getPoNotificationBodyList;
GetPrNotificationBodyList? getPrNotificationBodyList; GetPrNotificationBodyList? getPrNotificationBodyList;
GetPaymentNotificationBodyList? getPaymentNotificationBodyList;
GetPRInformationList? getPRInformationList; GetPRInformationList? getPRInformationList;
List<GetQuotationAnalysisList>? getQuotationAnalysisList; List<GetQuotationAnalysisList>? getQuotationAnalysisList;
List<GetRFCEmployeeList>? getRFCEmployeeListList; List<GetRFCEmployeeList>? getRFCEmployeeListList;
@ -500,6 +503,7 @@ class GenericResponseModel {
this.getPoItemHistoryList, this.getPoItemHistoryList,
this.getPoNotificationBodyList, this.getPoNotificationBodyList,
this.getPrNotificationBodyList, this.getPrNotificationBodyList,
this.getPaymentNotificationBodyList,
this.getPRInformationList, this.getPRInformationList,
this.getQuotationAnalysisList, this.getQuotationAnalysisList,
this.getRFCEmployeeListList, this.getRFCEmployeeListList,
@ -1022,6 +1026,9 @@ class GenericResponseModel {
} }
getPoNotificationBodyList = json['GetPoNotificationBodyList'] != null ? GetPoNotificationBodyList.fromJson(json['GetPoNotificationBodyList']) : null; getPoNotificationBodyList = json['GetPoNotificationBodyList'] != null ? GetPoNotificationBodyList.fromJson(json['GetPoNotificationBodyList']) : null;
getPrNotificationBodyList = json['GetPrNotificationBodyList'] != null ? GetPrNotificationBodyList.fromJson(json['GetPrNotificationBodyList']) : null; getPrNotificationBodyList = json['GetPrNotificationBodyList'] != null ? GetPrNotificationBodyList.fromJson(json['GetPrNotificationBodyList']) : null;
getPaymentNotificationBodyList = json['Pay_ReqNotificationBody'] != null ? GetPaymentNotificationBodyList.fromJson(json['Pay_ReqNotificationBody']) : null;
getPRInformationList = json['PR_Information_List'] != null ? GetPRInformationList.fromJson(json['PR_Information_List']) : null; getPRInformationList = json['PR_Information_List'] != null ? GetPRInformationList.fromJson(json['PR_Information_List']) : null;
if (json['GetQuotationAnalysisList'] != null) { if (json['GetQuotationAnalysisList'] != null) {
getQuotationAnalysisList = <GetQuotationAnalysisList>[]; getQuotationAnalysisList = <GetQuotationAnalysisList>[];
@ -1650,6 +1657,9 @@ class GenericResponseModel {
if (this.getPrNotificationBodyList != null) { if (this.getPrNotificationBodyList != null) {
data['GetPrNotificationBodyList'] = this.getPrNotificationBodyList!.toJson(); data['GetPrNotificationBodyList'] = this.getPrNotificationBodyList!.toJson();
} }
if (this.getPaymentNotificationBodyList != null) {
data['Pay_ReqNotificationBody'] = this.getPaymentNotificationBodyList!.toJson();
}
if (this.getPRInformationList != null) { if (this.getPRInformationList != null) {
data['PR_Information_List'] = this.getPRInformationList!.toJson(); data['PR_Information_List'] = this.getPRInformationList!.toJson();

@ -0,0 +1,285 @@
import 'dart:convert';
class GetPaymentNotificationBodyList {
List<BeneficieryList>? beneficieryList;
dynamic pInformation;
dynamic pQuestion;
List<PaymentDetailsList>? paymentDetailsList;
List<PurchaseOrdersList>? purchaseOrdersList;
List<RefundInvoiceList>? refundInvoiceList;
List<SupplierInformationList>? supplierInformationList;
GetPaymentNotificationBodyList({
this.beneficieryList,
this.pInformation,
this.pQuestion,
this.paymentDetailsList,
this.purchaseOrdersList,
this.refundInvoiceList,
this.supplierInformationList,
});
factory GetPaymentNotificationBodyList.fromRawJson(String str) => GetPaymentNotificationBodyList.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory GetPaymentNotificationBodyList.fromJson(Map<String, dynamic> json) => GetPaymentNotificationBodyList(
beneficieryList: json["Beneficiery_List"] == null ? [] : List<BeneficieryList>.from(json["Beneficiery_List"]!.map((x) => BeneficieryList.fromJson(x))),
pInformation: json["P_INFORMATION"],
pQuestion: json["P_QUESTION"],
paymentDetailsList: json["PaymentDetails_List"] == null ? [] : List<PaymentDetailsList>.from(json["PaymentDetails_List"]!.map((x) => PaymentDetailsList.fromJson(x))),
purchaseOrdersList: json["PurchaseOrders_List"] == null ? [] : List<PurchaseOrdersList>.from(json["PurchaseOrders_List"]!.map((x) => PurchaseOrdersList.fromJson(x))),
refundInvoiceList: json["RefundInvoice_List"] == null ? [] : List<RefundInvoiceList>.from(json["RefundInvoice_List"]!.map((x) => RefundInvoiceList.fromJson(x))),
supplierInformationList: json["SupplierInformation_List"] == null ? [] : List<SupplierInformationList>.from(json["SupplierInformation_List"]!.map((x) => SupplierInformationList.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"Beneficiery_List": beneficieryList == null ? [] : List<dynamic>.from(beneficieryList!.map((x) => x.toJson())),
"P_INFORMATION": pInformation,
"P_QUESTION": pQuestion,
"PaymentDetails_List": paymentDetailsList == null ? [] : List<dynamic>.from(paymentDetailsList!.map((x) => x.toJson())),
"PurchaseOrders_List": purchaseOrdersList == null ? [] : List<dynamic>.from(purchaseOrdersList!.map((x) => x.toJson())),
"RefundInvoice_List": refundInvoiceList == null ? [] : List<dynamic>.from(refundInvoiceList!.map((x) => x.toJson())),
"SupplierInformation_List": supplierInformationList == null ? [] : List<dynamic>.from(supplierInformationList!.map((x) => x.toJson())),
};
}
class BeneficieryList {
String? beneficiaryBankName;
String? beneficiaryIban;
String? beneficiaryName;
String? iqamaNumber;
String? saddadNumber;
BeneficieryList({
this.beneficiaryBankName,
this.beneficiaryIban,
this.beneficiaryName,
this.iqamaNumber,
this.saddadNumber,
});
factory BeneficieryList.fromRawJson(String str) => BeneficieryList.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory BeneficieryList.fromJson(Map<String, dynamic> json) => BeneficieryList(
beneficiaryBankName: json["BENEFICIARY_BANK_NAME"],
beneficiaryIban: json["BENEFICIARY_IBAN"],
beneficiaryName: json["BENEFICIARY_NAME"],
iqamaNumber: json["IQAMA_NUMBER"],
saddadNumber: json["SADDAD_NUMBER"],
);
Map<String, dynamic> toJson() => {
"BENEFICIARY_BANK_NAME": beneficiaryBankName,
"BENEFICIARY_IBAN": beneficiaryIban,
"BENEFICIARY_NAME": beneficiaryName,
"IQAMA_NUMBER": iqamaNumber,
"SADDAD_NUMBER": saddadNumber,
};
}
class PaymentDetailsList {
String? currency;
String? payingOrganizationName;
String? paymentDetails;
String? paymentMethodName;
String? prepareEmployeeName;
String? prepareEmployeeNumber;
String? preparePositionName;
String? requesterEmployeeName;
String? requesterEmployeeNumber;
String? requesterOperatingUnits;
String? requesterPayrollName;
String? requesterPositionName;
String? requestAmount;
String? requestDate;
String? requestNumber;
String? typeOfPayment;
PaymentDetailsList({
this.currency,
this.payingOrganizationName,
this.paymentDetails,
this.paymentMethodName,
this.prepareEmployeeName,
this.prepareEmployeeNumber,
this.preparePositionName,
this.requesterEmployeeName,
this.requesterEmployeeNumber,
this.requesterOperatingUnits,
this.requesterPayrollName,
this.requesterPositionName,
this.requestAmount,
this.requestDate,
this.requestNumber,
this.typeOfPayment,
});
factory PaymentDetailsList.fromRawJson(String str) => PaymentDetailsList.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PaymentDetailsList.fromJson(Map<String, dynamic> json) => PaymentDetailsList(
currency: json["CURRENCY"],
payingOrganizationName: json["PAYING_ORGANIZATION_NAME"],
paymentDetails: json["PAYMENT_DETAILS"],
paymentMethodName: json["PAYMENT_METHOD_NAME"],
prepareEmployeeName: json["PREPARE_EMPLOYEE_NAME"],
prepareEmployeeNumber: json["PREPARE_EMPLOYEE_NUMBER"],
preparePositionName: json["PREPARE_POSITION_NAME"],
requesterEmployeeName: json["REQUESTER_EMPLOYEE_NAME"],
requesterEmployeeNumber: json["REQUESTER_EMPLOYEE_NUMBER"],
requesterOperatingUnits: json["REQUESTER_OPERATING_UNITS"],
requesterPayrollName: json["REQUESTER_PAYROLL_NAME"],
requesterPositionName: json["REQUESTER_POSITION_NAME"],
requestAmount: json["REQUEST_AMOUNT"],
requestDate: json["REQUEST_DATE"],
requestNumber: json["REQUEST_NUMBER"],
typeOfPayment: json["TYPE_OF_PAYMENT"],
);
Map<String, dynamic> toJson() => {
"CURRENCY": currency,
"PAYING_ORGANIZATION_NAME": payingOrganizationName,
"PAYMENT_DETAILS": paymentDetails,
"PAYMENT_METHOD_NAME": paymentMethodName,
"PREPARE_EMPLOYEE_NAME": prepareEmployeeName,
"PREPARE_EMPLOYEE_NUMBER": prepareEmployeeNumber,
"PREPARE_POSITION_NAME": preparePositionName,
"REQUESTER_EMPLOYEE_NAME": requesterEmployeeName,
"REQUESTER_EMPLOYEE_NUMBER": requesterEmployeeNumber,
"REQUESTER_OPERATING_UNITS": requesterOperatingUnits,
"REQUESTER_PAYROLL_NAME": requesterPayrollName,
"REQUESTER_POSITION_NAME": requesterPositionName,
"REQUEST_AMOUNT": requestAmount,
"REQUEST_DATE": requestDate,
"REQUEST_NUMBER": requestNumber,
"TYPE_OF_PAYMENT": typeOfPayment,
};
}
class PurchaseOrdersList {
dynamic poAmount;
dynamic poApprovalDate;
String? poNumber;
String? prNumber;
String? supplierName;
String? supplierNumber;
String? versionStatus;
PurchaseOrdersList({
this.poAmount,
this.poApprovalDate,
this.poNumber,
this.prNumber,
this.supplierName,
this.supplierNumber,
this.versionStatus,
});
factory PurchaseOrdersList.fromRawJson(String str) => PurchaseOrdersList.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PurchaseOrdersList.fromJson(Map<String, dynamic> json) => PurchaseOrdersList(
poAmount: json["PO_AMOUNT"],
poApprovalDate: json["PO_APPROVAL_DATE"],
poNumber: json["PO_NUMBER"],
prNumber: json["PR_NUMBER"],
supplierName: json["SUPPLIER_NAME"],
supplierNumber: json["SUPPLIER_NUMBER"],
versionStatus: json["VERSION_STATUS"],
);
Map<String, dynamic> toJson() => {
"PO_AMOUNT": poAmount,
"PO_APPROVAL_DATE": poApprovalDate,
"PO_NUMBER": poNumber,
"PR_NUMBER": prNumber,
"SUPPLIER_NAME": supplierName,
"SUPPLIER_NUMBER": supplierNumber,
"VERSION_STATUS": versionStatus,
};
}
class RefundInvoiceList {
dynamic amount;
String? hospitalClinic;
dynamic invoicedDate;
String? invoiceNumber;
String? patientName;
String? patientNumber;
RefundInvoiceList({
this.amount,
this.hospitalClinic,
this.invoicedDate,
this.invoiceNumber,
this.patientName,
this.patientNumber,
});
factory RefundInvoiceList.fromRawJson(String str) => RefundInvoiceList.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory RefundInvoiceList.fromJson(Map<String, dynamic> json) => RefundInvoiceList(
amount: json["AMOUNT"],
hospitalClinic: json["HOSPITAL_CLINIC"],
invoicedDate: json["INVOICED_DATE"],
invoiceNumber: json["INVOICE_NUMBER"],
patientName: json["PATIENT_NAME"],
patientNumber: json["PATIENT_NUMBER"],
);
Map<String, dynamic> toJson() => {
"AMOUNT": amount,
"HOSPITAL_CLINIC": hospitalClinic,
"INVOICED_DATE": invoicedDate,
"INVOICE_NUMBER": invoiceNumber,
"PATIENT_NAME": patientName,
"PATIENT_NUMBER": patientNumber,
};
}
class SupplierInformationList {
String? crNumber;
String? supplierBankAccountName;
String? supplierBankAccountNumber;
String? supplierBankIban;
String? supplierName;
String? supplierNumber;
SupplierInformationList({
this.crNumber,
this.supplierBankAccountName,
this.supplierBankAccountNumber,
this.supplierBankIban,
this.supplierName,
this.supplierNumber,
});
factory SupplierInformationList.fromRawJson(String str) => SupplierInformationList.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory SupplierInformationList.fromJson(Map<String, dynamic> json) => SupplierInformationList(
crNumber: json["CR_NUMBER"],
supplierBankAccountName: json["SUPPLIER_BANK_ACCOUNT_NAME"],
supplierBankAccountNumber: json["SUPPLIER_BANK_ACCOUNT_NUMBER"],
supplierBankIban: json["SUPPLIER_BANK_IBAN"],
supplierName: json["SUPPLIER_NAME"],
supplierNumber: json["SUPPLIER_NUMBER"],
);
Map<String, dynamic> toJson() => {
"CR_NUMBER": crNumber,
"SUPPLIER_BANK_ACCOUNT_NAME": supplierBankAccountName,
"SUPPLIER_BANK_ACCOUNT_NUMBER": supplierBankAccountNumber,
"SUPPLIER_BANK_IBAN": supplierBankIban,
"SUPPLIER_NAME": supplierName,
"SUPPLIER_NUMBER": supplierNumber,
};
}

@ -58,9 +58,15 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments as GetMobileLoginInfoListModel; if(ModalRoute.of(context)!.settings.arguments != null) {
// String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!; mobileLoginInfoListModel ??= ModalRoute
String empName = mobileLoginInfoListModel!.employeeName!; .of(context)!
.settings
.arguments as GetMobileLoginInfoListModel;
// String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!;
String empName = mobileLoginInfoListModel!.employeeName!;
}
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(

@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/leave_balance_api_client.dart'; import 'package:mohem_flutter_app/api/leave_balance_api_client.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/date_uitl.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
@ -85,7 +86,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
// } // }
// } // }
// } // }
return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson(); return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: DateUtil.replaceArabicNumber(tempVar)).toJson();
}).toList(); }).toList();
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson()); values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson());
@ -773,7 +774,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
onTap: () async { onTap: () async {
if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
var timeString = getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":"); var timeString = getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":");
selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1])); selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse((timeString[1])));
//DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); //DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
} }
@ -861,7 +862,9 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
context: context, context: context,
initialTime: time, initialTime: time,
builder: (cxt, child) { builder: (cxt, child) {
return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: child ?? Container()); return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: Localizations.override(
context: context,
locale: const Locale('en', 'US'),child: child ?? Container()));
}); });
if (picked != null && picked != time) { if (picked != null && picked != time) {

@ -38,7 +38,7 @@ class _UpdateContinueSheetState extends State<UpdateContinueSheet> {
var size = MediaQuery.of(context).size; var size = MediaQuery.of(context).size;
itemHeight = (size.height - kToolbarHeight - 24) / 9; itemHeight = (size.height - kToolbarHeight - 24) / 9;
itemWidth = size.width / 2; itemWidth = size.width / 2;
return Column( return Column(
children: [ children: [
if ((widget.workListData?.sUBJECT ?? "").isNotEmpty) widget.workListData!.sUBJECT!.toText14().paddingOnly(top: 10, right: 21, left: 21, bottom: 21), if ((widget.workListData?.sUBJECT ?? "").isNotEmpty) widget.workListData!.sUBJECT!.toText14().paddingOnly(top: 10, right: 21, left: 21, bottom: 21),
ListView.separated( ListView.separated(

@ -78,7 +78,10 @@ class _WorkListScreenState extends State<WorkListScreen> {
WorkListItemTypeModelData( WorkListItemTypeModelData(
value: 0, name: 'STAMP', fullName: LocaleKeys.stamp.tr(), active: false, color: [Color(0xff32D892), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'STAMP', disable: false), value: 0, name: 'STAMP', fullName: LocaleKeys.stamp.tr(), active: false, color: [Color(0xff32D892), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'STAMP', disable: false),
WorkListItemTypeModelData( WorkListItemTypeModelData(
value: 0, name: 'COC', fullName: LocaleKeys.itemCreation.tr(), active: false, color: [Color(0xff787299), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'COC', disable: true) value: 0, name: 'COC', fullName: LocaleKeys.itemCreation.tr(), active: false, color: [Color(0xff787299), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'COC', disable: true),
WorkListItemTypeModelData(
value: 0, name: 'Payment Req', fullName: LocaleKeys.paymentRequest.tr(), active: false, color: [Color(0xff42d7bf), Color(0xff42d7bf)], icon: "assets/images/PR.svg", key: 'PAY_REQ', disable: false)
]; ];
int? workListItemIndex; int? workListItemIndex;

@ -29,6 +29,7 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_bo
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/payment_details_list.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart';
@ -46,7 +47,6 @@ import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dar
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart'; import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart';
class WorkListDetailScreen extends StatefulWidget { class WorkListDetailScreen extends StatefulWidget {
WorkListDetailScreen({Key? key}) : super(key: key); WorkListDetailScreen({Key? key}) : super(key: key);
@ -70,27 +70,30 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
List<GetStampMsNotificationBodyList> getStampMsNotifications = []; List<GetStampMsNotificationBodyList> getStampMsNotifications = [];
List<GetStampNsNotificationBodyList> getStampNsNotifications = []; List<GetStampNsNotificationBodyList> getStampNsNotifications = [];
List<GetMoNotificationBodyList> getMoNotificationBodyList = []; List<GetMoNotificationBodyList> getMoNotificationBodyList = [];
List<NotificationGetRespondAttributesList> getNotificationRespondAttributes = []; List<NotificationGetRespondAttributesList> getNotificationRespondAttributes =
[];
NotificationGetRespondAttributesList? notificationNoteInput; NotificationGetRespondAttributesList? notificationNoteInput;
List<GetRFCEmployeeList> getRFCEmployeeList = []; List<GetRFCEmployeeList> getRFCEmployeeList = [];
//HR Details Screen Requests //HR Details Screen Requests
List<GetEitCollectionNotificationBodyList>? getEitCollectionNotificationBodyList = []; List<GetEitCollectionNotificationBodyList>?
getEitCollectionNotificationBodyList = [];
List<GetPhonesNotificationBodyList>? getPhonesNotificationBodyList = []; List<GetPhonesNotificationBodyList>? getPhonesNotificationBodyList = [];
List<GetBasicDetNtfBodyList>? getBasicDetNtfBodyList = []; List<GetBasicDetNtfBodyList>? getBasicDetNtfBodyList = [];
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotificationBodyList = []; List<GetAbsenceCollectionNotificationBodyList>?
getAbsenceCollectionNotificationBodyList = [];
GetContactNotificationBodyList? getContactNotificationBodyList; GetContactNotificationBodyList? getContactNotificationBodyList;
List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = []; List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = [];
List<TerminationNotificationBody>? getTerminationNotificationBodyList = []; List<TerminationNotificationBody>? getTerminationNotificationBodyList = [];
GenericResponseModel? getBasicNTFBody; GenericResponseModel? getBasicNTFBody;
GenericResponseModel? getICBody; GenericResponseModel? getICBody;
GenericResponseModel? subordinatesLeavesModel; GenericResponseModel? subordinatesLeavesModel;
GetPoNotificationBodyList? getPoNotificationBody; GetPoNotificationBodyList? getPoNotificationBody;
GetPrNotificationBodyList? getPrNotificationBody; GetPrNotificationBodyList? getPrNotificationBody;
GetItemCreationNtfBodyList? getItemCreationNtfBody; GetItemCreationNtfBodyList? getItemCreationNtfBody;
GetPaymentNotificationBodyList? getPaymentNotificationBodyList;
bool isCloseAvailable = false; bool isCloseAvailable = false;
bool isApproveAvailable = false; bool isApproveAvailable = false;
@ -129,8 +132,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getAbsenceCollectionNotificationBodyList!.clear(); getAbsenceCollectionNotificationBodyList!.clear();
getContactNotificationBodyList = null; getContactNotificationBodyList = null;
getAddressNotificationBodyList!.clear(); getAddressNotificationBodyList!.clear();
getPaymentNotificationBodyList = null;
if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { if (workListData!.iTEMTYPE == "HRSSA" ||
workListData!.iTEMTYPE == "STAMP") {
getUserInformation(); getUserInformation();
} }
@ -152,7 +156,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getContactNotificationBody(); getContactNotificationBody();
} else if (workListData!.rEQUESTTYPE == "ADDRESS") { } else if (workListData!.rEQUESTTYPE == "ADDRESS") {
getAddressNotificationBody(); getAddressNotificationBody();
} else if(workListData!.rEQUESTTYPE =='TERMINATION'){ } else if (workListData!.rEQUESTTYPE == 'TERMINATION') {
getTerminationNotificationBody(); getTerminationNotificationBody();
} }
} }
@ -171,6 +175,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (workListData!.iTEMTYPE == "REQAPPRV") { if (workListData!.iTEMTYPE == "REQAPPRV") {
getPRNotification(); getPRNotification();
} }
if (workListData!.iTEMTYPE == "PAY_REQ") {
getPaymentNotification();
}
if (controller.hasClients) { if (controller.hasClients) {
controller.jumpToPage(0); controller.jumpToPage(0);
@ -184,7 +191,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void getDataFromState() { void getDataFromState() {
if (workListData == null) { if (workListData == null) {
workListData = AppState().workList![AppState().workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; workListData = AppState().workList![AppState()
.workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
getData(); getData();
} }
} }
@ -217,7 +225,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
Column( Column(
children: [ children: [
Container( Container(
padding: const EdgeInsets.only(left: 21, right: 21, top: 16, bottom: 16), padding: const EdgeInsets.only(
left: 21, right: 21, top: 16, bottom: 16),
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(25), bottomLeft: Radius.circular(25),
@ -236,13 +245,19 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
child: Row( child: Row(
children: [ children: [
myTab(LocaleKeys.info.tr(), 0), myTab(LocaleKeys.info.tr(), 0),
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") ? myTab(LocaleKeys.details.tr(), 1) : myTab(LocaleKeys.request.tr(), 1), (workListData!.iTEMTYPE == "HRSSA" ||
workListData!.iTEMTYPE == "STAMP")
? myTab(LocaleKeys.details.tr(), 1)
: myTab(LocaleKeys.request.tr(), 1),
myTab(LocaleKeys.actions.tr(), 2), myTab(LocaleKeys.actions.tr(), 2),
myTab(LocaleKeys.attachments.tr(), 3), myTab(LocaleKeys.attachments.tr(), 3),
], ],
), ),
), ),
if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21), if ((workListData?.sUBJECT ?? "").isNotEmpty)
workListData!.sUBJECT!
.toText14()
.paddingOnly(top: 20, right: 21, left: 21),
PageView( PageView(
controller: controller, controller: controller,
onPageChanged: (int pageIndex) { onPageChanged: (int pageIndex) {
@ -254,25 +269,38 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
InfoFragment( InfoFragment(
poHeaderList: getPoNotificationBody?.pOHeader ?? [], poHeaderList: getPoNotificationBody?.pOHeader ?? [],
workListData: workListData, workListData: workListData,
itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [], itemCreationHeader:
getItemCreationNtfBody?.itemCreationHeader ?? [],
getStampMsNotifications: getStampMsNotifications, getStampMsNotifications: getStampMsNotifications,
getStampNsNotifications: getStampNsNotifications, getStampNsNotifications: getStampNsNotifications,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, getEitCollectionNotificationBodyList:
getPhonesNotificationBodyList: getPhonesNotificationBodyList, getEitCollectionNotificationBodyList,
getPhonesNotificationBodyList:
getPhonesNotificationBodyList,
getBasicDetNtfBodyList: getBasicDetNtfBodyList, getBasicDetNtfBodyList: getBasicDetNtfBodyList,
getAddressNotificationBodyList: getAddressNotificationBodyList, getAddressNotificationBodyList:
getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList, getAddressNotificationBodyList,
getContactNotificationBodyList: getContactNotificationBodyList, getAbsenceCollectionNotificationBodyList:
getAbsenceCollectionNotificationBodyList,
getContactNotificationBodyList:
getContactNotificationBodyList,
getPrNotificationBodyList: getPrNotificationBody, getPrNotificationBodyList: getPrNotificationBody,
getTerminationNotificationBodyList:getTerminationNotificationBodyList getTerminationNotificationBodyList:
getTerminationNotificationBodyList,
getPaymentNotificationBodyList:
getPaymentNotificationBodyList,
), ),
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") (workListData!.iTEMTYPE == "HRSSA" ||
? DetailFragment(workListData, memberInformationListModel) workListData!.iTEMTYPE == "STAMP" || workListData!.iTEMTYPE == "PAY_REQ")
? DetailFragment(
workListData, memberInformationListModel)
: RequestFragment( : RequestFragment(
moNotificationBodyList: getMoNotificationBodyList, moNotificationBodyList: getMoNotificationBodyList,
poLinesList: getPoNotificationBody?.pOLines ?? [], poLinesList: getPoNotificationBody?.pOLines ?? [],
itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [], itemCreationLines:
getItemCreationNtfBody?.itemCreationLines ?? [],
prLinesList: getPrNotificationBody?.pRLines ?? [], prLinesList: getPrNotificationBody?.pRLines ?? [],
), ),
isActionHistoryLoaded isActionHistoryLoaded
? actionHistoryList.isEmpty ? actionHistoryList.isEmpty
@ -292,11 +320,13 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
).expanded, ).expanded,
if (isApproveAvailable || isRejectAvailable || isCloseAvailable) if (isApproveAvailable || isRejectAvailable || isCloseAvailable)
Container( Container(
padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21), padding: const EdgeInsets.only(
top: 14, bottom: 14, left: 21, right: 21),
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border( border: Border(
top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0), top: BorderSide(
color: MyColors.lightGreyEFColor, width: 1.0),
), ),
), ),
child: Row( child: Row(
@ -305,20 +335,29 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
DefaultButton( DefaultButton(
LocaleKeys.reject.tr(), LocaleKeys.reject.tr(),
() => performAction(rejectAction), () => performAction(rejectAction),
colors: const [Color(0xffE47A7E), Color(0xffDE6D71)], colors: const [
Color(0xffE47A7E),
Color(0xffDE6D71)
],
).expanded, ).expanded,
if (isApproveAvailable && isRejectAvailable) 8.width, if (isApproveAvailable && isRejectAvailable) 8.width,
if (isApproveAvailable) if (isApproveAvailable)
DefaultButton( DefaultButton(
LocaleKeys.approve.tr(), LocaleKeys.approve.tr(),
() => performAction(approveAction), () => performAction(approveAction),
colors: const [Color(0xff28C884), Color(0xff1BB271)], colors: const [
Color(0xff28C884),
Color(0xff1BB271)
],
).expanded, ).expanded,
if (isCloseAvailable) if (isCloseAvailable)
DefaultButton( DefaultButton(
LocaleKeys.ok.tr(), LocaleKeys.ok.tr(),
() => performAction("CLOSE"), () => performAction("CLOSE"),
colors: const [Color(0xff32D892), Color(0xff1AB170)], colors: const [
Color(0xff32D892),
Color(0xff1AB170)
],
).expanded, ).expanded,
8.width, 8.width,
Container( Container(
@ -328,7 +367,11 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
shape: BoxShape.circle, shape: BoxShape.circle,
color: MyColors.lightGreyE6Color, color: MyColors.lightGreyE6Color,
), ),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), child: Icon(
showFabOptions
? Icons.more_vert_rounded
: Icons.more_horiz_rounded,
color: MyColors.darkIconColor),
).onPress(() { ).onPress(() {
setState(() { setState(() {
showFabOptions = true; showFabOptions = true;
@ -345,7 +388,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
opacity: showFabOptions ? 1 : 0, opacity: showFabOptions ? 1 : 0,
duration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
child: Container( child: Container(
padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75 - 12), padding: const EdgeInsets.only(
left: 21, right: 21, bottom: 75 - 12),
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
color: Colors.white.withOpacity(.67), color: Colors.white.withOpacity(.67),
@ -354,15 +398,19 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() { myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg")
if (AppState().workList!.length - 1 > AppState().workListIndex!) { .onPress(() {
if (AppState().workList!.length - 1 >
AppState().workListIndex!) {
animationIndex = animationIndex + 1; animationIndex = animationIndex + 1;
AppState().setWorkListIndex = AppState().workListIndex! + 1; AppState().setWorkListIndex =
AppState().workListIndex! + 1;
workListData = null; workListData = null;
showFabOptions = false; showFabOptions = false;
tabIndex = 0; tabIndex = 0;
getDataFromState(); getDataFromState();
} else if (AppState().workList!.length - 1 == AppState().workListIndex!) { } else if (AppState().workList!.length - 1 ==
AppState().workListIndex!) {
Navigator.pop(context); Navigator.pop(context);
} }
}), }),
@ -380,25 +428,31 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
], ],
), ),
), ),
floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable) floatingActionButton:
? Container( (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable)
height: 43, ? Container(
width: 43, height: 43,
decoration: const BoxDecoration( width: 43,
shape: BoxShape.circle, decoration: const BoxDecoration(
color: MyColors.lightGreyE6Color, shape: BoxShape.circle,
), color: MyColors.lightGreyE6Color,
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), ),
).onPress(() { child: Icon(
setState(() { showFabOptions
showFabOptions = true; ? Icons.more_vert_rounded
}); : Icons.more_horiz_rounded,
}) color: MyColors.darkIconColor),
: null, ).onPress(() {
setState(() {
showFabOptions = true;
});
})
: null,
); );
} }
List<Widget> viewApiButtonsList(List<GetNotificationButtonsList> notificationButtonsList) { List<Widget> viewApiButtonsList(
List<GetNotificationButtonsList> notificationButtonsList) {
List<Widget> fabs = []; List<Widget> fabs = [];
for (int i = 0; i < notificationButtonsList.length; i++) { for (int i = 0; i < notificationButtonsList.length; i++) {
if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" ||
@ -412,7 +466,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
notificationButtonsList[i].bUTTONLABEL!, notificationButtonsList[i].bUTTONLABEL!,
getActionImage(notificationButtonsList[i].bUTTONACTION!), getActionImage(notificationButtonsList[i].bUTTONACTION!),
isIconAsset: true, isIconAsset: true,
).paddingOnly(bottom: 12).onPress(() => handleFabAction(notificationButtonsList[i]))); )
.paddingOnly(bottom: 12)
.onPress(() => handleFabAction(notificationButtonsList[i])));
} }
return fabs; return fabs;
} }
@ -491,7 +547,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
)); ));
break; break;
case "ANSWER_INFO": case "ANSWER_INFO":
performAction(notificationButton.bUTTONACTION!, title: notificationButton.bUTTONLABEL); performAction(notificationButton.bUTTONACTION!,
title: notificationButton.bUTTONLABEL);
break; break;
case "RFC": case "RFC":
getRFCEmployeeListFunc(); getRFCEmployeeListFunc();
@ -511,20 +568,31 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
callBackFunc: reloadWorkList, callBackFunc: reloadWorkList,
child: UpdateContinueSheet( child: UpdateContinueSheet(
workListData: workListData, workListData: workListData,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, getEitCollectionNotificationBodyList:
dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, getEitCollectionNotificationBodyList,
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), dynamicParams: DynamicListViewParams(
workListData!.sUBJECT!, workListData!.fUNCTIONNAME!,
isUpdate: true,
collectionNotificationList:
getEitCollectionNotificationBodyList![0]
.collectionNotification)),
); );
break; break;
case "CONTINUE_ACTION": case "CONTINUE_ACTION":
showMyBottomSheet( showMyBottomSheet(
context, context,
type:"CONTINUE_ACTION",
callBackFunc: reloadWorkList, callBackFunc: reloadWorkList,
child: UpdateContinueSheet( child: UpdateContinueSheet(
workListData: workListData, workListData: workListData,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, getEitCollectionNotificationBodyList:
dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, getEitCollectionNotificationBodyList,
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), dynamicParams: DynamicListViewParams(
workListData!.sUBJECT!, workListData!.fUNCTIONNAME!,
isUpdate: true,
collectionNotificationList:
getEitCollectionNotificationBodyList![0]
.collectionNotification)),
); );
break; break;
case "APPROVE_AND_FORWARD": case "APPROVE_AND_FORWARD":
@ -536,7 +604,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
notificationID: workListData!.nOTIFICATIONID, notificationID: workListData!.nOTIFICATIONID,
actionHistoryList: actionHistoryList, actionHistoryList: actionHistoryList,
callBackFunc: reloadWorkList, callBackFunc: reloadWorkList,
getNotificationRespondAttributes: getNotificationRespondAttributes, getNotificationRespondAttributes:
getNotificationRespondAttributes,
)); ));
break; break;
case "FORWARD": case "FORWARD":
@ -548,7 +617,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
notificationID: workListData!.nOTIFICATIONID, notificationID: workListData!.nOTIFICATIONID,
actionHistoryList: actionHistoryList, actionHistoryList: actionHistoryList,
callBackFunc: reloadWorkList, callBackFunc: reloadWorkList,
getNotificationRespondAttributes: getNotificationRespondAttributes, getNotificationRespondAttributes:
getNotificationRespondAttributes,
)); ));
break; break;
case "DEL": case "DEL":
@ -569,7 +639,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void getRFCEmployeeListFunc() async { void getRFCEmployeeListFunc() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getRFCEmployeeList = await WorkListApiClient().getRFCEmployeeeList(workListData!.nOTIFICATIONID!); getRFCEmployeeList = await WorkListApiClient()
.getRFCEmployeeeList(workListData!.nOTIFICATIONID!);
Utils.hideLoading(context); Utils.hideLoading(context);
actionHistoryList.last.sEQUENCE = getRFCEmployeeList[0].sEQ; actionHistoryList.last.sEQUENCE = getRFCEmployeeList[0].sEQ;
showMyBottomSheet(context, showMyBottomSheet(context,
@ -589,7 +660,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
} }
} }
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async { Future<void> performNetworkCall(BuildContext context,
{String? email, String? userId}) async {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext cxt) => ConfirmDialog( builder: (BuildContext cxt) => ConfirmDialog(
@ -599,7 +671,12 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
Navigator.pop(cxt); Navigator.pop(cxt);
Utils.showLoading(context); Utils.showLoading(context);
try { try {
await WorkListApiClient().submitComment(comment: "", email: email, userId: userId, notificationId: workListData!.nOTIFICATIONID, apiMode: "REJECT"); await WorkListApiClient().submitComment(
comment: "",
email: email,
userId: userId,
notificationId: workListData!.nOTIFICATIONID,
apiMode: "REJECT");
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");
} catch (ex) { } catch (ex) {
@ -617,7 +694,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
title.toText12(color: isSelected ? Colors.white : Colors.white.withOpacity(.74), isCenter: true), title.toText12(
color: isSelected ? Colors.white : Colors.white.withOpacity(.74),
isCenter: true),
4.height, 4.height,
Container( Container(
height: 8, height: 8,
@ -680,14 +759,17 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
notificationGetRespond: notificationNoteInput, notificationGetRespond: notificationNoteInput,
actionMode: actionMode, actionMode: actionMode,
onTap: (String note) { onTap: (String note) {
List<Map<String, dynamic>> responseAttribute = []; List<Map<String, dynamic>> responseAttribute = [];
for (var element in getNotificationRespondAttributes!) { for (var element in getNotificationRespondAttributes!) {
responseAttribute.add({ responseAttribute.add({
"ATTRIBUTE_NAME": element!.attributeName, "ATTRIBUTE_NAME": element!.attributeName,
if (element!.attributeType == "number") "ATTRIBUTE_NUMBER_VALUE": note else if (element!.attributeType == "VARCHAR2") "ATTRIBUTE_TEXT_VALUE": note if (element!.attributeType == "number")
}); "ATTRIBUTE_NUMBER_VALUE": note
} else if (element!.attributeType == "VARCHAR2")
"ATTRIBUTE_TEXT_VALUE": note
});
}
Map<String, dynamic> payload = { Map<String, dynamic> payload = {
"P_ACTION_MODE": actionMode, "P_ACTION_MODE": actionMode,
@ -695,11 +777,16 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
"P_COMMENTS": note, "P_COMMENTS": note,
"P_FORWARD_TO_USER_NAME": "", "P_FORWARD_TO_USER_NAME": "",
"P_NOTIFICATION_ID": workListData!.nOTIFICATIONID, "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID,
"RespondAttributeList":responseAttribute, "RespondAttributeList": responseAttribute,
}; };
if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE" || actionMode == "ANSWER_INFO" || actionMode == "RFC" || actionMode == "TRY_APPROVE_AGAIN" || actionMode == "SEND_BACK_TO_PREPARER") { if (actionMode == "APPROVED" ||
actionMode == "APPROVE" ||
actionMode == "CLOSE" ||
actionMode == "ANSWER_INFO" ||
actionMode == "RFC") {
performNotificationAction(payload); performNotificationAction(payload);
} else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) { } else if (note.isNotEmpty &&
(actionMode != "APPROVED" || actionMode != "APPROVE")) {
performNotificationAction(payload); performNotificationAction(payload);
} else { } else {
Utils.showToast(LocaleKeys.pleaseEnterComments.tr()); Utils.showToast(LocaleKeys.pleaseEnterComments.tr());
@ -712,7 +799,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void performNotificationAction(Map<String, dynamic> payload) async { void performNotificationAction(Map<String, dynamic> payload) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload); GenericResponseModel model =
await WorkListApiClient().postNotificationActions(payload);
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
animationIndex = animationIndex + 1; animationIndex = animationIndex + 1;
@ -753,7 +841,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getEitCollectionNotificationBodyList!.clear(); getEitCollectionNotificationBodyList!.clear();
getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); getEitCollectionNotificationBodyList = await WorkListApiClient()
.GetEitNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -771,7 +860,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
memberInformationListModel = null; memberInformationListModel = null;
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); memberInformationListModel = await WorkListApiClient()
.getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -789,7 +879,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getPhonesNotificationBodyList!.clear(); getPhonesNotificationBodyList!.clear();
getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID); getPhonesNotificationBodyList = await WorkListApiClient()
.getPhonesNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -807,7 +898,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getBasicDetNtfBodyList!.clear(); getBasicDetNtfBodyList!.clear();
getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID); getBasicDetNtfBodyList = await WorkListApiClient()
.getBasicDetNtfBodyList(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -825,7 +917,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getAbsenceCollectionNotificationBodyList!.clear(); getAbsenceCollectionNotificationBodyList!.clear();
getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID); getAbsenceCollectionNotificationBodyList = await WorkListApiClient()
.getAbsenceNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -842,7 +935,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getContactNotificationBodyList = await WorkListApiClient().getContactNotificationBodyList(workListData!.nOTIFICATIONID); getContactNotificationBodyList = await WorkListApiClient()
.getContactNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -859,7 +953,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getAddressNotificationBodyList = await WorkListApiClient().getAddressNotificationBodyList(workListData!.nOTIFICATIONID); getAddressNotificationBodyList = await WorkListApiClient()
.getAddressNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -871,15 +966,15 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
} }
} }
void getTerminationNotificationBody() async { void getTerminationNotificationBody() async {
try { try {
if (apiCallCount == 0) if (apiCallCount == 0) apiCallCount++;
apiCallCount++; getTerminationNotificationBodyList = await WorkListApiClient()
getTerminationNotificationBodyList = await WorkListApiClient().getTerminationNotificationBodyList(workListData!.nOTIFICATIONID); .getTerminationNotificationBodyList(workListData!.nOTIFICATIONID);
Utils.hideLoading(context); Utils.hideLoading(context);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
setState(() {}); setState(() {});
} }
} catch (ex) { } catch (ex) {
@ -889,16 +984,16 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
} }
} }
void getStampNotificationBody() async { void getStampNotificationBody() async {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
if (workListData!.rEQUESTTYPE == "STAMP_MS") { if (workListData!.rEQUESTTYPE == "STAMP_MS") {
getStampMsNotifications = await WorkListApiClient().getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999); getStampMsNotifications = await WorkListApiClient()
.getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999);
} else { } else {
getStampNsNotifications = await WorkListApiClient().getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999); getStampNsNotifications = await WorkListApiClient()
.getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999);
} }
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -916,7 +1011,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getMoNotificationBodyList = await WorkListApiClient().getMoNotificationBody(workListData!.nOTIFICATIONID!, -999); getMoNotificationBodyList = await WorkListApiClient()
.getMoNotificationBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -933,7 +1029,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getItemCreationNtfBody = await WorkListApiClient().getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999); getItemCreationNtfBody = await WorkListApiClient()
.getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -950,7 +1047,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getPoNotificationBody = await WorkListApiClient().getPoNotificationBody(workListData!.nOTIFICATIONID!, -999); getPoNotificationBody = await WorkListApiClient()
.getPoNotificationBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -967,7 +1065,26 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getPrNotificationBody = await WorkListApiClient().getPRNotificationBody(workListData!.nOTIFICATIONID!, -999); getPrNotificationBody = await WorkListApiClient()
.getPRNotificationBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
setState(() {});
}
} catch (ex) {
apiCallCount--;
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void getPaymentNotification() async {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getPaymentNotificationBodyList = await WorkListApiClient()
.getPaymentNotificationBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
Utils.hideLoading(context); Utils.hideLoading(context);
@ -985,7 +1102,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getNotificationRespondAttributes.clear(); getNotificationRespondAttributes.clear();
getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); getNotificationRespondAttributes = await WorkListApiClient()
.notificationGetRespondAttributes(workListData!.nOTIFICATIONID!);
if (getNotificationRespondAttributes.isNotEmpty) { if (getNotificationRespondAttributes.isNotEmpty) {
notificationNoteInput = getNotificationRespondAttributes.first; notificationNoteInput = getNotificationRespondAttributes.first;
} }
@ -1006,18 +1124,25 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
notificationButtonsList.clear(); notificationButtonsList.clear();
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!); notificationButtonsList = await WorkListApiClient()
.getNotificationButtons(workListData!.nOTIFICATIONID!);
if (notificationButtonsList.isNotEmpty) { if (notificationButtonsList.isNotEmpty) {
isCloseAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "CLOSE"); isCloseAvailable = notificationButtonsList.any(
isApproveAvailable = notificationButtonsList.any((GetNotificationButtonsList element) { (GetNotificationButtonsList element) =>
if (element.bUTTONACTION == "APPROVED" || element.bUTTONACTION == "APPROVE") { element.bUTTONACTION == "CLOSE");
isApproveAvailable =
notificationButtonsList.any((GetNotificationButtonsList element) {
if (element.bUTTONACTION == "APPROVED" ||
element.bUTTONACTION == "APPROVE") {
approveAction = element.bUTTONACTION!; approveAction = element.bUTTONACTION!;
return true; return true;
} }
return false; return false;
}); });
isRejectAvailable = notificationButtonsList.any((GetNotificationButtonsList element) { isRejectAvailable =
if (element.bUTTONACTION == "REJECTED" || element.bUTTONACTION == "REJECT") { notificationButtonsList.any((GetNotificationButtonsList element) {
if (element.bUTTONACTION == "REJECTED" ||
element.bUTTONACTION == "REJECT") {
rejectAction = element.bUTTONACTION!; rejectAction = element.bUTTONACTION!;
return true; return true;
} }
@ -1040,7 +1165,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
isActionHistoryLoaded = false; isActionHistoryLoaded = false;
actionHistoryList.clear(); actionHistoryList.clear();
actionHistoryList = await WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!); actionHistoryList = await WorkListApiClient()
.getActionHistory(workListData!.nOTIFICATIONID!);
setState(() { setState(() {
isActionHistoryLoaded = true; isActionHistoryLoaded = true;
}); });
@ -1053,7 +1179,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
isAttachmentLoaded = false; isAttachmentLoaded = false;
getAttachmentList.clear(); getAttachmentList.clear();
getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); getAttachmentList = await WorkListApiClient()
.getAttachments(workListData!.nOTIFICATIONID!);
setState(() { setState(() {
isAttachmentLoaded = true; isAttachmentLoaded = true;
}); });

@ -167,7 +167,7 @@ class ActionsFragment extends StatelessWidget {
Duration duration = DateTime.now().difference(dateTimeFrom); Duration duration = DateTime.now().difference(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration); return "Action duration: " + DateUtil.formatDuration(duration);
} else { } else {
if (actionHistoryList[index + 1].nOTIFICATIONDATE!.isEmpty) { if (actionHistoryList[index].nOTIFICATIONDATE!.isEmpty) {
return ""; return "";
} else { } else {
DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!); DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!);

@ -19,8 +19,8 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_bo
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart';
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart'; import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart';
import 'package:mohem_flutter_app/models/worklist/payment_details_list.dart';
class InfoFragment extends StatelessWidget { class InfoFragment extends StatelessWidget {
WorkListResponseModel? workListData; WorkListResponseModel? workListData;
@ -28,14 +28,18 @@ class InfoFragment extends StatelessWidget {
List<GetStampMsNotificationBodyList>? getStampMsNotifications; List<GetStampMsNotificationBodyList>? getStampMsNotifications;
List<GetStampNsNotificationBodyList>? getStampNsNotifications; List<GetStampNsNotificationBodyList>? getStampNsNotifications;
List<ItemCreationHeader> itemCreationHeader; List<ItemCreationHeader> itemCreationHeader;
List<GetEitCollectionNotificationBodyList>? getEitCollectionNotificationBodyList; List<GetEitCollectionNotificationBodyList>?
getEitCollectionNotificationBodyList;
List<GetPhonesNotificationBodyList>? getPhonesNotificationBodyList; List<GetPhonesNotificationBodyList>? getPhonesNotificationBodyList;
List<GetBasicDetNtfBodyList>? getBasicDetNtfBodyList; List<GetBasicDetNtfBodyList>? getBasicDetNtfBodyList;
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotificationBodyList; List<GetAbsenceCollectionNotificationBodyList>?
getAbsenceCollectionNotificationBodyList;
GetContactNotificationBodyList? getContactNotificationBodyList; GetContactNotificationBodyList? getContactNotificationBodyList;
GetPrNotificationBodyList? getPrNotificationBodyList; GetPrNotificationBodyList? getPrNotificationBodyList;
List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = []; List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = [];
List<TerminationNotificationBody>? getTerminationNotificationBodyList =[]; List<TerminationNotificationBody>? getTerminationNotificationBodyList = [];
GetPaymentNotificationBodyList? getPaymentNotificationBodyList;
InfoFragment( InfoFragment(
{this.workListData, {this.workListData,
this.poHeaderList = const <POHeader>[], this.poHeaderList = const <POHeader>[],
@ -49,15 +53,18 @@ class InfoFragment extends StatelessWidget {
this.getContactNotificationBodyList, this.getContactNotificationBodyList,
this.getPrNotificationBodyList, this.getPrNotificationBodyList,
this.getAddressNotificationBodyList, this.getAddressNotificationBodyList,
this.getTerminationNotificationBodyList this.getTerminationNotificationBodyList,
}); this.getPaymentNotificationBodyList});
double itemHeight = 0; double itemHeight = 0;
double itemWidth = 0; double itemWidth = 0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size; Size size = MediaQuery.of(context).size;
itemHeight = (size.height - kToolbarHeight - 24) / 9; itemHeight = (size.height - kToolbarHeight - 24) / 9;
itemWidth = size.width / 2; itemWidth = size.width / 2;
@ -68,36 +75,62 @@ class InfoFragment extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), ItemDetailViewCol(
LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""),
ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""),
ItemDetailViewCol(
LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.id.tr(),
ItemDetailViewCol(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), workListData!.nOTIFICATIONID?.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.subject.tr(), workListData!.sUBJECT ?? ""), ItemDetailViewCol(
LocaleKeys.subject.tr(), workListData!.sUBJECT ?? ""),
Container(), Container(),
isItLast: true, isItLast: true,
), ),
], ],
).objectContainerView(), ).objectContainerView(),
if (getPrNotificationBodyList != null) getPRNotificationBodyListWidget(getPrNotificationBodyList!), if (getPrNotificationBodyList != null)
if (getStampMsNotifications?.isNotEmpty ?? false) getStampMsNotificationsListView(getStampMsNotifications ?? []), getPRNotificationBodyListWidget(getPrNotificationBodyList!),
if (getStampNsNotifications?.isNotEmpty ?? false) getStampNsNotificationsListView(getStampNsNotifications ?? []), if (getStampMsNotifications?.isNotEmpty ?? false)
getStampMsNotificationsListView(getStampMsNotifications ?? []),
if (getStampNsNotifications?.isNotEmpty ?? false)
getStampNsNotificationsListView(getStampNsNotifications ?? []),
if (poHeaderList.isNotEmpty) getPoNotificationsListView(), if (poHeaderList.isNotEmpty) getPoNotificationsListView(),
if (itemCreationHeader.isNotEmpty) getItemCreationHeaderView(), if (itemCreationHeader.isNotEmpty) getItemCreationHeaderView(),
if (getEitCollectionNotificationBodyList?.isNotEmpty ?? false) getEitNotificationsListView(getEitCollectionNotificationBodyList ?? []), if (getEitCollectionNotificationBodyList?.isNotEmpty ?? false)
if (getPhonesNotificationBodyList?.isNotEmpty ?? false) getPhonesNotificationBodyListWidget(getPhonesNotificationBodyList ?? []).objectContainerView(title: "Mobile Numbers"), getEitNotificationsListView(getEitCollectionNotificationBodyList ?? []),
if (getBasicDetNtfBodyList?.isNotEmpty ?? false) getBasicDetNtfBodyListWidget(getBasicDetNtfBodyList ?? []).objectContainerView(title: "Basic Information"), if (getPhonesNotificationBodyList?.isNotEmpty ?? false)
if (getAbsenceCollectionNotificationBodyList?.isNotEmpty ?? false) getAbsenceCollectionNotificationBodyListWidget(getAbsenceCollectionNotificationBodyList ?? []), getPhonesNotificationBodyListWidget(getPhonesNotificationBodyList ?? [])
if (getContactNotificationBodyList != null) getContactNotificationBodyListWidget(getContactNotificationBodyList ?? GetContactNotificationBodyList()).objectContainerView(), .objectContainerView(title: "Mobile Numbers"),
if (getAddressNotificationBodyList?.isNotEmpty ?? false) getAddressNotificationBodyListWidget(getAddressNotificationBodyList!), if (getBasicDetNtfBodyList?.isNotEmpty ?? false)
if (getTerminationNotificationBodyList?.isNotEmpty ?? false) getTerminationNotificationBodyListWidget(getTerminationNotificationBodyList!), getBasicDetNtfBodyListWidget(getBasicDetNtfBodyList ?? [])
.objectContainerView(title: "Basic Information"),
if (getAbsenceCollectionNotificationBodyList?.isNotEmpty ?? false)
getAbsenceCollectionNotificationBodyListWidget(
getAbsenceCollectionNotificationBodyList ?? []),
if (getContactNotificationBodyList != null)
getContactNotificationBodyListWidget(getContactNotificationBodyList ??
GetContactNotificationBodyList())
.objectContainerView(),
if (getAddressNotificationBodyList?.isNotEmpty ?? false)
getAddressNotificationBodyListWidget(getAddressNotificationBodyList!),
if (getTerminationNotificationBodyList?.isNotEmpty ?? false)
getTerminationNotificationBodyListWidget(
getTerminationNotificationBodyList!),
if (getPaymentNotificationBodyList != null)
getPaymentNotificationBodyListWidget(getPaymentNotificationBodyList ??
GetPaymentNotificationBodyList())
.objectContainerView(),
]; ];
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -115,43 +148,59 @@ class InfoFragment extends StatelessWidget {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => Column( itemBuilder: (BuildContext cxt, int index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Column( Column(
children: [ children: [
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.description.tr(), workListData!.fROMUSER ?? ""), ItemDetailViewCol(LocaleKeys.description.tr(),
ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), workListData!.fROMUSER ?? ""),
ItemDetailViewCol(
LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), LocaleKeys.to.tr(), workListData!.tOUSER ?? ""),
ItemDetailViewCol(
LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""),
ItemDetailViewCol(LocaleKeys.id.tr(),
workListData!.nOTIFICATIONID?.toString() ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.supplier.tr(), poHeaderList[index].vENDORNAME ?? ""), ItemDetailViewCol(LocaleKeys.supplier.tr(),
ItemDetailViewCol(LocaleKeys.site.tr(), poHeaderList[index].vENDORSITECODE ?? ""), poHeaderList[index].vENDORNAME ?? ""),
ItemDetailViewCol(LocaleKeys.site.tr(),
poHeaderList[index].vENDORSITECODE ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.buyer.tr(), poHeaderList[index].bUYER ?? ""), ItemDetailViewCol(LocaleKeys.buyer.tr(),
ItemDetailViewCol(LocaleKeys.preparer.tr(), poHeaderList[index].pREPARER ?? ""), poHeaderList[index].bUYER ?? ""),
ItemDetailViewCol(LocaleKeys.preparer.tr(),
poHeaderList[index].pREPARER ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.creationDate.tr(), poHeaderList[index].cREATIONDATE ?? ""), ItemDetailViewCol(LocaleKeys.creationDate.tr(),
ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), poHeaderList[index].sHIPTOLOCATIONNAME ?? ""), poHeaderList[index].cREATIONDATE ?? ""),
ItemDetailViewCol(LocaleKeys.shipToLocation.tr(),
poHeaderList[index].sHIPTOLOCATIONNAME ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), poHeaderList[index].qUOTATIONNUMBER ?? ""), ItemDetailViewCol(LocaleKeys.quotationNumber.tr(),
ItemDetailViewCol(LocaleKeys.quotationDate.tr(), poHeaderList[index].qUOTATIONDATE ?? ""), poHeaderList[index].qUOTATIONNUMBER ?? ""),
ItemDetailViewCol(LocaleKeys.quotationDate.tr(),
poHeaderList[index].qUOTATIONDATE ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.paymentTerms.tr(), poHeaderList[index].pAYMENTTERMS ?? ""), ItemDetailViewCol(LocaleKeys.paymentTerms.tr(),
ItemDetailViewCol(LocaleKeys.currency.tr(), poHeaderList[index].cURRENCYNAME ?? ""), poHeaderList[index].pAYMENTTERMS ?? ""),
ItemDetailViewCol(LocaleKeys.currency.tr(),
poHeaderList[index].cURRENCYNAME ?? ""),
isItLast: true, isItLast: true,
), ),
], ],
@ -160,19 +209,26 @@ class InfoFragment extends StatelessWidget {
Column( Column(
children: [ children: [
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.grossAmount.tr(), poHeaderList[index].gROSSAMOUNT?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.grossAmount.tr(),
ItemDetailViewCol(LocaleKeys.discountAmount.tr(), poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""), poHeaderList[index].gROSSAMOUNT?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.discountAmount.tr(),
poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.customDuty.tr(), poHeaderList[index].cUSTOMDUTY?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.customDuty.tr(),
ItemDetailViewCol(LocaleKeys.shipHandle.tr(), poHeaderList[index].sHIPHANDLE?.toString() ?? ""), poHeaderList[index].cUSTOMDUTY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.shipHandle.tr(),
poHeaderList[index].sHIPHANDLE?.toString() ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.otherCharges.tr(), poHeaderList[index].oTHERCHARGES?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.otherCharges.tr(),
ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(), poHeaderList[index].lOCCURTOTPOAMT.toString() ?? ""), poHeaderList[index].oTHERCHARGES?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(),
poHeaderList[index].lOCCURTOTPOAMT.toString() ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.totalPOAmountInWords.tr(), poHeaderList[index].tOTPOAMTWORD ?? ""), ItemDetailViewCol(LocaleKeys.totalPOAmountInWords.tr(),
poHeaderList[index].tOTPOAMTWORD ?? ""),
Container(), Container(),
isItLast: true, isItLast: true,
), ),
@ -180,7 +236,7 @@ class InfoFragment extends StatelessWidget {
).objectContainerView(title: LocaleKeys.amount_detail.tr()), ).objectContainerView(title: LocaleKeys.amount_detail.tr()),
], ],
), ),
separatorBuilder: (cxt, index) => 4.height, separatorBuilder: (BuildContext cxt, int index) => 4.height,
itemCount: poHeaderList.length); itemCount: poHeaderList.length);
} }
@ -194,67 +250,95 @@ class InfoFragment extends StatelessWidget {
// itemCount: dataList.length); // itemCount: dataList.length);
// } // }
Widget getStampMsNotificationsListView(List<GetStampMsNotificationBodyList> list) { Widget getStampMsNotificationsListView(
List<GetStampMsNotificationBodyList> list) {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => Column( itemBuilder: (BuildContext cxt, int index) => Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()), ItemDetailViewCol(LocaleKeys.employeeNumber.tr(),
ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()), list[index].eMPLOYEENUMBER.toString()),
ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(),
list[index].aSSIGNMENTNUMBER.toString()),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()), ItemDetailViewCol(LocaleKeys.employeeName.tr(),
ItemDetailViewCol(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)), list[index].eMPLOYEENAME.toString()),
ItemDetailViewCol(
LocaleKeys.scheduleDate.tr(),
DateUtil.formatDateToDate(
DateUtil.convertStringToDate(
list[index].sCHEDULEDATE.toString()),
false)),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.shiftType.tr(), list[index].sHTTYPEDESC.toString()), ItemDetailViewCol(LocaleKeys.shiftType.tr(),
ItemDetailViewCol(LocaleKeys.shift.tr(), list[index].sHTNAME.toString()), list[index].sHTTYPEDESC.toString()),
ItemDetailViewCol(
LocaleKeys.shift.tr(), list[index].sHTNAME.toString()),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.breakText.tr(), list[index].bREAKNAME.toString()), ItemDetailViewCol(LocaleKeys.breakText.tr(),
ItemDetailViewCol(LocaleKeys.actualSwipeStart.tr(), list[index].sHTACTUALSTARTTIME.toString()), list[index].bREAKNAME.toString()),
ItemDetailViewCol(LocaleKeys.actualSwipeStart.tr(),
list[index].sHTACTUALSTARTTIME.toString()),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.actualSwipeEnd.tr(), list[index].sHTACTUALENDTIME.toString()), ItemDetailViewCol(LocaleKeys.actualSwipeEnd.tr(),
ItemDetailViewCol(LocaleKeys.approvedSwipeStart.tr(), list[index].aPPROVEDSTARTTIME.toString()), list[index].sHTACTUALENDTIME.toString()),
ItemDetailViewCol(LocaleKeys.approvedSwipeStart.tr(),
list[index].aPPROVEDSTARTTIME.toString()),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvedSwipeStartReason.tr(), list[index].aPPROVEDSTARTREASON.toString()), ItemDetailViewCol(LocaleKeys.approvedSwipeStartReason.tr(),
list[index].aPPROVEDSTARTREASON.toString()),
ItemDetailViewCol(LocaleKeys.approvedSwipeEnd.tr(), ""), ItemDetailViewCol(LocaleKeys.approvedSwipeEnd.tr(), ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvedSwipeEndReason.tr(), list[index].aPPROVEDENDREASONDESC.toString()), ItemDetailViewCol(LocaleKeys.approvedSwipeEndReason.tr(),
list[index].aPPROVEDENDREASONDESC.toString()),
Container(), Container(),
isItLast: true, isItLast: true,
), ),
], ],
).objectContainerView(), ).objectContainerView(),
separatorBuilder: (cxt, index) => 1.height.paddingOnly(top: 8, bottom: 8), separatorBuilder: (BuildContext cxt, int index) =>
1.height.paddingOnly(top: 8, bottom: 8),
itemCount: list.length); itemCount: list.length);
} }
Widget getStampNsNotificationsListView(List<GetStampNsNotificationBodyList> list) { Widget getStampNsNotificationsListView(
List<GetStampNsNotificationBodyList> list) {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => Column( itemBuilder: (BuildContext cxt, int index) => Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()), ItemDetailViewCol(LocaleKeys.employeeNumber.tr(),
ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()), list[index].eMPLOYEENUMBER.toString()),
ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(),
list[index].aSSIGNMENTNUMBER.toString()),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()), ItemDetailViewCol(LocaleKeys.employeeName.tr(),
ItemDetailViewCol(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)), list[index].eMPLOYEENAME.toString()),
ItemDetailViewCol(
LocaleKeys.scheduleDate.tr(),
DateUtil.formatDateToDate(
DateUtil.convertStringToDate(
list[index].sCHEDULEDATE.toString()),
false)),
isItLast: true, isItLast: true,
), ),
], ],
).objectContainerView(), ).objectContainerView(),
separatorBuilder: (cxt, index) => 1.height.paddingOnly(top: 8, bottom: 8), separatorBuilder: (BuildContext cxt, int index) =>
1.height.paddingOnly(top: 8, bottom: 8),
itemCount: list.length); itemCount: list.length);
} }
@ -262,43 +346,65 @@ class InfoFragment extends StatelessWidget {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => Column( itemBuilder: (BuildContext cxt, int index) => Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), itemCreationHeader[index].oPERATINGUNIT?.toString() ?? ""), ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.category.tr(), itemCreationHeader[index].cATEGORY?.toString() ?? ""), LocaleKeys.operatingUnit.tr(),
itemCreationHeader[index].oPERATINGUNIT?.toString() ??
""),
ItemDetailViewCol(LocaleKeys.category.tr(),
itemCreationHeader[index].cATEGORY?.toString() ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requester.tr(), itemCreationHeader[index].rEQUESTER?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.requester.tr(),
ItemDetailViewCol(LocaleKeys.analyzedBy.tr(), itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""), itemCreationHeader[index].rEQUESTER?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.analyzedBy.tr(),
itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvedDate.tr(), itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.approvedDate.tr(),
ItemDetailViewCol(LocaleKeys.itemType.tr(), itemCreationHeader[index].iTEMTYPE?.toString() ?? ""), itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.itemType.tr(),
itemCreationHeader[index].iTEMTYPE?.toString() ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.relatedTo.tr(), itemCreationHeader[index].rELATEDTO?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.relatedTo.tr(),
ItemDetailViewCol(LocaleKeys.requestDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(itemCreationHeader[index].rEQUESTDATE.toString()), false)), itemCreationHeader[index].rELATEDTO?.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.requestDate.tr(),
DateUtil.formatDateToDate(
DateUtil.convertStringToDate(
itemCreationHeader[index].rEQUESTDATE.toString()),
false)),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.analyzedDate.tr(), itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.analyzedDate.tr(),
ItemDetailViewCol(LocaleKeys.urgent.tr(), itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? ""), itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.urgent.tr(),
itemCreationHeader[index].uRGENTFLAGDISP?.toString() ??
""),
), ),
], ],
).objectContainerView(), ).objectContainerView(),
separatorBuilder: (cxt, index) => 18.height, separatorBuilder: (BuildContext cxt, int index) => 18.height,
itemCount: itemCreationHeader.length); itemCount: itemCreationHeader.length);
} }
//HR multiple type requests //HR multiple type requests
Widget getEitNotificationsListView(List<GetEitCollectionNotificationBodyList> list) { Widget getEitNotificationsListView(
List<GetEitCollectionNotificationBodyList> list) {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) { itemBuilder: (BuildContext cxt, int index) {
List<CollectionNotificationEit> dataList = list.isEmpty ? [] : (list[index].collectionNotification ?? []); List<CollectionNotificationEit> dataList =
dataList = dataList.where((o) => o.displayFlag == "Y").toList(); list.isEmpty ? [] : (list[index].collectionNotification ?? []);
dataList = dataList
.where((CollectionNotificationEit o) => o.displayFlag == "Y")
.toList();
bool isOdd = false; bool isOdd = false;
if (dataList.length % 2 != 0) { if (dataList.length % 2 != 0) {
isOdd = true; isOdd = true;
@ -308,7 +414,8 @@ class InfoFragment extends StatelessWidget {
itemCount: dataList.length, itemCount: dataList.length,
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem( itemBuilder: (BuildContext context, int index) =>
ItemDetailViewGridItem(
index, index,
dataList[index].segmentPrompt, dataList[index].segmentPrompt,
dataList[index].segmentValueDsp, dataList[index].segmentValueDsp,
@ -324,12 +431,13 @@ class InfoFragment extends StatelessWidget {
), ),
).objectContainerView(); ).objectContainerView();
}, },
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (BuildContext cxt, int index) => 12.height,
itemCount: list.length, itemCount: list.length,
); );
} }
Widget getPhonesNotificationBodyListWidget(List<GetPhonesNotificationBodyList> list) { Widget getPhonesNotificationBodyListWidget(
List<GetPhonesNotificationBodyList> list) {
bool isOdd = false; bool isOdd = false;
if (list.length % 2 != 0) { if (list.length % 2 != 0) {
isOdd = true; isOdd = true;
@ -339,7 +447,7 @@ class InfoFragment extends StatelessWidget {
itemCount: list.length, itemCount: list.length,
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem( itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem(
index, index,
LocaleKeys.subject.tr(), LocaleKeys.subject.tr(),
list[index].proposedPhoneNumber ?? "", list[index].proposedPhoneNumber ?? "",
@ -359,8 +467,9 @@ class InfoFragment extends StatelessWidget {
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailViewCol(LocaleKeys.subject.tr(), list[index].proposedPhoneNumber ?? ""), itemBuilder: (BuildContext cxt, int index) => ItemDetailViewCol(
separatorBuilder: (cxt, index) => 4.height, LocaleKeys.subject.tr(), list[index].proposedPhoneNumber ?? ""),
separatorBuilder: (BuildContext cxt, int index) => 4.height,
itemCount: list.length), itemCount: list.length),
); );
} }
@ -375,7 +484,7 @@ class InfoFragment extends StatelessWidget {
itemCount: list.length, itemCount: list.length,
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem( itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem(
index, index,
list[index].segmentPrompt, list[index].segmentPrompt,
list[index].segmentValueDsp, list[index].segmentValueDsp,
@ -395,19 +504,24 @@ class InfoFragment extends StatelessWidget {
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailViewCol(list[index].segmentPrompt!, list[index].segmentValueDsp!), itemBuilder: (BuildContext cxt, int index) => ItemDetailViewCol(
separatorBuilder: (cxt, index) => 4.height, list[index].segmentPrompt!, list[index].segmentValueDsp!),
separatorBuilder: (BuildContext cxt, int index) => 4.height,
itemCount: list.length), itemCount: list.length),
); );
} }
Widget getAbsenceCollectionNotificationBodyListWidget(List<GetAbsenceCollectionNotificationBodyList> list) { Widget getAbsenceCollectionNotificationBodyListWidget(
List<GetAbsenceCollectionNotificationBodyList> list) {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) { itemBuilder: (BuildContext cxt, int index) {
List<CollectionNotificationAbsence> dataList = list.isEmpty ? [] : (list[index].collectionNotification ?? []); List<CollectionNotificationAbsence> dataList =
dataList = dataList.where((o) => o.dISPLAYFLAG == "Y").toList(); list.isEmpty ? [] : (list[index].collectionNotification ?? []);
dataList = dataList
.where((CollectionNotificationAbsence o) => o.dISPLAYFLAG == "Y")
.toList();
bool isOdd = false; bool isOdd = false;
if (dataList.length % 2 != 0) { if (dataList.length % 2 != 0) {
isOdd = true; isOdd = true;
@ -418,7 +532,8 @@ class InfoFragment extends StatelessWidget {
itemCount: dataList.length, itemCount: dataList.length,
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem( itemBuilder: (BuildContext context, int index) =>
ItemDetailViewGridItem(
index, index,
dataList[index].sEGMENTPROMPT, dataList[index].sEGMENTPROMPT,
dataList[index].sEGMENTVALUEDSP, dataList[index].sEGMENTVALUEDSP,
@ -436,34 +551,50 @@ class InfoFragment extends StatelessWidget {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? ItemDetailViewCol(dataList[index].sEGMENTPROMPT!, dataList[index].sEGMENTVALUEDSP!) : Container(), itemBuilder: (BuildContext cxt, int index) =>
separatorBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? 4.height : 0.height, dataList[index].dISPLAYFLAG == "Y"
? ItemDetailViewCol(dataList[index].sEGMENTPROMPT!,
dataList[index].sEGMENTVALUEDSP!)
: Container(),
separatorBuilder: (BuildContext cxt, int index) =>
dataList[index].dISPLAYFLAG == "Y" ? 4.height : 0.height,
itemCount: dataList.length) itemCount: dataList.length)
.objectContainerView(); .objectContainerView();
}, },
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (BuildContext cxt, int index) => 12.height,
itemCount: list.length, itemCount: list.length,
); );
} }
Widget getPRNotificationBodyListWidget(GetPrNotificationBodyList getPrNotificationBodyList) { Widget getPRNotificationBodyListWidget(
GetPrNotificationBodyList getPrNotificationBodyList) {
return Column( return Column(
children: [ children: [
getPrNotificationBodyList.pINFORMATION != null ? getPrNotificationBodyList.pINFORMATION.toString().toText14(color: MyColors.textMixColor).objectContainerView() : Container(), getPrNotificationBodyList.pINFORMATION != null
? getPrNotificationBodyList.pINFORMATION
.toString()
.toText14(color: MyColors.textMixColor)
.objectContainerView()
: Container(),
12.height, 12.height,
Column( Column(
children: [ children: [
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), ItemDetailViewCol(
LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""),
ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""),
ItemDetailViewCol(
LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.id.tr(),
ItemDetailViewCol(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), workListData!.nOTIFICATIONID?.toString() ?? ""),
ItemDetailViewCol(
LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""),
), ),
Column( Column(
children: getPRHeaderValues(), children: getPRHeaderValues(),
@ -474,12 +605,14 @@ class InfoFragment extends StatelessWidget {
); );
} }
Widget getAddressNotificationBodyListWidget(List<GetAddressNotificationBodyList> getAddressNotificationBodyList) { Widget getAddressNotificationBodyListWidget(
List<GetAddressNotificationBodyList> getAddressNotificationBodyList) {
bool isOdd = false; bool isOdd = false;
try { try {
if (getAddressNotificationBodyList.length % 2 != 0) { if (getAddressNotificationBodyList.length % 2 != 0) {
isOdd = true; isOdd = true;
getAddressNotificationBodyList.add(GetAddressNotificationBodyList(sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--")); getAddressNotificationBodyList.add(GetAddressNotificationBodyList(
sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--"));
} }
} catch (e) {} } catch (e) {}
@ -487,15 +620,16 @@ class InfoFragment extends StatelessWidget {
itemCount: getAddressNotificationBodyList!.length, itemCount: getAddressNotificationBodyList!.length,
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem( itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem(
index, index,
getAddressNotificationBodyList[index].sEGMENTPROMPT, getAddressNotificationBodyList[index].sEGMENTPROMPT,
getAddressNotificationBodyList[index].sEGMENTVALUEDSP, getAddressNotificationBodyList[index].sEGMENTVALUEDSP,
isNeedToShowEmptyDivider: (getAddressNotificationBodyList.length == index + 1) isNeedToShowEmptyDivider:
? isOdd (getAddressNotificationBodyList.length == index + 1)
? true ? isOdd
: false ? true
: false, : false
: false,
), ),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
@ -504,13 +638,14 @@ class InfoFragment extends StatelessWidget {
).objectContainerView(); ).objectContainerView();
} }
Widget getTerminationNotificationBodyListWidget(
Widget getTerminationNotificationBodyListWidget(List<TerminationNotificationBody> getterminationNotificationBodyList) { List<TerminationNotificationBody> getterminationNotificationBodyList) {
bool isOdd = false; bool isOdd = false;
try { try {
if (getterminationNotificationBodyList.length % 2 != 0) { if (getterminationNotificationBodyList.length % 2 != 0) {
isOdd = true; isOdd = true;
getterminationNotificationBodyList.add(TerminationNotificationBody(sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--")); getterminationNotificationBodyList.add(TerminationNotificationBody(
sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--"));
} }
} catch (e) {} } catch (e) {}
@ -518,15 +653,16 @@ class InfoFragment extends StatelessWidget {
itemCount: getterminationNotificationBodyList!.length, itemCount: getterminationNotificationBodyList!.length,
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem( itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem(
index, index,
getterminationNotificationBodyList[index].sEGMENTPROMPT, getterminationNotificationBodyList[index].sEGMENTPROMPT,
getterminationNotificationBodyList[index].sEGMENTVALUEDSP, getterminationNotificationBodyList[index].sEGMENTVALUEDSP,
isNeedToShowEmptyDivider: (getterminationNotificationBodyList.length == index + 1) isNeedToShowEmptyDivider:
? isOdd (getterminationNotificationBodyList.length == index + 1)
? true ? isOdd
: false ? true
: false, : false
: false,
), ),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
@ -535,22 +671,25 @@ class InfoFragment extends StatelessWidget {
).objectContainerView(); ).objectContainerView();
} }
List<Widget> getPRHeaderValues() { List<Widget> getPRHeaderValues() {
List<Widget> pRHeaders = []; List<Widget> pRHeaders = [];
getPrNotificationBodyList!.pRHeader!.forEach((element) { getPrNotificationBodyList!.pRHeader!.forEach((PRHeader element) {
pRHeaders.add(ItemDetailGrid(ItemDetailViewCol(element.hDRATTRIBUTENAME!, element.hDRATTRIBUTEVALUE!), Container())); pRHeaders.add(ItemDetailGrid(
ItemDetailViewCol(
element.hDRATTRIBUTENAME!, element.hDRATTRIBUTEVALUE!),
Container()));
}); });
return pRHeaders; return pRHeaders;
} }
Widget getContactNotificationBodyListWidget(GetContactNotificationBodyList data) { Widget getContactNotificationBodyListWidget(
GetContactNotificationBodyList data) {
bool isOdd = false; bool isOdd = false;
try { try {
if (data.contactNotificationBody!.length % 2 != 0) { if (data.contactNotificationBody!.length % 2 != 0) {
isOdd = true; isOdd = true;
data.contactNotificationBody!.add(ContactNotificationBody(segmentPrompt: "--", segmentValueDsp: "--")); data.contactNotificationBody!.add(ContactNotificationBody(
segmentPrompt: "--", segmentValueDsp: "--"));
} }
} catch (e) {} } catch (e) {}
@ -558,15 +697,16 @@ class InfoFragment extends StatelessWidget {
itemCount: data.contactNotificationBody!.length, itemCount: data.contactNotificationBody!.length,
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem( itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem(
index, index,
data.contactNotificationBody![index].segmentPrompt, data.contactNotificationBody![index].segmentPrompt,
data.contactNotificationBody![index].segmentValueDsp, data.contactNotificationBody![index].segmentValueDsp,
isNeedToShowEmptyDivider: (data.contactNotificationBody!.length == index + 1) isNeedToShowEmptyDivider:
? isOdd (data.contactNotificationBody!.length == index + 1)
? true ? isOdd
: false ? true
: false, : false
: false,
), ),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
@ -578,9 +718,132 @@ class InfoFragment extends StatelessWidget {
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ItemDetailViewCol(data.contactNotificationBody![index].segmentPrompt!, data.contactNotificationBody![index].segmentValueDsp!), itemBuilder: (BuildContext cxt, int index) => ItemDetailViewCol(
separatorBuilder: (cxt, index) => 4.height, data.contactNotificationBody![index].segmentPrompt!,
data.contactNotificationBody![index].segmentValueDsp!),
separatorBuilder: (BuildContext cxt, int index) => 4.height,
itemCount: data.contactNotificationBody!.length), itemCount: data.contactNotificationBody!.length),
); );
} }
Widget getPaymentNotificationBodyListWidget(
GetPaymentNotificationBodyList? data) {
return Column(
children: [
12.height,
if (data!.paymentDetailsList!.isNotEmpty)
Column(
children: [
LocaleKeys.paymentDetails.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.requestNumber.tr(), data.paymentDetailsList![0].requestNumber ?? ""),
ItemDetailViewCol( LocaleKeys.requesterEmpNum.tr(),
data.paymentDetailsList![0].requesterEmployeeName ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.requestDate.tr(),
DateUtil.formatDateToDate(
DateUtil.convertStringToDate(data.paymentDetailsList![0].requestDate!), false) ?? ""),
ItemDetailViewCol(
LocaleKeys.requesterEmpName.tr(), data.paymentDetailsList![0].requesterEmployeeName ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.prepareEmpName.tr(),
data.paymentDetailsList![0].prepareEmployeeName ?? ""),
ItemDetailViewCol(
LocaleKeys.requesterPositionName.tr(), data.paymentDetailsList![0].requesterPositionName ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.preparePositionName.tr(),
data.paymentDetailsList![0].preparePositionName ?? ""),
ItemDetailViewCol(
LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""),
),
],
).objectContainerView(),
if (data!.paymentDetailsList!.isNotEmpty)
Column(
children: [
LocaleKeys.general.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.payingORGName.tr(), data.paymentDetailsList![0].payingOrganizationName ?? ""),
ItemDetailViewCol(LocaleKeys.requestAmount.tr(),
data.paymentDetailsList![0].requestAmount ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.paymentMethodName.tr(),
data.paymentDetailsList![0].paymentMethodName ?? ""),
ItemDetailViewCol(
LocaleKeys.currency.tr(), data.paymentDetailsList![0].currency ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.typeofPayment.tr(),
data.paymentDetailsList![0].typeOfPayment ?? ""),
ItemDetailViewCol(
LocaleKeys.paymentDetails.tr(), data.paymentDetailsList![0].paymentDetails ?? ""),
),
],
).objectContainerView(),
if (data!.beneficieryList!.isNotEmpty)
Column(
children: [
LocaleKeys.beneficiaryDetails.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.beneficiaryName.tr(), data.beneficieryList![0].beneficiaryName ?? ""),
ItemDetailViewCol(LocaleKeys.idIqama.tr(),
data.beneficieryList![0].iqamaNumber ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.beneficiaryBankName.tr(),
data.beneficieryList![0] .beneficiaryBankName ?? ""),
ItemDetailViewCol(
LocaleKeys.sadadNumber.tr(), data.beneficieryList![0].saddadNumber ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.beneficiaryIBAN.tr(),
data.beneficieryList![0].beneficiaryIban ?? ""),
Container(),
),
],
).objectContainerView(),
if (data!.purchaseOrdersList!.isNotEmpty && data.purchaseOrdersList![0].poAmount !=null)
Column(
children: [
LocaleKeys.purchaseOrders.tr().toText14(color: MyColors.textMixColor),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.poNumber.tr(), data.purchaseOrdersList![0].poNumber ?? ""),
ItemDetailViewCol(LocaleKeys.pOAmount.tr(),
data.purchaseOrdersList![0].poAmount.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.supplierName.tr(),
data.purchaseOrdersList![0].supplierName ?? ""),
ItemDetailViewCol(
LocaleKeys.approvalDate.tr(), data.purchaseOrdersList![0].poApprovalDate!=null ? DateUtil.formatDateToDate(
DateUtil.convertStringToDate(data.purchaseOrdersList![0].poApprovalDate), false) :"" ),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requestNumber.tr(),
data.purchaseOrdersList![0].prNumber?? ""),
ItemDetailViewCol(LocaleKeys.versionStatus.tr(),
data.purchaseOrdersList![0].versionStatus?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.supplierNo.tr(),
data.purchaseOrdersList![0].supplierNumber?? ""),
Container(),
),
],
).objectContainerView(),
],
);
}
} }

@ -1,13 +1,15 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc}) { void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc, String? type}) {
showModalBottomSheet<String>( showModalBottomSheet<String>(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (BuildContext context) { builder: (BuildContext context) {
return Container( return Container(
constraints: BoxConstraints(
maxHeight: type =='CONTINUE_ACTION' ? MediaQuery.of(context).size.height *.75 : double.infinity,),
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -17,7 +19,7 @@ void showMyBottomSheet(BuildContext context, {required Widget child, required Vo
), ),
padding: MediaQuery.of(context).viewInsets, padding: MediaQuery.of(context).viewInsets,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Column( child:SingleChildScrollView(child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
@ -35,7 +37,7 @@ void showMyBottomSheet(BuildContext context, {required Widget child, required Vo
8.height, 8.height,
child, child,
], ],
), )),
); );
}, },
).then((value) { ).then((value) {

Loading…
Cancel
Save