Compare commits

..

No commits in common. 'master' and 'coc-into-ensat' have entirely different histories.

@ -320,8 +320,6 @@
"createdFor": "انشاء لأجل",
"requestCreatedSuccessfully": "تم انشاء الطلب بنجاح",
"search": "بحث",
"filterEnterPrDetailsHere": "ادخل تفاصيل طلب الشراء هنا",
"filterEnterPoDetailsHere": "ادخل تفاصيل أمر الشراء هنا",
"wantToReject": "هل انت متأكد تريد الرفض",
"requestType": "نوع الطلب",
"employeeDigitalID": "هويةالموظف الرقمية",
@ -669,16 +667,9 @@
"incidentDetails": "تفاصيل الحادث",
"ticketNumber": "رقم التذكرة",
"ticketId": "معرف التذكرة",
"pleaseSelectProject": "الرجاء اختيار مشروع",
"viewAttachment" : "عرض المرفق",
"parkingQr": "وقوف السيارات QR",
"startNow": "ابدأ الآن",
"destination_type": "نوع الوجهة",
"source_organization_name": "اسم منظمة المصدر",
"destination_organization_name": "اسم منظمة الوجهة",
"costCenter": "مركز التكلفة",
"priceSAR": "السعر (ريال سعودي)",
"amountSAR": "المبلغ (ريال سعودي)",
"amuLastThreeMonths": "AMU (آخر 3 أشهر)"
"pleaseSelectProject": "الرجاء اختيار مشروع",
"viewAttachment" : "عرض المرفق",
"parkingQr": "وقوف السيارات QR",
"startNow": "ابدأ الآن"
}

@ -315,8 +315,6 @@
"requestType": "Request Type",
"requestCreatedSuccessfully": "Request created successfully",
"search": "Search",
"filterEnterPrDetailsHere": "Enter PR Details here",
"filterEnterPoDetailsHere": "Enter PO Details here",
"wantToReject": "Are you sure want to reject?",
"employeeDigitalID": "Employee Digital ID",
"businessCard": "Business Card",
@ -667,15 +665,8 @@
"incidentDetails": "Incident Details",
"ticketNumber": "Ticket Number",
"ticketId": "Ticket ID",
"pleaseSelectProject": "Please select a project",
"viewAttachment" : "View Attachment",
"parkingQr": "Parking QR",
"startNow": "Start Now",
"destination_type": "Destination Type",
"source_organization_name": "Source Organization Name",
"destination_organization_name": "Destination Organization Name",
"costCenter": "Cost Center",
"priceSAR": "Price (SAR)",
"amountSAR": "Amount (SAR)",
"amuLastThreeMonths": "AMU (Last 3 months)"
"pleaseSelectProject": "Please select a project",
"viewAttachment" : "View Attachment",
"parkingQr": "Parking QR",
"startNow": "Start Now"
}

@ -251,12 +251,12 @@ class DashboardApiClient {
);
}
Future<dynamic> getBookingSSOFinalRedirection({required String token, required String refreshToken}) async {
Future<dynamic> getBookingSSOFinalRedirection({required String token}) async {
// token =
// "eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjZTE2OWM0YjIwYjQ2ZWM5YTQyOTU3Y2ZhODUzNzQ1IiwidHlwIjoiSldUIn0.eyJ0ZW5hbnRfaWQiOiJhOWY0ZDFhMDU5NmQ0YWVhOGY4MzA5OTJlYzRiZGFjMSIsImVpZCI6IjExNzkzMCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6Ijk2MDI0OGM1NzA3YzQ3MmFhYTEzM2I1N2ZhODE1ZmVhIiwibGFuZ3VhZ2UiOiJVUyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6IjExNzkzMEBobWcuY29tIiwiZXhwIjoxNzgyNDc1NzY5LCJpc3MiOiJodHRwczovL3Nzby11YXQuaG1nLmNvbSIsImF1ZCI6ImE5ZjRkMWEwNTk2ZDRhZWE4ZjgzMDk5MmVjNGJkYWMxIn0.rJcLVsG8D0XECyLERCTD2uqGeWyvp-OBVGE9uL2qKrX4etFUHgdFt_5kYF6edFTtGy-0PIZadHDmv7e-IOhVWHm5HVMClaukiXoRXR8cDN8XA1wfme3Kd-U5PXN-IRh49AyRTzLO0rYNPvH81ScosWGlsFSkOvA-0hJNa2adHdtvgNvB8wJshSU5p7sAmF8mjdDY6aInG19etu2iEuUDwHHA4ZY_ts4hboHo8fE392hFaYGonExoD7bpW5RMx5xKWeRCmWpG_PK8Aw_z1jGzdB9PANus4pteRGuln1J-kmo2lQC9pVrSyZATAKp1HfgfyZ_vUhaHEfM69cMWaCslJQ";
http.MultipartRequest request = http.MultipartRequest('POST', Uri.parse('https://www.paxes.com/sso/hmg'));
// http.MultipartRequest request = http.MultipartRequest('POST', Uri.parse('https://ek.techmaster.in/SSO/HMG'));
request.fields.addAll(<String, String>{'JWTToken': token, 'RefreshToken': refreshToken});
request.fields.addAll(<String, String>{'JWTToken': token});
http.StreamedResponse response = await request.send();
if (response.statusCode == 302) {
String res = await response.stream.bytesToString();

@ -71,14 +71,7 @@ class LoginApiClient {
Future<BasicMemberInformationModel?> mohemmSendActivationCodeByOTPNotificationType(int isMobileFingerPrint, String? mobileNumber, int optSendType, String? pUserName) async {
String url = "${ApiConsts.erpRest}Mohemm_SendActivationCodebyOTPNotificationType";
Map<String, dynamic> postParams = {
"IsMobileFingerPrint": isMobileFingerPrint,
"MobileNumber": mobileNumber,
"OTP_SendType": optSendType,
"P_USER_NAME": pUserName,
"NotificationCenterAppGUID": ApiConsts.notificationCenterAppGUID,
"NotificationCenterAppSeviceGUID": ApiConsts.notificationCenterLoginServiceGUID,
};
Map<String, dynamic> postParams = {"IsMobileFingerPrint": isMobileFingerPrint, "MobileNumber": mobileNumber, "OTP_SendType": optSendType, "P_USER_NAME": pUserName};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams);
}
@ -112,13 +105,7 @@ class LoginApiClient {
Future<GenericResponseModel?> sendPublicActivationCode(String? mobileNumber, String? pUsername) async {
String url = "${ApiConsts.erpRest}SendPublicActivationCode";
Map<String, dynamic> postParams = {
"MobileNumber": mobileNumber,
"P_MOBILE_NUMBER": mobileNumber,
"P_USER_NAME": pUsername,
"NotificationCenterAppGUID": ApiConsts.notificationCenterAppGUID,
"NotificationCenterAppSeviceGUID": ApiConsts.notificationCenterForgotPasswordServiceGUID,
};
Map<String, dynamic> postParams = {"MobileNumber": mobileNumber, "P_MOBILE_NUMBER": mobileNumber, "P_USER_NAME": pUsername};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);

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

@ -4,7 +4,7 @@ class ApiConsts {
// static String baseUrl = "http://10.200.204.11"; // Local 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 = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
@ -14,7 +14,7 @@ class ApiConsts {
//
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.20.200.111:1010/";
static String baseUrl = "https://mohemm.hmg.com"; // New Live server
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server
//static String eLearningBaseUrl = "https://elearning.hmg.com/moodle_dev/api/"; // Elearning server UAT
static String eLearningBaseUrl = "https://elearning.hmg.com/moodle/api/"; // Elearning server live
static String enSATLiveURL = "https://ensat.hmg.com/auth/autologin"; // ENSAT server live
@ -80,11 +80,6 @@ class ApiConsts {
//DummyCards for the UI
static int tabletMinLength = 500;
// Notification Center GUIDs for OTP
static String notificationCenterAppGUID = "VDZreDY5TTNmTDVudzc4aDkwU3ZqcW9OcmI0";
static String notificationCenterLoginServiceGUID = "D8BD5C76-4B50-4122-81D0-C3AA25DB08A2";
static String notificationCenterForgotPasswordServiceGUID = "5CCCC2C9-EEA0-4207-9BE9-EE1FBBFFE8D0";
}
class SharedPrefsConsts {

@ -524,47 +524,14 @@ class DateUtil {
// }
// return "";
// }
static String replaceArabicNumber(String? input) {
if (input == null || input.isEmpty) return input ?? "";
static String replaceArabicNumber(String input) {
const english = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
const arabic = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];
const persian = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
for (int i = 0; i < english.length; i++) {
input = input!.replaceAll(arabic[i], english[i]).replaceAll(persian[i], english[i]);
input = input.replaceAll(arabic[i], english[i]);
}
return input!;
}
static DateTime? parseFlexibleDateTime(String? dateStr) {
if (dateStr == null || dateStr.trim().isEmpty) return null;
String cleanStr = replaceArabicNumber(dateStr.trim()).replaceAll('/"', '').replaceAll('"', '');
if (cleanStr.contains(' 00:00:00')) {
cleanStr = cleanStr.replaceAll(' 00:00:00', '').trim();
}
DateTime? result = DateTime.tryParse(cleanStr);
if (result != null) return result;
if (cleanStr.contains('/')) {
try {
return DateFormat("yyyy/MM/dd", "en_US").parseLoose(cleanStr);
} catch (_) {}
try {
return DateFormat("dd/MM/yyyy", "en_US").parseLoose(cleanStr);
} catch (_) {}
}
if (cleanStr.contains('-')) {
try {
return DateFormat("yyyy-MM-dd", "en_US").parseLoose(cleanStr);
} catch (_) {}
try {
return DateFormat("dd-MM-yyyy", "en_US").parseLoose(cleanStr);
} catch (_) {}
}
return null;
return input;
}
}

@ -683,14 +683,7 @@ class CodegenLoader extends AssetLoader{
"pleaseSelectProject": "الرجاء اختيار مشروع",
"viewAttachment": "عرض المرفق",
"parkingQr": "وقوف السيارات QR",
"startNow": "ابدأ الآن",
"destination_type": "نوع الوجهة",
"source_organization_name": "اسم منظمة المصدر",
"destination_organization_name": "اسم منظمة الوجهة",
"costCenter": "مركز التكلفة",
"priceSAR": "السعر (ريال سعودي)",
"amountSAR": "المبلغ (ريال سعودي)",
"amuLastThreeMonths": "AMU (آخر 3 أشهر)"
"startNow": "ابدأ الآن"
};
static const Map<String,dynamic> _en_US = {
"mohemm": "Mohemm",
@ -1361,14 +1354,7 @@ static const Map<String,dynamic> _en_US = {
"pleaseSelectProject": "Please select a project",
"viewAttachment": "View Attachment",
"parkingQr": "Parking QR",
"startNow": "Start Now",
"destination_type": "Destination Type",
"source_organization_name": "Source Organization Name",
"destination_organization_name": "Destination Organization Name",
"costCenter": "Cost Center",
"priceSAR": "Price (SAR)",
"amountSAR": "Amount (SAR)",
"amuLastThreeMonths": "AMU (Last 3 months)"
"startNow": "Start Now"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
}

@ -323,8 +323,6 @@ abstract class LocaleKeys {
static const createdFor = 'createdFor';
static const requestCreatedSuccessfully = 'requestCreatedSuccessfully';
static const search = 'search';
static const filterEnterPrDetailsHere = 'filterEnterPrDetailsHere';
static const filterEnterPoDetailsHere = 'filterEnterPoDetailsHere';
static const wantToReject = 'wantToReject';
static const requestType = 'requestType';
static const employeeDigitalID = 'employeeDigitalID';
@ -658,12 +656,5 @@ abstract class LocaleKeys {
static const viewAttachment = 'viewAttachment';
static const parkingQr = 'parkingQr';
static const startNow = 'startNow';
static const destination_type = 'destination_type';
static const source_organization_name = 'source_organization_name';
static const destination_organization_name = 'destination_organization_name';
static const costCenter = 'costCenter';
static const priceSAR = 'priceSAR';
static const amountSAR = 'amountSAR';
static const amuLastThreeMonths = 'amuLastThreeMonths';
}

@ -1,7 +1,7 @@
import 'dart:convert';
class GetTicketAccuralBalanceModel {
num? accrualNetEntitlement;
int? accrualNetEntitlement;
String? accuralPlanCode;
GetTicketAccuralBalanceModel({

@ -5,13 +5,12 @@ class GetPrNotificationBodyList {
String? pINFORMATION;
String? pQUESTION;
GetPrNotificationBodyList({
this.pRHeader,
this.pRLines,
this.pCURRENCYCODE,
this.pINFORMATION,
this.pQUESTION,
});
GetPrNotificationBodyList(
{this.pRHeader,
this.pRLines,
this.pCURRENCYCODE,
this.pINFORMATION,
this.pQUESTION});
GetPrNotificationBodyList.fromJson(Map<String, dynamic> json) {
if (json['PRHeader'] != null) {
@ -79,28 +78,21 @@ class PRLines {
int? tOROWNUM;
num? uNITPRICE;
String? uOM;
String? dESTINATIONTYPE;
String? sOURCEORGANIZATIONNAME;
String? dESTINATIONORGANIZATIONNAME;
PRLines({
this.cOSTCENTER,
this.dESCRIPTION,
this.fROMROWNUM,
this.iTEMAMU,
this.iTEMCODE,
this.lINEAMOUNT,
this.lINENUM,
this.nOOFROWS,
this.qUANTITY,
this.rOWNUM,
this.tOROWNUM,
this.uNITPRICE,
this.uOM,
this.dESTINATIONTYPE,
this.sOURCEORGANIZATIONNAME,
this.dESTINATIONORGANIZATIONNAME,
});
PRLines(
{this.cOSTCENTER,
this.dESCRIPTION,
this.fROMROWNUM,
this.iTEMAMU,
this.iTEMCODE,
this.lINEAMOUNT,
this.lINENUM,
this.nOOFROWS,
this.qUANTITY,
this.rOWNUM,
this.tOROWNUM,
this.uNITPRICE,
this.uOM});
PRLines.fromJson(Map<String, dynamic> json) {
cOSTCENTER = json['COST_CENTER'];
@ -116,9 +108,6 @@ class PRLines {
tOROWNUM = json['TO_ROW_NUM'];
uNITPRICE = json['UNIT_PRICE'];
uOM = json['UOM'];
dESTINATIONTYPE = json['DESTINATION_TYPE'];
sOURCEORGANIZATIONNAME = json['SOURCE_ORGANIZATION_NAME'];
dESTINATIONORGANIZATIONNAME = json['DESTINATION_ORGANIZATION_NAME'];
}
Map<String, dynamic> toJson() {
@ -136,9 +125,6 @@ class PRLines {
data['TO_ROW_NUM'] = this.tOROWNUM;
data['UNIT_PRICE'] = this.uNITPRICE;
data['UOM'] = this.uOM;
data['DESTINATION_TYPE'] = this.dESTINATIONTYPE;
data['SOURCE_ORGANIZATION_NAME'] = this.sOURCEORGANIZATIONNAME;
data['DESTINATION_ORGANIZATION_NAME'] = this.dESTINATIONORGANIZATIONNAME;
return data;
}
}

@ -136,7 +136,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi),
// DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.etqanOVR.tr(), AppRoutes.etqanOvr),
DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.keen.tr(), AppRoutes.etqanOvr),
DrawerMenuItem("assets/images/drawer/car_parking_icon.svg", LocaleKeys.parkingQr.tr(), AppRoutes.parkingQr),
// DrawerMenuItem("assets/images/drawer/car_parking_icon.svg", LocaleKeys.parkingQr.tr(), AppRoutes.parkingQr),
DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
DrawerMenuItem("assets/images/drawer/courses.svg", "courses".tr(), AppRoutes.courses),
// DrawerMenuItem("assets/images/drawer/drawer_marathon.svg", LocaleKeys.brainMarathon.tr(), AppRoutes.marathonIntroScreen),
@ -394,9 +394,9 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
}
Future<dynamic> fetchURLRedirection({required String token, required String refreshToken}) async {
Future<dynamic> fetchURLRedirection({required String token}) async {
try {
dynamic res = await DashboardApiClient().getBookingSSOFinalRedirection(token: token, refreshToken: refreshToken);
dynamic res = await DashboardApiClient().getBookingSSOFinalRedirection(token: token);
logger.d("SSO URL: $res");
return res;
} catch (ex) {

@ -57,15 +57,6 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
Utils.showLoading(context);
getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear);
getDayHoursTypeDetailsList = await MonthlyAttendanceApiClient().getDayHoursTypeDetails(searchMonth, searchYear);
// Debug logging to check the data
print('Total days received: ${getDayHoursTypeDetailsList.length}');
for (var day in getDayHoursTypeDetailsList) {
if (day.lEAVETYPECODE != null && day.lEAVETYPECODE!.isNotEmpty) {
print('Date: ${day.sCHEDULEDATE}, LEAVE_TYPE_CODE: ${day.lEAVETYPECODE}');
}
}
Utils.hideLoading(context);
_calendarController.displayDate = formattedDate;
setState(() {});
@ -316,19 +307,10 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
// bool isDayIsPresent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y';
// bool isDayIsAbsent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].aBSENTFLAG == 'Y';
List<GetDayHoursTypeDetailsList> getDayHours =
getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) {
DateTime scheduleDate = DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!);
return scheduleDate.day == details.date.day &&
scheduleDate.month == details.date.month &&
scheduleDate.year == details.date.year;
}).toList();
getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) => DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date.day).toList();
if (getDayHours.isNotEmpty) {
GetDayHoursTypeDetailsList dayData = getDayHours.first;
// Debug logging
print('Day: ${details.date.day}, LEAVE_TYPE_CODE: ${dayData.lEAVETYPECODE}, ATTENDED_FLAG: ${dayData.aTTENDEDFLAG}, DAY_TYPE: ${dayData.dAYTYPE}');
bool isDayIsOff = dayData.aTTENDEDFLAG == 'N' && dayData.dAYTYPE == 'OFF';
bool isDayIsPresent = dayData.aTTENDEDFLAG == 'Y';
bool isDayIsAbsent = dayData.aTTENDEDFLAG == 'N' && dayData.aBSENTFLAG == 'Y';
@ -339,9 +321,8 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
bool useGradient = false;
// Determine color based on leave type code
if (leaveTypeCode != null && leaveTypeCode.isNotEmpty && leaveTypeCode.trim().isNotEmpty) {
if (leaveTypeCode != null && leaveTypeCode.isNotEmpty) {
leaveTypeColor = leaveTypeColors[leaveTypeCode];
print('Matched color for $leaveTypeCode: $leaveTypeColor');
}
// If no leave type color found, use default colors based on attendance status
@ -415,28 +396,6 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
),
);
}
// Handle days with leave type codes (HOLIDAY, WFH, etc.) that are not present/absent/off
else if (leaveTypeColor != null) {
return Container(
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: leaveTypeColor,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
offset: const Offset(0, 2),
blurRadius: 26,
color: MyColors.blackColor.withOpacity(0.100),
),
],
),
alignment: Alignment.center,
child: Text(
"$val",
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500, color: MyColors.white),
),
);
}
}
return Container(
margin: const EdgeInsets.all(4),
@ -471,22 +430,14 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
void calendarTapped(CalendarTapDetails details) async {
if (details.date == null) return;
// Filter to find the matching day data with full date comparison
// Filter to find the matching day data
List<GetDayHoursTypeDetailsList> getDayHours =
getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) {
DateTime scheduleDate = DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!);
return scheduleDate.day == details.date!.day &&
scheduleDate.month == details.date!.month &&
scheduleDate.year == details.date!.year;
}).toList();
getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) =>
DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date!.day).toList();
if (getDayHours.isEmpty) return;
GetDayHoursTypeDetailsList dayData = getDayHours.first;
// Debug logging
print('Tapped Day: ${details.date!.day}, LEAVE_TYPE_CODE: ${dayData.lEAVETYPECODE}');
pRTPID = dayData.rTPID;
await getScheduleShiftsDetails(details.date!.day, pRTPID);
dynamic value = getScheduleShiftsDetailsList!.pERCENTAGE;

@ -241,7 +241,7 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
// Build end date text
Widget _buildEndDateText({bool isLargeText = false}) {
String label = _getLocalizedText("تاريخ الانتهاء: ", "End Date: ");
String fullText = label + advertisementPayload!.deadline ?? "";
String fullText = label + advertisementPayload!.deadline!;
return isLargeText ? fullText.toText16(color: MyColors.darkTextColor) : fullText.toText14(color: MyColors.darkTextColor);
}
@ -335,7 +335,7 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
if (advertisementData != null) {
checkFileType();
if (isTextURL) {
if (advertisementPayload?.deadline != null && deadlineTimerController == null) {
if (deadlineTimerController == null) {
initDeadlineTimer();
}
} else {
@ -561,13 +561,7 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
_buildAdvertisementContent(),
24.height,
if (advertisementPayload != null && advertisementPayload!.deadline != null) _buildDeadlineSection(),
if (advertisementPayload != null && advertisementPayload!.deadline != null) 24.height,
_buildActionButtons(),
],
children: [_buildAdvertisementContent(), 24.height, _buildDeadlineSection(), 24.height, _buildActionButtons()],
),
),
],

@ -133,7 +133,7 @@ class MenusWidget extends StatelessWidget {
if (pro.ticketBookingResponse != null && pro.ticketBookingResponse!.success) {
SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: pro.ticketBookingResponse!.clientId);
if (ssoToken != null) {
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!, refreshToken: ssoToken.data!.refreshToken!);
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
await pro.fetchTicketAccuralBalance(context, DateTime.now());
pro.ticketHistoryTransactionList = await EITApiClient().getEITTransactions("HMG_TICKET_ITENARY_HR_EIT_SS", isCompleteList: true);

@ -254,8 +254,6 @@ class ServicesWidget extends StatelessWidget {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(menuEntry.prompt!, menuEntry.functionName!));
} else if (menuEntry.requestType == "PAYSLIP") {
Navigator.pushNamed(context, AppRoutes.monthlyPaySlip);
} else if (menuEntry.requestType == "CEI") {
Navigator.pushNamed(context, AppRoutes.childEducation, arguments: menuEntry);
}
} else {
if (menuEntry.menuName == "HMG_TICKET_REQUESTS") {
@ -264,7 +262,7 @@ class ServicesWidget extends StatelessWidget {
Utils.showLoading(context);
SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: pro.ticketBookingResponse!.clientId);
if (ssoToken != null) {
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!, refreshToken: ssoToken.data!.refreshToken!);
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
await pro.fetchTicketAccuralBalance(context, DateTime.now());
pro.ticketHistoryTransactionList = await EITApiClient().getEITTransactions("HMG_TICKET_ITENARY_HR_EIT_SS", isCompleteList: true);

@ -326,7 +326,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (displayText.contains("/")) {
displayText = DateFormat('yyyy-MM-dd', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(DateUtil.replaceArabicNumber(displayText)));
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
@ -336,7 +336,11 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
isEnable: false,
onTap: () async {
if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate;
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd").parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first;
@ -349,14 +353,14 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME:
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date));
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} else {
eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: dateString,
pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME:
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date));
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
}
getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
@ -370,7 +374,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "Y") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (getabsenceDffStructureList[index].isDefaultTypeIsCDPS) {
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) {
displayText = Utils.reverseFormatDate(displayText);
// if (displayText.contains(" 00:00:00")) {
// displayText = displayText.replaceAll(" 00:00:00", "");
@ -386,7 +390,19 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
isEnable: false,
onTap: () async {
if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate;
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) {
String tempDate = getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!;
if (tempDate.contains("00:00:00")) {
tempDate = tempDate.replaceAll("00:00:00", '').trim();
}
if (tempDate.contains("/")) {
selectedDate = DateFormat("yyyy/MM/dd").parse(tempDate);
} else {
selectedDate = DateFormat("yyyy-MM-dd").parse(tempDate);
}
} else {
selectedDate = DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first;
@ -398,14 +414,14 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME:
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date));
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
} else {
eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: dateString,
pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME:
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date));
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
}
getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
@ -496,7 +512,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
displayText = displayText.replaceAll(" 00:00:00", "");
}
if (!displayText.contains("-")) {
displayText = DateFormat('yyyy-MM-dd', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(DateUtil.replaceArabicNumber(displayText)));
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
}
}
return DynamicTextFieldWidget(
@ -506,7 +522,11 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
isEnable: false,
onTap: () async {
if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate;
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) {
selectedDate = DateFormat("yyyy/MM/dd").parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
}
DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first;
@ -516,7 +536,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME:
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date));
getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date));
getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {});
// if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
@ -537,14 +557,14 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
if (getabsenceDffStructureList[index].mOBILEENABLED != "Y") return;
if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
var timeString = DateUtil.replaceArabicNumber(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME).split(":");
selectedDate = DateTime(0, 0, 0, int.tryParse(timeString[0]) ?? 0, timeString.length > 1 ? (int.tryParse(timeString[1]) ?? 0) : 0);
var timeString = getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":");
selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1]));
//DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
TimeOfDay _time = await _selectTime(context);
DateTime tempTime = DateTime(0, 1, 1, _time.hour, _time.minute);
String time = DateFormat('HH:mm', "en_US").format(tempTime).trim();
String time = DateFormat('HH:mm').format(tempTime).trim();
// DateTime date1 = DateTime(date.year, date.month, date.day);
// getabsenceDffStructureList![index].fieldAnswer = date.toString();

@ -94,7 +94,6 @@ class _RequestDetailsState extends State<ParkingQrScreen> {
void getTicketDetails() async {
try {
qrData = GetEmployeeParking();
Utils.showLoading(context);
qrData = await DashboardApiClient().getEmployeeParkingQrCode();
Utils.hideLoading(context);

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/leave_balance_api_client.dart';
@ -26,7 +27,7 @@ import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget
class FamilyMemberScreenParams {
String? actionType;
int? relationID;
int relationID;
int? flag;
FamilyMemberScreenParams(this.relationID, {this.actionType, this.flag});
@ -76,7 +77,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
element?.getContactDetailsList = new GetContactDetailsList();
});
} else if (params!.actionType == "UPDATE") {
getContactDetailsList = await ProfileApiClient().getContactDetailsList(params!.relationID!);
getContactDetailsList = await ProfileApiClient().getContactDetailsList(params!.relationID);
getBasicDetDffStructureList?.forEach((element) {
element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME);

@ -1,4 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/profile_api_client.dart';
@ -13,6 +13,7 @@ import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/profile/add_update_family_member.dart';
import 'package:mohem_flutter_app/ui/profile/profile_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:provider/provider.dart';
@ -27,11 +28,22 @@ class FamilyMembers extends StatefulWidget {
class _FamilyMembersState extends State<FamilyMembers> {
List<GetEmployeeContactsList> getEmployeeContactsList = [];
int? relationId;
dynamic? relationId;
int? flag;
GetMenuEntriesList menuEntries = GetMenuEntriesList();
@override
void initState() {
super.initState();
List<GetMenuEntriesList> menuData = Provider.of<DashboardProviderModel>(context, listen: false).getMenuEntriesList!;
List<GetMenuEntriesList> arr = menuData.where((GetMenuEntriesList e) => e.requestType == 'CONTACT').toList();
if (arr.isNotEmpty) {
menuEntries = arr[0];
} else {
menuEntries = new GetMenuEntriesList();
}
getEmployeeContacts();
}
@ -47,19 +59,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
}
}
GetMenuEntriesList _getContactMenuEntries(BuildContext context) {
List<GetMenuEntriesList> menuData = context.watch<DashboardProviderModel>().getMenuEntriesList ?? <GetMenuEntriesList>[];
List<GetMenuEntriesList> arr = menuData.where((GetMenuEntriesList e) => e.requestType == 'CONTACT').toList();
return arr.isNotEmpty ? arr.first : GetMenuEntriesList();
}
@override
Widget build(BuildContext context) {
GetMenuEntriesList menuEntries = _getContactMenuEntries(context);
bool canAddFamilyMember = menuEntries.addButton == 'Y';
bool canUpdateFamilyMember = menuEntries.updateButton == 'Y';
bool canDeleteFamilyMember = menuEntries.deleteButton == 'Y';
return Scaffold(
appBar: AppBarWidget(
context,
@ -95,18 +95,16 @@ class _FamilyMembersState extends State<FamilyMembers> {
child: Icon(
Icons.edit,
size: 14,
color: canUpdateFamilyMember ? MyColors.grey67Color : MyColors.lightGreyColor,
color: menuEntries.updateButton == 'Y' ? MyColors.grey67Color : MyColors.lightGreyColor,
)),
TextSpan(
text: LocaleKeys.update.tr(),
style: TextStyle(
color: canUpdateFamilyMember ? MyColors.grey67Color : MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600),
color: menuEntries.updateButton == 'Y' ? MyColors.grey67Color : MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600),
recognizer: TapGestureRecognizer()
..onTap = () async {
relationId = getEmployeeContactsList[index].cONTACTRELATIONSHIPID;
if (canUpdateFamilyMember && relationId != null) {
showUpdateAlertDialog(context, relationId, 2, "UPDATE");
}
relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID;
menuEntries.updateButton == 'Y' ? showUpdateAlertDialog(context, relationId, 2, "UPDATE") : null;
})
],
),
@ -119,21 +117,19 @@ class _FamilyMembersState extends State<FamilyMembers> {
child: Icon(
Icons.delete,
size: 15,
color: canDeleteFamilyMember ? MyColors.redColor : MyColors.lightGreyColor,
color: menuEntries.updateButton == 'Y' ? MyColors.redColor : MyColors.lightGreyColor,
),
),
TextSpan(
text: LocaleKeys.remove.tr(),
style: TextStyle(
color: canDeleteFamilyMember ? MyColors.redColor : MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600),
color: menuEntries.updateButton == 'Y' ? MyColors.redColor : MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600),
),
],
),
).onPress(() {
relationId = getEmployeeContactsList[index].cONTACTRELATIONSHIPID;
if (canDeleteFamilyMember && relationId != null) {
showRemoveAlertDialog(context, relationId);
}
relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID;
menuEntries.updateButton == 'Y' ? showRemoveAlertDialog(context, relationId) : null;
}),
],
),
@ -143,13 +139,10 @@ class _FamilyMembersState extends State<FamilyMembers> {
),
DefaultButton(
LocaleKeys.addNewFamilyMember.tr(),
canAddFamilyMember
menuEntries.updateButton == 'Y'
? () async {
Navigator.pushNamed(
context,
AppRoutes.addUpdateFamilyMember,
arguments: FamilyMemberScreenParams(null, flag: 1, actionType: "ADD"),
);
Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: FamilyMemberScreenParams( relationId, flag: 1, actionType: "ADD"));
// ProfileScreen();
}
: null)
.insideContainer,
@ -171,7 +164,6 @@ class _FamilyMembersState extends State<FamilyMembers> {
LocaleKeys.ok.tr(),
),
onPressed: () {
Navigator.pop(context);
Navigator.pushNamed(
context,
AppRoutes.addUpdateFamilyMember,
@ -211,7 +203,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
LocaleKeys.ok.tr(),
),
onPressed: () {
Navigator.pushNamed(context, AppRoutes.deleteFamilyMember, arguments: relationId);
Navigator.pushNamed(context, AppRoutes.deleteFamilyMember, arguments: FamilyMemberScreenParams(relationId));
// continueDynamicForms();
},
);

@ -2,7 +2,6 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
@ -13,64 +12,47 @@ import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
class ChildEducationAssistance extends StatefulWidget {
const ChildEducationAssistance({Key? key}) : super(key: key);
class ChildEducationAssistance extends StatelessWidget {
ChildEducationAssistance({Key? key}) : super(key: key);
@override
State<ChildEducationAssistance> createState() => _ChildEducationAssistanceState();
}
class _ChildEducationAssistanceState extends State<ChildEducationAssistance> {
GetMenuEntriesList? menuEntry;
List<GetEmployeeContactsList> empContactList = [];
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
menuEntry = ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList;
getEmployeeContacts();
});
}
@override
Widget build(BuildContext context) {
menuEntry ??= ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList;
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: menuEntry?.prompt ?? ""),
body: empContactList.isNotEmpty
? ListView.separated(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
separatorBuilder: (BuildContext cxt, int index) => 12.height,
itemCount: empContactList.length,
itemBuilder: (BuildContext context, int index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
"${empContactList[index].cONTACTNAME}".toText16(color: MyColors.grey3AColor),
"${LocaleKeys.dateOfBirth.tr()}: ${empContactList[index].dATEOFBIRTH?.split(" ").first ?? ""}".toText14(color: MyColors.grey3AColor, weight: FontWeight.w400),
"${empContactList[index].rELATIONSHIP}".toText11(color: MyColors.textMixColor),
],
).objectContainerView(disablePadding: false, center: false).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen,
arguments: DynamicListViewParams(empContactList[index].cONTACTNAME!, menuEntry!.functionName!, pContactRelationshipId: empContactList[index].cONTACTRELATIONSHIPID));
appBar: AppBarWidget(context, title: menuEntry!.prompt!),
body: FutureBuilder(
future: ProfileApiClient().getEmployeeContacts(),
builder: (BuildContext cxt, AsyncSnapshot<List<GetEmployeeContactsList>> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
} else if (snapshot.hasData) {
List<GetEmployeeContactsList> empContactList = snapshot.data!;
return ListView.separated(
padding: const EdgeInsets.all(21),
separatorBuilder: (BuildContext cxt, int index) => 12.height,
itemCount: empContactList.length,
itemBuilder: (BuildContext context, int index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
"${empContactList[index].cONTACTNAME}".toText16(color: MyColors.grey3AColor),
"${LocaleKeys.dateOfBirth.tr()}: ${empContactList[index].dATEOFBIRTH?.split(" ").first ?? ""}".toText14(color: MyColors.grey3AColor, weight: FontWeight.w400),
"${empContactList[index].rELATIONSHIP}".toText11(color: MyColors.textMixColor),
],
).objectContainerView(disablePadding: false, center: false).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen,
arguments: DynamicListViewParams(empContactList[index].cONTACTNAME!, menuEntry!.functionName!, pContactRelationshipId: empContactList[index].cONTACTRELATIONSHIPID));
});
});
})
: Utils.getNoDataWidget(context),
} else {
return LocaleKeys.noDataAvailable.tr().toText16().center;
}
},
),
);
}
void getEmployeeContacts() async {
try {
Utils.showLoading(context);
empContactList = await ProfileApiClient().getEmployeeContacts();
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
}

@ -61,24 +61,23 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
appBar: AppBarWidget(context, title: LocaleKeys.ticketDetails.tr()),
body: Column(
children: <Widget>[
Expanded(
child: ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: <Widget>[
if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...<Widget>[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...<Widget>[
Container(
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
boxShadow: <BoxShadow>[BoxShadow(color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, offset: const Offset(0, 3))],
),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(child: LocaleKeys.currentTicketBalance.tr().toText20()),
ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: <Widget>[
if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...<Widget>[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...<Widget>[
Container(
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
boxShadow: <BoxShadow>[BoxShadow(color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, offset: const Offset(0, 3))],
),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
LocaleKeys.currentTicketBalance.tr().toText20().expanded,
Row(
children: <Widget>[
const Icon(Icons.calendar_month_rounded, color: MyColors.darkIconColor, size: 16),
@ -117,10 +116,11 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
),
const SizedBox(height: 21),
(dashboardProviderModel != null && dashboardProviderModel!.ticketHistoryTransactionList != null && dashboardProviderModel!.ticketHistoryTransactionList!.isNotEmpty)
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
? ListView(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: <Widget>[
LocaleKeys.ticketHistory.tr().toText20(),
LocaleKeys.ticketHistory.tr().toText20().expanded,
12.height,
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
@ -220,10 +220,9 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
],
)
: const SizedBox(),
],
],
),
),
],
).expanded,
DefaultButton(LocaleKeys.proceedBooking.tr(), () {
if (widget.url != null && widget.jwtToken != null) {
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => SsoLoginWebView(url: widget.url, jwtToken: widget.jwtToken, ssoType: SsoType.forTicket)));

@ -83,8 +83,7 @@ class ApprovalLevelfragment extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(history.name ?? history.approvalLevel ?? "").toText16(),
// history.name!.toText16(),
history.name!.toText16(),
if ((history.notes ?? "").isNotEmpty) history.notes!.toText12(color: MyColors.grey57Color),
4.height,
Row(

@ -22,7 +22,6 @@ import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheets/worklist_advance_search_bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
import 'package:mohem_flutter_app/widgets/sso_webview_widget.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -152,7 +151,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
final ScrollController _controller = ScrollController();
int pNotificationType = 1;
String prPoFilterText = "";
ScrollController? _scrollController;
@override
@ -320,7 +318,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
}
if (workListItemIndex != index && !workListItemTypes[index].disable) {
workListItemIndex = index;
prPoFilterText = "";
pageNumber = 1;
if (workListItemTypes[index].value == 0) {
workList = [];
@ -355,20 +352,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
.paddingOnly(left: 21, right: 21),
],
),
if (_isPrOrPoSelected())
DynamicTextFieldWidget(
"",
_getPrPoFilterHint(),
isEnable: true,
isPopup: false,
lines: 1,
isInputTypeNum: false,
isReadOnly: false,
onChange: (String value) {
prPoFilterText = value;
setState(() {});
},
).paddingOnly(left: 21, right: 21, top: 10),
SmartRefresher(
enablePullDown: true,
enablePullUp: false,
@ -421,16 +404,16 @@ class _WorkListScreenState extends State<WorkListScreen> {
],
)
: workList != null
? ((_getDisplayedWorkList()).isEmpty
? ((workList!).isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: 100)
: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return rowItem(workListItemTypes[workListItemIndex!], _getDisplayedWorkList()[index], index);
return rowItem(workListItemTypes[workListItemIndex!], workList![index], index);
},
separatorBuilder: (context, index) => 12.height,
itemCount: _getDisplayedWorkList().length,
itemCount: workList?.length ?? 0,
padding: const EdgeInsets.all(21),
))
: const SizedBox(),
@ -524,7 +507,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
}
}
Utils.showLoading(context);
List<WorkListResponseModel>? responseList = await WorkListApiClient().getWorkList(
workList = await WorkListApiClient().getWorkList(
pageNumber,
selectedItemTypeID,
selectedViewID.toString(),
@ -533,8 +516,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
pSentDate: searchByDate,
pSearchItemType: searchByInput,
);
workList = responseList;
prPoFilterText = "";
workListItemIndex = index;
AppState().setWorkList = workList;
Utils.hideLoading(context);
@ -544,35 +525,11 @@ class _WorkListScreenState extends State<WorkListScreen> {
);
}
bool _isPrOrPoSelected() {
if (workListItemIndex == null) return false;
String key = workListItemTypes[workListItemIndex!].key ?? "";
return key == "REQAPPRV" || key == "POAPPRV";
}
List<WorkListResponseModel> _getDisplayedWorkList() {
List<WorkListResponseModel> source = workList ?? [];
if (!_isPrOrPoSelected()) return source;
String query = prPoFilterText.trim().toLowerCase();
if (query.isEmpty) return source;
return source.where((item) => (item.sUBJECT ?? "").toLowerCase().contains(query)).toList();
}
String _getPrPoFilterHint() {
if (workListItemIndex == null) return "filterEnterPrDetailsHere".tr();
String key = workListItemTypes[workListItemIndex!].key;
if (key == "POAPPRV") {
return "filterEnterPoDetailsHere".tr();
}
return "filterEnterPrDetailsHere".tr();
}
Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData, int index) {
return InkWell(
onTap: () async {
AppState().setWorkListIndex = index;
var data = workData;
var data = workList![index];
var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.workListDetail, arguments: workData);
if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") {
@ -585,7 +542,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
setState(() {});
}
} else {
workList!.removeWhere((item) => item.nOTIFICATIONID == data.nOTIFICATIONID);
workList!.remove(data);
AppState().setWorkList = workList;
if (data.iTEMTYPE == "ITG") {
} else {

@ -602,7 +602,6 @@ class InfoFragment extends StatelessWidget {
ItemDetailViewCol(
LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""),
),
Column(
children: getPRHeaderValues(),
)

@ -13,8 +13,7 @@ import 'package:mohem_flutter_app/models/get_item_creation_ntf_body_list_model.d
import 'package:mohem_flutter_app/models/get_mo_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_pr_information_list.dart';
import 'package:mohem_flutter_app/models/get_pr_notification_body_list_model.dart'
as get_pr_notification_body_list_model;
import 'package:mohem_flutter_app/models/get_pr_notification_body_list_model.dart' as get_pr_notification_body_list_model;
import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
@ -52,465 +51,250 @@ class RequestFragment extends StatelessWidget {
Widget poLinesDataView(BuildContext context) {
return ExpandableNotifier(
child: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder:
(cxt, index) =>
ExpandablePanel(
header: poLinesList[index].iTEMDESCRIPTION!.toText14(),
collapsed: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.code.tr(),
poLinesList[index].iTEMCODE ?? "",
),
ItemDetailViewCol(
LocaleKeys.mfg.tr(),
poLinesList[index].mFG ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.lineType.tr(),
poLinesList[index].lINETYPE?.toString() ?? "",
),
ItemDetailViewCol(
LocaleKeys.unit.tr(),
poLinesList[index].uOM ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.price.tr(),
poLinesList[index].uNITPRICE?.toString() ?? "",
),
ItemDetailViewCol(
LocaleKeys.lineAmount.tr(),
poLinesList[index].lINEAMOUNT?.toString() ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.quantity.tr(),
poLinesList[index].qUANTITY?.toString() ?? "",
),
ItemDetailViewCol(
LocaleKeys.lineDiscount.tr(),
poLinesList[index].lINEDISCPERCENTAGE?.toString() ??
"",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.needByDate.tr(),
poLinesList[index].nEEDBYDATE ?? "",
),
ItemDetailViewCol(
LocaleKeys.promisedDate.tr(),
poLinesList[index].pROMISEDDATE ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.deliverToLocation.tr(),
poLinesList[index].dELIVERTOLOCATION ?? "",
),
ItemDetailViewCol(
LocaleKeys.requisitionNumber.tr(),
poLinesList[index].pRNUM ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.requester.tr(),
poLinesList[index].rEQUESTOR ?? "",
),
Container(),
),
12.height,
Row(
children: [
DefaultButton(LocaleKeys.itemHistory.tr(), () {
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ExpandablePanel(
header: poLinesList[index].iTEMDESCRIPTION!.toText14(),
collapsed: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.code.tr(), poLinesList[index].iTEMCODE ?? ""),
ItemDetailViewCol(LocaleKeys.mfg.tr(), poLinesList[index].mFG ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.lineType.tr(), poLinesList[index].lINETYPE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.unit.tr(), poLinesList[index].uOM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.price.tr(), poLinesList[index].uNITPRICE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.lineAmount.tr(), poLinesList[index].lINEAMOUNT?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quantity.tr(), poLinesList[index].qUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.lineDiscount.tr(), poLinesList[index].lINEDISCPERCENTAGE?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.needByDate.tr(), poLinesList[index].nEEDBYDATE ?? ""),
ItemDetailViewCol(LocaleKeys.promisedDate.tr(), poLinesList[index].pROMISEDDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.deliverToLocation.tr(), poLinesList[index].dELIVERTOLOCATION ?? ""),
ItemDetailViewCol(LocaleKeys.requisitionNumber.tr(), poLinesList[index].pRNUM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requester.tr(), poLinesList[index].rEQUESTOR ?? ""),
Container(),
),
12.height,
Row(
children: [
DefaultButton(
LocaleKeys.itemHistory.tr(),
() {
Navigator.pushNamed(
cxt,
AppRoutes.itemHistory,
arguments: ItemHistoryScreenParams(
title: LocaleKeys.itemHistory.tr(),
isMO: false,
pItemId: poLinesList[index].iTEMID,
),
arguments: ItemHistoryScreenParams(title: LocaleKeys.itemHistory.tr(), isMO: false, pItemId: poLinesList[index].iTEMID),
);
}, fontSize: 13).expanded,
12.width,
DefaultButton(LocaleKeys.quotationAnalysis.tr(), () {
},
fontSize: 13,
).expanded,
12.width,
DefaultButton(
LocaleKeys.quotationAnalysis.tr(),
() {
Navigator.pushNamed(
cxt,
AppRoutes.itemHistory,
arguments: ItemHistoryScreenParams(
isItemHistory: false,
isMO: false,
title: LocaleKeys.quotationAnalysis.tr(),
pItemId: poLinesList[index].iTEMID,
pPoHeaderId: poLinesList[index].pOHEADERID,
),
);
}, fontSize: 13).expanded,
12.width,
DefaultButton("PR Details", () {
getPRDetails(
context,
poLinesList[index].pOLINEID.toString(),
isItemHistory: false, isMO: false, title: LocaleKeys.quotationAnalysis.tr(), pItemId: poLinesList[index].iTEMID, pPoHeaderId: poLinesList[index].pOHEADERID),
);
}, fontSize: 13).expanded,
],
),
],
),
expanded: const SizedBox(),
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: poLinesList.length,
),
},
fontSize: 13,
).expanded,
12.width,
DefaultButton(
"PR Details",
() {
getPRDetails(context, poLinesList[index].pOLINEID.toString());
},
fontSize: 13,
).expanded,
],
)
],
),
expanded: const SizedBox(),
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: poLinesList.length),
);
}
Widget prLinesDataView() {
return ExpandableNotifier(
child: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder:
(cxt, index) =>
ExpandablePanel(
header: prLinesList[index].dESCRIPTION.toString().toText14(
color: MyColors.textMixColor,
),
collapsed: Column(
children: [
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.costCenter.tr(),
prLinesList[index].cOSTCENTER ?? "",
),
ItemDetailViewCol(
LocaleKeys.code.tr(),
prLinesList[index].iTEMCODE ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.unit.tr(),
prLinesList[index].uOM ?? "",
),
ItemDetailViewCol(
LocaleKeys.priceSAR.tr(),
prLinesList[index].uNITPRICE.toString() ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.amountSAR.tr(),
prLinesList[index].lINEAMOUNT.toString() ?? "",
),
ItemDetailViewCol(
LocaleKeys.quantity.tr(),
prLinesList[index].qUANTITY.toString() ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.destination_type.tr(),
prLinesList[index].dESTINATIONTYPE ?? "",
),
ItemDetailViewCol(
LocaleKeys.destination_organization_name.tr(),
prLinesList[index].dESTINATIONORGANIZATIONNAME ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.amuLastThreeMonths.tr(),
prLinesList[index].iTEMAMU.toString() ?? "",
),
Container(),
isItLast: true,
),
// ItemDetailGrid(
// ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""),
// Container(),
// isItLast: true,
// ),
],
),
expanded: const SizedBox(),
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: prLinesList.length,
),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ExpandablePanel(
header: prLinesList[index].dESCRIPTION.toString().toText14(color: MyColors.textMixColor),
collapsed: Column(
children: [
ItemDetailGrid(
ItemDetailViewCol("Cost Center", prLinesList[index].cOSTCENTER ?? ""),
ItemDetailViewCol("Code", prLinesList[index].iTEMCODE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol("Unit", prLinesList[index].uOM ?? ""),
ItemDetailViewCol("Price (SAR)", prLinesList[index].uNITPRICE.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol("Amount (SAR)", prLinesList[index].lINEAMOUNT.toString() ?? ""),
ItemDetailViewCol("Quantity", prLinesList[index].qUANTITY.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol("AMU (Last 3 months)", prLinesList[index].iTEMAMU.toString() ?? ""),
Container(),
isItLast: true,
),
// ItemDetailGrid(
// ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""),
// Container(),
// isItLast: true,
// ),
],
),
expanded: const SizedBox(),
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: prLinesList.length),
);
}
Widget moNotificationDataView() {
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder:
(cxt, index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.code.tr(),
moNotificationBodyList[index].iTEMCODE ?? "",
),
ItemDetailViewCol(
LocaleKeys.unit.tr(),
moNotificationBodyList[index].uOM ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.quantity.tr(),
moNotificationBodyList[index].qUANTITY?.toString() ?? "",
),
ItemDetailViewCol(
LocaleKeys.dateRequired.tr(),
moNotificationBodyList[index].dATEREQUIRED ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.lineStatus.tr(),
moNotificationBodyList[index].lINESTATUS ?? "",
),
ItemDetailViewCol(
LocaleKeys.statusDate.tr(),
moNotificationBodyList[index].sTATUSDATE ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.transactionType.tr(),
moNotificationBodyList[index].tRANSACTIONTYPENAME ?? "",
),
ItemDetailViewCol(
LocaleKeys.operatingUnit.tr(),
moNotificationBodyList[index].oPERATINGUNIT ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.organizationCode.tr(),
moNotificationBodyList[index].oRGANIZATIONCODE ?? "",
),
ItemDetailViewCol(
LocaleKeys.organization.tr(),
moNotificationBodyList[index].oRGANIZATIONNAME ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.fromSubInventory.tr(),
moNotificationBodyList[index].fROMSUBINVENTORY ?? "",
),
ItemDetailViewCol(
LocaleKeys.fromLocator.tr(),
moNotificationBodyList[index].fROMLOCATOR ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.toSubInventory.tr(),
moNotificationBodyList[index].tOSUBINVENTORY ?? "",
),
ItemDetailViewCol(
LocaleKeys.toLocator.tr(),
moNotificationBodyList[index].tOLOCATOR ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.shipToLocator.tr(),
moNotificationBodyList[index].sHIPTOLOCATION ?? "",
),
Container(),
),
12.height,
DefaultButton(LocaleKeys.itemHistory.tr(), () {
Navigator.pushNamed(
cxt,
AppRoutes.itemHistory,
arguments: ItemHistoryScreenParams(
title: LocaleKeys.itemHistory.tr(),
pItemId: moNotificationBodyList[index].iTEMID,
pOrgId: moNotificationBodyList[index].oRGID,
),
);
}),
],
).objectContainerView(
title: moNotificationBodyList[index].dESCRIPTION ?? "",
),
separatorBuilder: (cxt, index) => 12.height,
itemCount: moNotificationBodyList.length,
);
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.code.tr(), moNotificationBodyList[index].iTEMCODE ?? ""),
ItemDetailViewCol(LocaleKeys.unit.tr(), moNotificationBodyList[index].uOM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quantity.tr(), moNotificationBodyList[index].qUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.dateRequired.tr(), moNotificationBodyList[index].dATEREQUIRED ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.lineStatus.tr(), moNotificationBodyList[index].lINESTATUS ?? ""),
ItemDetailViewCol(LocaleKeys.statusDate.tr(), moNotificationBodyList[index].sTATUSDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.transactionType.tr(), moNotificationBodyList[index].tRANSACTIONTYPENAME ?? ""),
ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), moNotificationBodyList[index].oPERATINGUNIT ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.organizationCode.tr(), moNotificationBodyList[index].oRGANIZATIONCODE ?? ""),
ItemDetailViewCol(LocaleKeys.organization.tr(), moNotificationBodyList[index].oRGANIZATIONNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.fromSubInventory.tr(), moNotificationBodyList[index].fROMSUBINVENTORY ?? ""),
ItemDetailViewCol(LocaleKeys.fromLocator.tr(), moNotificationBodyList[index].fROMLOCATOR ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.toSubInventory.tr(), moNotificationBodyList[index].tOSUBINVENTORY ?? ""),
ItemDetailViewCol(LocaleKeys.toLocator.tr(), moNotificationBodyList[index].tOLOCATOR ?? ""),
),
ItemDetailGrid(ItemDetailViewCol(LocaleKeys.shipToLocator.tr(), moNotificationBodyList[index].sHIPTOLOCATION ?? ""), Container()),
12.height,
DefaultButton(LocaleKeys.itemHistory.tr(), () {
Navigator.pushNamed(
cxt,
AppRoutes.itemHistory,
arguments: ItemHistoryScreenParams(title: LocaleKeys.itemHistory.tr(), pItemId: moNotificationBodyList[index].iTEMID, pOrgId: moNotificationBodyList[index].oRGID),
);
})
],
).objectContainerView(title: moNotificationBodyList[index].dESCRIPTION ?? ""),
separatorBuilder: (cxt, index) => 12.height,
itemCount: moNotificationBodyList.length);
}
Widget itemCreationLinesView() {
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder:
(cxt, index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.productName.tr(),
itemCreationLines[index].pRODUCTNAME ?? "",
),
ItemDetailViewCol(
LocaleKeys.productDescription.tr(),
itemCreationLines[index].pRODUCTDESCRIPTION ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.unitPrice.tr(),
itemCreationLines[index].uNITPRICE?.toString() ?? "",
),
ItemDetailViewCol(
LocaleKeys.manufacturerName.tr(),
itemCreationLines[index].uSERMANUFACTURERNAME ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.manufacturerPartName.tr(),
itemCreationLines[index].uSERMFGPARTNUM ?? "",
),
ItemDetailViewCol(
LocaleKeys.supplierName.tr(),
itemCreationLines[index].sUPPLIERNAME ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.supplierContact.tr(),
itemCreationLines[index].sUPPLIERCONTACT ?? "",
),
ItemDetailViewCol(
LocaleKeys.chargeToPatient.tr(),
itemCreationLines[index].cHARGETOPATIENT ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.justification.tr(),
itemCreationLines[index].jUSTIFICATION ?? "",
),
ItemDetailViewCol(
LocaleKeys.itemCode.tr(),
itemCreationLines[index].iTEMCODE ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.itemDescription.tr(),
itemCreationLines[index].iTEMDESCRIPTION ?? "",
),
ItemDetailViewCol(
LocaleKeys.groupCode.tr(),
itemCreationLines[index].iTEMGROUPCODE ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.groupDescription.tr(),
itemCreationLines[index].iTEMGROUP ?? "",
),
ItemDetailViewCol(
LocaleKeys.subgroupCode.tr(),
itemCreationLines[index].iTEMSUBGROUPCODE ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.subgroupDescription.tr(),
itemCreationLines[index].iTEMSUBGROUP ?? "",
),
ItemDetailViewCol(
LocaleKeys.primaryUOM.tr(),
itemCreationLines[index].pRIMARYUOM ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.manufacturerName.tr(),
itemCreationLines[index].sTANDARDMANUFACTURERNAME ?? "",
),
ItemDetailViewCol(
LocaleKeys.manufacturerPartName.tr(),
itemCreationLines[index].sTANDARDMFGPARTNUM ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.templateName.tr(),
itemCreationLines[index].tEMPLATENAME ?? "",
),
ItemDetailViewCol(
LocaleKeys.itemCreationStatus.tr(),
itemCreationLines[index].iTEMCREATIONSTATUS ?? "",
),
),
ItemDetailGrid(
ItemDetailViewCol(
LocaleKeys.standardizationApprovalStatus.tr(),
itemCreationLines[index].sTANDARDSTATUS ?? "",
),
ItemDetailViewCol(
LocaleKeys.standardizationApprovalRejectionReason.tr(),
itemCreationLines[index].sTANDARDREJECTREASON ?? "",
),
isItLast: true,
),
],
).objectContainerView(
title: itemCreationLines[index].iTEMDESCRIPTION!,
),
separatorBuilder: (cxt, index) => 12.height,
itemCount: itemCreationLines.length,
);
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.productName.tr(), itemCreationLines[index].pRODUCTNAME ?? ""),
ItemDetailViewCol(LocaleKeys.productDescription.tr(), itemCreationLines[index].pRODUCTDESCRIPTION ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.unitPrice.tr(), itemCreationLines[index].uNITPRICE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].uSERMANUFACTURERNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].uSERMFGPARTNUM ?? ""),
ItemDetailViewCol(LocaleKeys.supplierName.tr(), itemCreationLines[index].sUPPLIERNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.supplierContact.tr(), itemCreationLines[index].sUPPLIERCONTACT ?? ""),
ItemDetailViewCol(LocaleKeys.chargeToPatient.tr(), itemCreationLines[index].cHARGETOPATIENT ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.justification.tr(), itemCreationLines[index].jUSTIFICATION ?? ""),
ItemDetailViewCol(LocaleKeys.itemCode.tr(), itemCreationLines[index].iTEMCODE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.itemDescription.tr(), itemCreationLines[index].iTEMDESCRIPTION ?? ""),
ItemDetailViewCol(LocaleKeys.groupCode.tr(), itemCreationLines[index].iTEMGROUPCODE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.groupDescription.tr(), itemCreationLines[index].iTEMGROUP ?? ""),
ItemDetailViewCol(LocaleKeys.subgroupCode.tr(), itemCreationLines[index].iTEMSUBGROUPCODE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.subgroupDescription.tr(), itemCreationLines[index].iTEMSUBGROUP ?? ""),
ItemDetailViewCol(LocaleKeys.primaryUOM.tr(), itemCreationLines[index].pRIMARYUOM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].sTANDARDMANUFACTURERNAME ?? ""),
ItemDetailViewCol(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].sTANDARDMFGPARTNUM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.templateName.tr(), itemCreationLines[index].tEMPLATENAME ?? ""),
ItemDetailViewCol(LocaleKeys.itemCreationStatus.tr(), itemCreationLines[index].iTEMCREATIONSTATUS ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.standardizationApprovalStatus.tr(), itemCreationLines[index].sTANDARDSTATUS ?? ""),
ItemDetailViewCol(LocaleKeys.standardizationApprovalRejectionReason.tr(), itemCreationLines[index].sTANDARDREJECTREASON ?? ""),
isItLast: true,
),
],
).objectContainerView(title: itemCreationLines[index].iTEMDESCRIPTION!),
separatorBuilder: (cxt, index) => 12.height,
itemCount: itemCreationLines.length);
}
void getPRDetails(BuildContext context, String poLineID) async {
try {
Utils.showLoading(context);
GetPRInformationList? getPRInformationList = GetPRInformationList();
getPRInformationList = await WorkListApiClient().getPRDetailsForPO(
poLineID,
);
getPRInformationList = await WorkListApiClient().getPRDetailsForPO(poLineID);
Utils.hideLoading(context);
Navigator.pushNamed(
context,
AppRoutes.itemHistory,
arguments: ItemHistoryScreenParams(
isItemHistory: false,
isMO: false,
isPRInfo: true,
getPRInformationList: getPRInformationList,
title: "PR Details",
pItemId: 0,
pPoHeaderId: 0,
pOLineID: poLineID,
),
isItemHistory: false, isMO: false, isPRInfo: true, getPRInformationList: getPRInformationList, title: "PR Details", pItemId: 0, pPoHeaderId: 0, pOLineID: poLineID),
);
} catch (ex) {
Utils.hideLoading(context);

@ -11,7 +11,7 @@ import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
class WorkListAdvanceSearch extends StatefulWidget {
final Function(int, String, String, String) onSearch;
Function(int, String, String, String) onSearch;
WorkListAdvanceSearch(this.onSearch, {Key? key}) : super(key: key);

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:webview_flutter/webview_flutter.dart';
// Enum for SSO types
@ -20,19 +19,6 @@ class SsoLoginWebView extends StatefulWidget {
class _SsoLoginWebViewState extends State<SsoLoginWebView> {
late final WebViewController _controller;
String? url;
bool _isTicketLoadingVisible = false;
void _showTicketLoading() {
if (widget.ssoType != SsoType.forTicket || _isTicketLoadingVisible || !mounted) return;
_isTicketLoadingVisible = true;
Utils.showLoading(context);
}
void _hideTicketLoading() {
if (widget.ssoType != SsoType.forTicket || !_isTicketLoadingVisible || !mounted) return;
_isTicketLoadingVisible = false;
Utils.hideLoading(context);
}
@override
void initState() {
@ -53,19 +39,15 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
},
onPageStarted: (String url) {
print("Page started loading: $url");
_showTicketLoading();
},
onPageFinished: (String url) {
print("Page finished loading: $url");
_hideTicketLoading();
},
onHttpError: (HttpResponseError error) {
print("HTTP error: ${error.toString()} for URL: ${error.response!.statusCode}");
_hideTicketLoading();
},
onWebResourceError: (WebResourceError error) {
print("Web resource error: ${error.description} for URL: ${error.errorType}");
_hideTicketLoading();
},
),
);
@ -75,11 +57,6 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
// For ENSAT, just load the URL directly (GET request)
_controller.loadRequest(Uri.parse(url!));
} else {
if (widget.ssoType == SsoType.forTicket) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_showTicketLoading();
});
}
// For Paxes (Ticket, Courses), use HTML form POST
_controller.loadHtmlString(_buildHtmlContent());
}
@ -87,12 +64,8 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
// Build HTML content for the SSO form
String _buildHtmlContent() {
String formAction;
if (widget.ssoType == SsoType.forTicket) {
formAction = "https://www.paxes.com/sso/hmg";
} else {
formAction = url ?? "";
}
String formAction = url ?? "https://www.paxes.com/sso/hmg";
return '''
<!DOCTYPE html>
<html>
@ -105,14 +78,8 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
</html>''';
}
@override
void dispose() {
_hideTicketLoading();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(appBar: AppBarWidget(context, title: "MoheM", showWorkListSettingButton: false), body: SafeArea(child: WebViewWidget(controller: _controller)));
return Scaffold(appBar: null, body: SafeArea(child: WebViewWidget(controller: _controller)));
}
}

Loading…
Cancel
Save