Compare commits

...

14 Commits

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.20'
ext.kotlin_version = '1.8.20'
repositories {
google()
mavenCentral()

@ -4,7 +4,10 @@
"arabic": "عربي",
"login": "تسجيل الدخول",
"pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول",
"userId": "UserID",
"username": "اسم المستخدم",
"userName": "اسم المستخدم",
"userSearch": "User Search",
"password": "كلمة المرور",
"welcomeBack": "مرحبا بعودتك",
"wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟",
@ -542,9 +545,33 @@
"missingDocuments": "مستندات مفقودة",
"uploadedDocuments": "المستندات التي تم تحميلها",
"addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.",
"pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون",
"youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني",
"open": "يفتح",
"youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني",
"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": "عام",
"requesterOperatingUnit":"وحدة تشغيل مقدم الطلب",
"prepareEmpNum":"إعداد رقم الموظف",
"supplierInfo" : "معلومات المورد",
@ -558,6 +585,30 @@
"patientName" : "اسم المريض",
"invoiceDate" : "تاريخ الفاتورة",
"refundInvoice" :"فاتورة الاسترجاع",
"hospitalClinic" : "عيادة المستشفى"
"hospitalClinic" : "عيادة المستشفى",
"graphicalAnalysis": "التحليل الرسومي",
"itemHistoryAnalysis": "تحليل تاريخ العنصر",
"pOno": "امر شراء #",
"oprUnit": "وحدة التشغيل",
"qtyOrdered": "الكمية المطلوبة",
"qtyReceived": "الكمية المستلمة",
"bonusQty": "كمية المكافأة",
"balQty": "كمية التوازن",
"videoCall": "مكالمة فيديو",
"addUsers": "إضافة مستخدمين إلى المجموعة",
"admin": "مشرف",
"areYouSureWantTodelete": "هل أنت متأكد أنك تريد الحذف؟",
"Attendance": "الحضور",
"audioCall": "مكالمة صوتية",
"editGroups": "تعديل المجموعة",
"enterGroupName": "يرجى إدخال اسم المجموعة الصحيح",
"enterGroupNamePlease": "يرجى إدخال اسم المجموعة",
"groupMembers": "أعضاء المجموعة",
"groupName": "اسم المجموعة",
"groupNameshouldbe": "يجب أن يتكون اسم المجموعة من 10 أحرف على الأقل",
"manage": "إدارة",
"manageGroup": "إدارة المجموعة",
"members": "الأعضاء",
"searchByUserName": "البحث بواسطة اسم المستخدم",
"shareScreen": "مشاركة الشاشة"
}

@ -303,6 +303,7 @@
"section": "Section",
"topic": "Topic",
"actionBy": "Action By",
"pending": "Pending",
"pendingTransactions": "Pending Transactions",
"selectRequestType": "Please select request type",
"dateFrom": "Date From",
@ -565,6 +566,30 @@
"pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.",
"youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.",
"requesterOperatingUnit":"Requester Operating Unit",
"paymentRequest": "Pay Request",
"paymentDetails": "Payment Details",
"requestNo": "Request No",
"requesterEmpNum": "Requester Employee Num",
"requesterEmpName": "Requester Employee Name",
"prepareEmpName": "Prepare Employee Name",
"requesterPositionName": "Requester Position Name",
"preparePositionName": "Prepare Position Name",
"requesterPayrollName": "Requester Payroll Name",
"payingORGName": "Paying Organization Name",
"requestAmount": "Request Amount",
"typeofPayment": "Type of Payment",
"beneficiaryDetails": "Beneficiary Details",
"beneficiaryName": "Beneficiary Name",
"idIqama": "Saudi ID / Iqama",
"beneficiaryBankName": "Beneficiary Bank Name",
"sadadNumber": "Sadad Number",
"beneficiaryIBAN": "Beneficiary IBAN",
"purchaseOrders": "Purchase Orders",
"approvalDate": "Approval Date",
"pOAmount": "PO Amount",
"versionStatus": "Version Status",
"supplierNo": "Supplier No",
"general": "General",
"prepareEmpNum":"Prepare Employee Num",
"supplierInfo" : "Supplier Information",
"supplierAcNo": "Supplier Account No",
@ -577,6 +602,13 @@
"patientName" : "Patient Name",
"invoiceDate" : "Invoice Date",
"refundInvoice" :"Refund Invoice",
"hospitalClinic" : "Hospital Clinic"
"hospitalClinic" : "Hospital Clinic",
"graphicalAnalysis": "Graphical Analysis",
"itemHistoryAnalysis": "Item History Analysis",
"pOno": "P.O #",
"oprUnit": "Opr. Unit",
"qtyOrdered": "Qty. Ordered",
"qtyReceived": "Qty. Received",
"bonusQty": "Bonus Qty.",
"balQty": "Bal. Qty."
}

@ -40,14 +40,19 @@ class MyAttendanceApiClient {
}, url, postParams);
}
Future<List<ESERVICESVS>> getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List<Map<String, dynamic>> list, {String? empID, String? parentValue}) async {
Future<List<ESERVICESVS>> getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List<Map<String, dynamic>> list,
{String? empID, String? parentValue, bool hasParent = false}) async {
String url = "${ApiConsts.erpRest}GET_VALUE_SET_VALUES";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_PAGE_LIMIT": 1000,
"P_PAGE_NUM": 1,
"P_PARENT_VALUE": empID != null ? parentValue : null,
"P_PARENT_VALUE": hasParent
? parentValue
: empID != null
? parentValue
: null,
"P_SEGMENT_NAME": pSegmentName,
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
"P_DESC_FLEX_NAME": pDescFlexName,

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

@ -7,7 +7,7 @@ class ApiConsts {
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrl = "https://mohemm.hmg.com"; // New Live server

File diff suppressed because it is too large Load Diff

@ -6,7 +6,10 @@ abstract class LocaleKeys {
static const arabic = 'arabic';
static const login = 'login';
static const pleaseEnterLoginDetails = 'pleaseEnterLoginDetails';
static const userId = 'userId';
static const username = 'username';
static const userName = 'userName';
static const userSearch = 'userSearch';
static const password = 'password';
static const welcomeBack = 'welcomeBack';
static const wouldYouLikeToLoginWithCurrentUsername = 'wouldYouLikeToLoginWithCurrentUsername';
@ -403,7 +406,6 @@ abstract class LocaleKeys {
static const purchaseOrder = 'purchaseOrder';
static const ITGForms = 'ITGForms';
static const itemCreation = 'itemCreation';
static const paymentRequest = 'paymentRequest';
static const stamp = 'stamp';
static const addFavoriteList = 'addFavoriteList';
static const feedbackUserExperience = 'feedbackUserExperience';
@ -527,67 +529,73 @@ abstract class LocaleKeys {
static const expiredDocuments = 'expiredDocuments';
static const missingDocuments = 'missingDocuments';
static const uploadedDocuments = 'uploadedDocuments';
static const manage = 'manage';
static const members = 'members';
static const areYouSureWantTodelete = 'areYouSureWantTodelete';
static const groupMembers = "groupMembers";
static const manageGroup = "manageGroup";
static const admin = "admin";
static const addUsers ="addUsers";
static const editGroups ="editGroups";
static const groupNameshouldbe ="groupNameshouldbe";
static const enterGroupName ="enterGroupName";
static const groupName ="groupName";
static const enterGroupNamePlease ="enterGroupNamePlease";
static const audioCall = 'audioCall';
static const videoCall ='videoCall';
static const shareScreen ='shareScreen';
static const searchByUserName ='searchByUserName';
static const userSearch ='userSearch';
static const userName ='userName';
static const userId ='userId';
static const addAtLeastOneAttachment ='addAtLeastOneAttachment';
static const pleaseClickButtonToJoinMarathon ='pleaseClickButtonToJoinMarathon';
static const youCannotJoinTheMarathon ='youCannotJoinTheMarathon';
static const open ='open';
static const addAtLeastOneAttachment = 'addAtLeastOneAttachment';
static const open = 'open';
static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon';
static const pleaseClickButtonToJoinMarathon = 'pleaseClickButtonToJoinMarathon';
static const generate = 'generate';
static const paymentDetails ='paymentDetails';
static const requestNo ='requestNo';
static const requesterEmpNum ='requesterEmpNum';
static const requesterEmpName ='requesterEmpName';
static const prepareEmpName ='prepareEmpName';
static const requesterPositionName ='requesterPositionName';
static const preparePositionName ='preparePositionName';
static const requesterPayrollName ='requesterPayrollName';
static const payingORGName ='payingORGName';
static const requestAmount ='requestAmount';
static const typeofPayment ='typeofPayment';
static const beneficiaryDetails ='beneficiaryDetails';
static const beneficiaryName ='beneficiaryName';
static const idIqama ='idIqama';
static const beneficiaryBankName ='beneficiaryBankName';
static const sadadNumber ='sadadNumber';
static const beneficiaryIBAN ='beneficiaryIBAN';
static const purchaseOrders ='purchaseOrders';
static const pOAmount ='pOAmount';
static const approvalDate ='approvalDate';
static const versionStatus ='versionStatus';
static const supplierNo ='supplierNo';
static const general ="general";
static const paymentRequest = 'paymentRequest';
static const paymentDetails = 'paymentDetails';
static const requestNo = 'requestNo';
static const requesterEmpNum = 'requesterEmpNum';
static const requesterEmpName = 'requesterEmpName';
static const prepareEmpName = 'prepareEmpName';
static const requesterPositionName = 'requesterPositionName';
static const preparePositionName = 'preparePositionName';
static const requesterPayrollName = 'requesterPayrollName';
static const payingORGName = 'payingORGName';
static const requestAmount = 'requestAmount';
static const typeofPayment = 'typeofPayment';
static const beneficiaryDetails = 'beneficiaryDetails';
static const beneficiaryName = 'beneficiaryName';
static const idIqama = 'idIqama';
static const beneficiaryBankName = 'beneficiaryBankName';
static const sadadNumber = 'sadadNumber';
static const beneficiaryIBAN = 'beneficiaryIBAN';
static const purchaseOrders = 'purchaseOrders';
static const approvalDate = 'approvalDate';
static const pOAmount = 'pOAmount';
static const versionStatus = 'versionStatus';
static const supplierNo = 'supplierNo';
static const general = 'general';
static const requesterOperatingUnit = 'requesterOperatingUnit';
static const prepareEmpNum = 'prepareEmpNum';
static const supplierInfo = 'supplierInfo';
static const supplierAcNo = 'supplierAcNo';
static const supplierAcName = 'supplierAcName';
static const supplierIBAN = 'Supplier IBAN';
static const supplierCRNo = 'CR Number';
static const suppliedAcNo = 'Supplied Account No.';
static const patientRefundInvoice = "patientRefundInvoice";
static const patientNumber = 'Patient Number';
static const patientName = 'Patient Name';
static const invoiceDate = 'Invoice Date';
static const refundInvoice = 'Refund Invoice';
static const hospitalClinic = 'Hospital Clinic';
static const requesterOperatingUnit ='requesterOperatingUnit';
static const prepareEmpNum ='prepareEmpNum';
static const supplierIBAN = 'supplierIBAN';
static const supplierCRNo = 'supplierCRNo';
static const suppliedAcNo = 'suppliedAcNo';
static const patientRefundInvoice = 'patientRefundInvoice';
static const patientNumber = 'patientNumber';
static const patientName = 'patientName';
static const invoiceDate = 'invoiceDate';
static const refundInvoice = 'refundInvoice';
static const hospitalClinic = 'hospitalClinic';
static const graphicalAnalysis = 'graphicalAnalysis';
static const itemHistoryAnalysis = 'itemHistoryAnalysis';
static const pOno = 'pOno';
static const oprUnit = 'oprUnit';
static const qtyOrdered = 'qtyOrdered';
static const qtyReceived = 'qtyReceived';
static const bonusQty = 'bonusQty';
static const balQty = 'balQty';
static const videoCall = 'videoCall';
static const addUsers = 'addUsers';
static const admin = 'admin';
static const areYouSureWantTodelete = 'areYouSureWantTodelete';
static const Attendance = 'Attendance';
static const audioCall = 'audioCall';
static const editGroups = 'editGroups';
static const enterGroupName = 'enterGroupName';
static const enterGroupNamePlease = 'enterGroupNamePlease';
static const groupMembers = 'groupMembers';
static const groupName = 'groupName';
static const groupNameshouldbe = 'groupNameshouldbe';
static const manage = 'manage';
static const manageGroup = 'manageGroup';
static const members = 'members';
static const searchByUserName = 'searchByUserName';
static const shareScreen = 'shareScreen';
}

@ -12,6 +12,7 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/main.dart';
import 'package:mohem_flutter_app/models/itg/advertisement.dart' as ads;
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/my_video_progress_indicator.dart';
import 'package:video_player/video_player.dart';
class ITGAdsScreen extends StatefulWidget {
@ -148,7 +149,33 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
? Lottie.asset(MyLottieConsts.audioPlaybackLottie)
: AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: VideoPlayer(_controller),
child: Stack(
alignment: Alignment.bottomCenter,
children: [
VideoPlayer(_controller),
if (advertisementData?.isOptional ?? false)
Positioned(
top: 4,
right: 8,
child: Container(
padding: const EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 4),
decoration: BoxDecoration(color: Colors.white.withOpacity(0.5), borderRadius: BorderRadius.circular(30)),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(AppState().isArabic(context) ? "يتخطى" : "Skip"),
Icon(Icons.skip_next),
],
),
).onPress(() {
Navigator.pop(context);
DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Skip").then((value) {
logger.d(value);
});
}),
),
],
),
),
),
30.height,
@ -159,70 +186,103 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
textStyle: const TextStyle(color: Colors.white, fontSize: 16, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
50.height,
if (advertisementData?.isOptional ?? false)
DefaultButton(AppState().isArabic(context) ? "يتخطى" : "Skip", () async {
Navigator.pop(context);
DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Skip").then((value) {
logger.d(value);
});
}).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8),
// if (advertisementData?.isOptional ?? false)
// DefaultButton(AppState().isArabic(context) ? "يتخطى" : "Skip", () async {
// Navigator.pop(context);
// DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Skip").then((value) {
// logger.d(value);
// });
// }).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8),
ValueListenableBuilder<bool>(
valueListenable: hasTimerEnded,
builder: (context, val, child) {
if (hasTimerEndedBool) {
return GridView.builder(
padding: EdgeInsets.zero,
itemCount: advertisementData?.actionButtonsColl!.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
String? btnText = AppState().isArabic(context) ? advertisementData?.actionButtonsColl![index].btnTextAr : advertisementData?.actionButtonsColl![index].btnTextEn;
return DefaultButton(btnText!, () async {
// if (hasTimerEndedBool) {
return ListView.builder(
padding: EdgeInsets.zero,
itemCount: advertisementData?.actionButtonsColl!.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
String? btnText = AppState().isArabic(context) ? advertisementData?.actionButtonsColl![index].btnTextAr : advertisementData?.actionButtonsColl![index].btnTextEn;
// bool isAcknowledge = advertisementData?.actionButtonsColl![index].actionButtonId == 11;
bool isAcknowledge = advertisementData?.actionButtonsColl![index].actionButtonId == 17;
if (isAcknowledge) {
return Stack(
alignment: Alignment.center,
children: [
MyVideoProgressIndicator(
_controller,
allowScrubbing: false,
//padding: EdgeInsets.only(left: 60, right: 60),
),
DefaultButton(
btnText!,
hasTimerEndedBool
? () async {
Navigator.pop(context);
DashboardApiClient()
.setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, advertisementData?.actionButtonsColl![index].actionValue)
.then((value) {
logger.d(value);
});
}
: null,
disabledColor: Colors.transparent,
textColor: !hasTimerEndedBool ? Colors.white.withOpacity(.5) : Colors.white,
).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8),
],
);
}
return DefaultButton(
btnText!,
() async {
Navigator.pop(context);
DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, advertisementData?.actionButtonsColl![index].actionValue).then((value) {
logger.d(value);
});
}).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8);
},
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 1,
childAspectRatio: (7.0),
),
);
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Container(padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_up, color: MyColors.gradiantEndColor))
// .onPress(() {
// try {
// Navigator.pop(context);
// DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Like").then((value) {
// logger.d(value);
// });
// } catch (ex) {
// logger.wtf(ex);
// Utils.handleException(ex, context, null);
// }
// }),
// 20.width,
// Container(
// padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_down, color: MyColors.gradiantEndColor))
// .onPress(() {
// try {
// Navigator.pop(context);
// DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Dislike").then((value) {
// logger.d(value);
// });
// } catch (ex) {
// logger.wtf(ex);
// Utils.handleException(ex, context, null);
// }
// }),
// ],
// );
} else {
return Container();
}
},
).paddingOnly(left: 60.0, right: 60.0, top: 8, bottom: 8);
},
// gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 1,
// childAspectRatio: (7.0),
// ),
);
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Container(padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_up, color: MyColors.gradiantEndColor))
// .onPress(() {
// try {
// Navigator.pop(context);
// DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Like").then((value) {
// logger.d(value);
// });
// } catch (ex) {
// logger.wtf(ex);
// Utils.handleException(ex, context, null);
// }
// }),
// 20.width,
// Container(
// padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_down, color: MyColors.gradiantEndColor))
// .onPress(() {
// try {
// Navigator.pop(context);
// DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Dislike").then((value) {
// logger.d(value);
// });
// } catch (ex) {
// logger.wtf(ex);
// Utils.handleException(ex, context, null);
// }
// }),
// ],
// );
// } else {
// return Container();
// }
},
),
20.height,

@ -64,47 +64,56 @@ class _LeaveBalanceState extends State<LeaveBalance> {
context,
title: LocaleKeys.leaveBalance.tr(),
),
body: absenceTransList == null
? const SizedBox()
: (absenceTransList!.isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: 50)
: ListView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true, selectedEmp: employeeId, showLoading: false),
12.height,
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (cxt, int index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.startDateT.tr(), absenceTransList![index].sTARTDATE ?? ""),
ItemDetailViewCol(LocaleKeys.endDateT.tr(), absenceTransList![index].eNDDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.absenceType.tr(), absenceTransList![index].aBSENCETYPE ?? ""),
ItemDetailViewCol(LocaleKeys.absenceCategory.tr(), absenceTransList![index].aBSENCECATEGORY ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.days.tr(), absenceTransList![index].aBSENCEDAYS?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.hours.tr(), absenceTransList![index].aBSENCEHOURS?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvalStatus.tr(), absenceTransList![index].aPPROVALSTATUS ?? ""),
ItemDetailViewCol(LocaleKeys.absenceStatus.tr(), absenceTransList![index].aBSENCESTATUS ?? ""),
isItLast: true,
),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: absenceTransList!.length),
],
)),
body: Column(
children: [
Padding(
padding: const EdgeInsets.all(21.0),
child: BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true, selectedEmp: employeeId, showLoading: false),
),
12.height,
absenceTransList == null
? const SizedBox()
: (absenceTransList!.isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: 50)
: ListView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
children: [
// BalancesDashboardWidget(LocaleKeys.currentLeaveBalance.tr(), true, selectedEmp: employeeId, showLoading: false),
// 12.height,
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (cxt, int index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.startDateT.tr(), absenceTransList![index].sTARTDATE ?? ""),
ItemDetailViewCol(LocaleKeys.endDateT.tr(), absenceTransList![index].eNDDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.absenceType.tr(), absenceTransList![index].aBSENCETYPE ?? ""),
ItemDetailViewCol(LocaleKeys.absenceCategory.tr(), absenceTransList![index].aBSENCECATEGORY ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.days.tr(), absenceTransList![index].aBSENCEDAYS?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.hours.tr(), absenceTransList![index].aBSENCEHOURS?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.approvalStatus.tr(), absenceTransList![index].aPPROVALSTATUS ?? ""),
ItemDetailViewCol(LocaleKeys.absenceStatus.tr(), absenceTransList![index].aBSENCESTATUS ?? ""),
isItLast: true,
),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: absenceTransList!.length),
],
)),
],
),
floatingActionButton: Container(
height: 54,
width: 54,

@ -8,6 +8,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:mohem_flutter_app/api/login_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
@ -30,6 +31,8 @@ import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'package:mohem_flutter_app/models/privilege_list_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart';
import 'package:safe_device/safe_device.dart';
// import 'package:safe_device/safe_device.dart';
import 'package:wifi_iot/wifi_iot.dart';
@ -70,26 +73,26 @@ class _LoginScreenState extends State<LoginScreen> {
super.initState();
// hmsApiAvailability = HmsApiAvailability();
// checkFirebaseToken();
// if (kReleaseMode) {
// checkDeviceSafety();
// }
if (kReleaseMode) {
checkDeviceSafety();
}
}
// void checkDeviceSafety() async {
// try {
// isJailBroken = await SafeDevice.isJailBroken;
// isRealDevice = await SafeDevice.isRealDevice;
// if (Platform.isAndroid) {
// isOnExternalStorage = await SafeDevice.isOnExternalStorage;
// isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable;
// }
// if (isJailBroken || !isRealDevice || isOnExternalStorage || isDevelopmentModeEnable) {
// Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false);
// }
// } catch (error) {
// print(error);
// }
// }
void checkDeviceSafety() async {
try {
isJailBroken = await SafeDevice.isJailBroken;
isRealDevice = await SafeDevice.isRealDevice;
if (Platform.isAndroid) {
isOnExternalStorage = await SafeDevice.isOnExternalStorage;
isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable;
}
if (isJailBroken || !isRealDevice || isOnExternalStorage || isDevelopmentModeEnable) {
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.unsafeDeviceScreen, (_) => false);
}
} catch (error) {
print(error);
}
}
@override
void dispose() {

@ -57,14 +57,10 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
@override
Widget build(BuildContext context) {
if(ModalRoute.of(context)!.settings.arguments != null) {
mobileLoginInfoListModel ??= ModalRoute
.of(context)!
.settings
.arguments as GetMobileLoginInfoListModel;
if (ModalRoute.of(context)!.settings.arguments != null) {
mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments as GetMobileLoginInfoListModel;
// String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!;
String empName = mobileLoginInfoListModel!.employeeName!;
}
return Scaffold(
@ -295,7 +291,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
width: 38,
color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null,
),
_title.toText16(height: 20/16)
_title.toText16(height: 20 / 16)
],
),
),
@ -397,12 +393,10 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
dynamic errorCode = ex;
if(errorCode.error.errorStatusCode ==699){
Future.delayed(const Duration(seconds: 2), ()
{
if (errorCode.error.errorStatusCode == 699) {
Future.delayed(const Duration(seconds: 2), () {
Navigator.pop(context);
Navigator.pushNamedAndRemoveUntil(
context, AppRoutes.login, (Route<dynamic> route) => false);
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false);
});
}
}
@ -419,5 +413,4 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
// // isLoading = isTrue;
// });
// }
}

@ -97,7 +97,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp);
Utils.hideLoading(context);
await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit',isAttachmentMandatory: dynamicParams!.isAttachmentMandatory));
arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit',
isAttachmentMandatory: dynamicParams!.isAttachmentMandatory));
if (!AppState().cancelRequestTrancsection) {
return;
}
@ -133,8 +134,27 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
.toJson())
.toList();
String? selectedEmp = dynamicParams!.selectedEmp;
bool hasParentId = false;
if (segmentId.isNotEmpty && selectedEmp == null) {
for (var element in getEitDffStructureList!) {
try {
if (element.sEGMENTNAME == segmentId && selectedEmp == null) {
var selectedElement = element;
if (selectedElement.vALIDATIONTYPE == "Y" || selectedElement.vALIDATIONTYPE == "D") {
hasParentId = true;
break;
}
}
} catch (ex) {
print("err:$ex");
}
}
}
List<ESERVICESVS> eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values,
empID: dynamicParams!.selectedEmp, parentValue: structureList.eSERVICESDV!.pVALUECOLUMNNAME);
empID: selectedEmp, parentValue: structureList.eSERVICESDV!.pVALUECOLUMNNAME, hasParent: hasParentId);
List<GetEITDFFStructureList> abc = genericResponseModel?.getEITDFFStructureList ?? [];
getEitDffStructureList = abc;
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
@ -862,9 +882,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
context: context,
initialTime: time,
builder: (cxt, child) {
return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: Localizations.override(
context: context,
locale: const Locale('en', 'US'),child: child ?? Container()));
return MediaQuery(
data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: Localizations.override(context: context, locale: const Locale('en', 'US'), child: child ?? Container()));
});
if (picked != null && picked != time) {

@ -32,7 +32,7 @@ class _UnsafeDeviceScreenState extends State<UnsafeDeviceScreen> {
50.height,
"Sorry".toText24(isBold: true),
21.height,
"You are using Mohemm app on an unsafe device. To be able to use the app with all it's features, Please make sure that the below points are considered: "
"You are using MoheM app on an unsafe device. To be able to use the app with all it's features, Please make sure that the below points are considered: "
.toText14(isCenter: true)
.paddingOnly(left: 20.0, right: 20.0),
48.height,

@ -2,7 +2,8 @@ import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:easy_localization/src/public_ext.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart';
@ -60,13 +61,21 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
int tabIndex = 0;
PageController controller = PageController();
final ScrollController _horizontalScrollController = ScrollController();
final ScrollController _horizontalHeaderScrollController = ScrollController();
@override
void initState() {
super.initState();
_horizontalScrollController.addListener(() {
_horizontalHeaderScrollController.jumpTo(_horizontalScrollController.offset);
});
}
@override
void dispose() {
_horizontalScrollController.dispose();
_horizontalHeaderScrollController.dispose();
super.dispose();
actionHistoryList.clear();
}
@ -129,23 +138,231 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
}
}
TableRow rowChildren(GetPoItemHistoryList poData, int index) {
return TableRow(
decoration: BoxDecoration(color: index % 2 == 0 ? Colors.white : Colors.grey[100]),
children: [
rowCell(poData.cREATIONDATE!, index),
rowCell(poData.pURCHASEPRICE!.toString(), index),
rowCell(poData.sUPPLIER!, index),
rowCell(poData.pONUMBER!.toString(), index),
rowCell(poData.oUNAME!, index),
rowCell(poData.rEVISIONNUM!.toString(), index),
rowCell(poData.bUYER!, index),
rowCell(poData.uOM!, index),
rowCell(poData.qUANTITYORDERED!.toString(), index),
rowCell(poData.qUANTITYRECEIVED!.toString(), index),
rowCell(poData.bONUSQUANTITY!.toString(), index),
rowCell(poData.dISCOUNTPERCENTAGE!.toString(), index),
rowCell(poData.bALANCEQUANTITY!.toString(), index),
rowCell(poData.nETPRICE!.toString(), index),
rowCell(poData.cLOSEDCODE!, index),
],
);
}
Widget rowCell(String data, int index) {
return TableCell(
verticalAlignment: TableCellVerticalAlignment.middle,
child: Center(
child: Text(
data,
style: TextStyle(fontSize: 12, color: MyColors.normalTextColor, fontWeight: FontWeight.w500),
),
// data.toText12(color: MyColors.normalTextColor),
).paddingAll(8));
}
Widget headerCell(String data) {
return Container(
padding: const EdgeInsets.only(top: 16, bottom: 16, left: 8, right: 8),
width: 120,
alignment: Alignment.center,
decoration: BoxDecoration(color: Colors.grey[300]),
child: data.toText14(color: MyColors.darkIconColor),
);
}
List<Color> gradientColors = [MyColors.gradiantEndColor, MyColors.gradiantEndColor];
LineChartData drawLineChart(List<FlSpot> spots, List<GetPoItemHistoryList> reversedList) {
return LineChartData(
lineTouchData: LineTouchData(enabled: true, touchTooltipData: LineTouchTooltipData(tooltipBgColor: Colors.grey[300])),
gridData: FlGridData(
show: true,
drawHorizontalLine: true,
drawVerticalLine: true,
verticalInterval: 1,
horizontalInterval: 1,
getDrawingVerticalLine: (value) {
return FlLine(color: Color(0xff37434d), strokeWidth: .3);
},
getDrawingHorizontalLine: (value) {
return FlLine(color: Color(0xff37434d), strokeWidth: .3);
},
),
titlesData: FlTitlesData(
show: true,
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
reservedSize: 30,
interval: 1,
getTitlesWidget: (double value, TitleMeta meta) {
return SideTitleWidget(
axisSide: meta.axisSide,
child: Text(reversedList[int.parse(meta.formattedValue)].cREATIONDATE!, style: TextStyle(fontSize: 10)),
);
})),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
reservedSize: 30,
interval: 1,
getTitlesWidget: (double value, TitleMeta meta) {
return SideTitleWidget(
axisSide: meta.axisSide,
child: Text(meta.formattedValue, style: TextStyle(fontSize: 10)),
);
})),
topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
rightTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
reservedSize: 15,
getTitlesWidget: (double value, TitleMeta meta) {
return SideTitleWidget(
axisSide: meta.axisSide,
child: Text("", style: TextStyle(fontSize: 10)),
);
})),
),
borderData: FlBorderData(show: true, border: Border.all(color: const Color(0xff37434d))),
minX: 0,
maxX: poItemHistoryList.length.toDouble() - 1,
minY: poItemHistoryList.map((e) => e.pURCHASEPRICE!.toDouble()).reduce((curr, next) => curr < next ? curr : next) - 1,
maxY: poItemHistoryList.map((e) => e.pURCHASEPRICE!.toDouble()).reduce((curr, next) => curr > next ? curr : next) + 1,
lineBarsData: [
LineChartBarData(
spots: spots,
isCurved: true,
gradient: LinearGradient(
colors: [
ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!,
ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!,
],
),
barWidth: 2,
isStrokeCapRound: true,
dotData: FlDotData(show: true),
belowBarData: BarAreaData(
show: true,
gradient: LinearGradient(
colors: [
ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!.withOpacity(0.1),
ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!.withOpacity(0.1),
],
),
),
),
],
);
}
@override
Widget build(BuildContext context) {
loadData();
Widget? chartWidget;
if (_screenParams!.isItemHistory && poItemHistoryList.isNotEmpty) {
try {
List<GetPoItemHistoryList> reversedList = poItemHistoryList.reversed.toList();
List<FlSpot> dataPoints = List.generate(
reversedList.length,
(index) => FlSpot(index.toDouble(), reversedList[index].pURCHASEPRICE!.toDouble()),
);
double chartWidth = dataPoints.length * 70.0;
chartWidget = Column(
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.graphicalAnalysis.tr().toText14(color: MyColors.darkIconColor),
SizedBox(
height: 400,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
width: chartWidth,
padding: const EdgeInsets.all(16.0),
child: LineChart(drawLineChart(dataPoints, reversedList)),
),
),
),
],
);
} catch (ex) {}
}
return Scaffold(
appBar: AppBarWidget(context, title: _screenParams?.title ?? ""),
backgroundColor: Colors.white,
body: ListView(
padding: _screenParams!.isPRInfo ? const EdgeInsets.all(0) : const EdgeInsets.all(21),
physics: const NeverScrollableScrollPhysics(),
children: [
if (_screenParams!.isPRInfo) prLinesDataView(),
if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData(),
if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData(),
if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData(),
if (moItemHistoryList.isEmpty && poItemHistoryList.isEmpty && quotationAnalysisList.isEmpty && !_screenParams!.isPRInfo) Utils.getNoDataWidget(context),
],
),
body: (_screenParams!.isItemHistory && poItemHistoryList.isNotEmpty)
? Column(
children: [
if (chartWidget != null) chartWidget,
if (poItemHistoryList.isNotEmpty) ...[
LocaleKeys.itemHistoryAnalysis.tr().toText14(color: MyColors.darkIconColor),
16.height,
SingleChildScrollView(
scrollDirection: Axis.horizontal,
physics: const NeverScrollableScrollPhysics(),
controller: _horizontalHeaderScrollController,
child: Row(
children: [
headerCell(LocaleKeys.creationDate.tr()),
headerCell(LocaleKeys.purchasePrice.tr()),
headerCell(LocaleKeys.supplier.tr()),
headerCell(LocaleKeys.pOno.tr()),
headerCell(LocaleKeys.oprUnit.tr()),
headerCell(LocaleKeys.revision.tr()),
headerCell(LocaleKeys.buyer.tr()),
headerCell(LocaleKeys.uom.tr()),
headerCell(LocaleKeys.qtyOrdered.tr()),
headerCell(LocaleKeys.qtyReceived.tr()),
headerCell(LocaleKeys.bonusQty.tr()),
headerCell(LocaleKeys.discountPer.tr()),
headerCell(LocaleKeys.balQty.tr()),
headerCell(LocaleKeys.netPrice.tr()),
headerCell(LocaleKeys.closureStatus.tr()),
],
),
),
SingleChildScrollView(
scrollDirection: Axis.vertical,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
controller: _horizontalScrollController,
child: Table(
defaultColumnWidth: const FixedColumnWidth(120.0),
children: [for (int index = 0; index < poItemHistoryList.length; index++) rowChildren(poItemHistoryList[index], index)],
),
),
).expanded,
],
],
)
: ListView(
padding: _screenParams!.isPRInfo ? const EdgeInsets.all(0) : const EdgeInsets.all(21),
// physics: const NeverScrollableScrollPhysics(),
children: [
if (_screenParams!.isPRInfo) prLinesDataView(),
if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData(),
if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData(),
if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData(),
if (moItemHistoryList.isEmpty && poItemHistoryList.isEmpty && quotationAnalysisList.isEmpty && !_screenParams!.isPRInfo) Utils.getNoDataWidget(context),
],
),
);
}

@ -84,6 +84,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
controller.jumpToPage(0);
});
} catch (ex) {
setState(() {});
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
@ -95,6 +96,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1;
getItgData();
Utils.hideLoading(context);
getItgRequestAttachments();
}
}
@ -533,6 +535,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
Utils.handleException(ex, context, null);
}
}
void performAnswerAction(String requestType, taskId, itemId, String employeeNumber, String comments) async {
try {
Utils.showLoading(context);
@ -641,16 +644,13 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void getItgRequestAttachments() async {
try {
// Utils.showLoading(context);
itgFormAttachmentsList =
isAttachmentLoaded = false;
itgFormAttachmentsList.clear();
List<ITGFormsAttachmentsModel> _itgFormAttachmentsList =
(await WorkListApiClient().getITGFormAttachments(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""))!;
// allowedActionList = itgRequest?.allowedActions ?? [];
// if (allowedActionList.isNotEmpty) {
// isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE");
// isApproveAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Approve");
// isRejectAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Reject");
// }
// Utils.hideLoading(context);
if (!isAttachmentLoaded) {
itgFormAttachmentsList = _itgFormAttachmentsList;
}
setState(() {
isAttachmentLoaded = true;
});

@ -23,6 +23,7 @@ import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_mod
import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart';
import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
@ -45,7 +46,6 @@ import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart';
class WorkListDetailScreen extends StatefulWidget {
WorkListDetailScreen({Key? key}) : super(key: key);
@ -70,19 +70,16 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
List<GetStampMsNotificationBodyList> getStampMsNotifications = [];
List<GetStampNsNotificationBodyList> getStampNsNotifications = [];
List<GetMoNotificationBodyList> getMoNotificationBodyList = [];
List<NotificationGetRespondAttributesList> getNotificationRespondAttributes =
[];
List<NotificationGetRespondAttributesList> getNotificationRespondAttributes = [];
NotificationGetRespondAttributesList? notificationNoteInput;
List<GetRFCEmployeeList> getRFCEmployeeList = [];
//HR Details Screen Requests
List<GetEitCollectionNotificationBodyList>?
getEitCollectionNotificationBodyList = [];
List<GetEitCollectionNotificationBodyList>? getEitCollectionNotificationBodyList = [];
List<GetPhonesNotificationBodyList>? getPhonesNotificationBodyList = [];
List<GetBasicDetNtfBodyList>? getBasicDetNtfBodyList = [];
List<GetAbsenceCollectionNotificationBodyList>?
getAbsenceCollectionNotificationBodyList = [];
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotificationBodyList = [];
GetContactNotificationBodyList? getContactNotificationBodyList;
List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = [];
List<TerminationNotificationBody>? getTerminationNotificationBodyList = [];
@ -133,8 +130,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getContactNotificationBodyList = null;
getAddressNotificationBodyList!.clear();
getPaymentNotificationBodyList = null;
if (workListData!.iTEMTYPE == "HRSSA" ||
workListData!.iTEMTYPE == "STAMP") {
if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") {
getUserInformation();
}
@ -191,8 +187,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void getDataFromState() {
if (workListData == null) {
workListData = AppState().workList![AppState()
.workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
workListData = AppState().workList![AppState().workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
getData();
}
}
@ -225,8 +220,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
Column(
children: [
Container(
padding: const EdgeInsets.only(
left: 21, right: 21, top: 16, bottom: 16),
padding: const EdgeInsets.only(left: 21, right: 21, top: 16, bottom: 16),
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(25),
@ -245,19 +239,13 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
child: Row(
children: [
myTab(LocaleKeys.info.tr(), 0),
(workListData!.iTEMTYPE == "HRSSA" ||
workListData!.iTEMTYPE == "STAMP")
? myTab(LocaleKeys.details.tr(), 1)
: myTab(LocaleKeys.request.tr(), 1),
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") ? myTab(LocaleKeys.details.tr(), 1) : myTab(LocaleKeys.request.tr(), 1),
myTab(LocaleKeys.actions.tr(), 2),
myTab(LocaleKeys.attachments.tr(), 3),
],
),
),
if ((workListData?.sUBJECT ?? "").isNotEmpty)
workListData!.sUBJECT!
.toText14()
.paddingOnly(top: 20, right: 21, left: 21),
if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21),
PageView(
controller: controller,
onPageChanged: (int pageIndex) {
@ -269,38 +257,26 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
InfoFragment(
poHeaderList: getPoNotificationBody?.pOHeader ?? [],
workListData: workListData,
itemCreationHeader:
getItemCreationNtfBody?.itemCreationHeader ?? [],
itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [],
getStampMsNotifications: getStampMsNotifications,
getStampNsNotifications: getStampNsNotifications,
getEitCollectionNotificationBodyList:
getEitCollectionNotificationBodyList,
getPhonesNotificationBodyList:
getPhonesNotificationBodyList,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
getPhonesNotificationBodyList: getPhonesNotificationBodyList,
getBasicDetNtfBodyList: getBasicDetNtfBodyList,
getAddressNotificationBodyList:
getAddressNotificationBodyList,
getAbsenceCollectionNotificationBodyList:
getAbsenceCollectionNotificationBodyList,
getContactNotificationBodyList:
getContactNotificationBodyList,
getAddressNotificationBodyList: getAddressNotificationBodyList,
getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList,
getContactNotificationBodyList: getContactNotificationBodyList,
getPrNotificationBodyList: getPrNotificationBody,
getTerminationNotificationBodyList:
getTerminationNotificationBodyList,
getPaymentNotificationBodyList:
getPaymentNotificationBodyList,
getTerminationNotificationBodyList: getTerminationNotificationBodyList,
getPaymentNotificationBodyList: getPaymentNotificationBodyList,
),
(workListData!.iTEMTYPE == "HRSSA" ||
workListData!.iTEMTYPE == "STAMP" || workListData!.iTEMTYPE == "PAY_REQ")
? DetailFragment(
workListData, memberInformationListModel)
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP" || workListData!.iTEMTYPE == "PAY_REQ")
? DetailFragment(workListData, memberInformationListModel)
: RequestFragment(
moNotificationBodyList: getMoNotificationBodyList,
poLinesList: getPoNotificationBody?.pOLines ?? [],
itemCreationLines:
getItemCreationNtfBody?.itemCreationLines ?? [],
itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [],
prLinesList: getPrNotificationBody?.pRLines ?? [],
),
isActionHistoryLoaded
? actionHistoryList.isEmpty
@ -320,13 +296,11 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
).expanded,
if (isApproveAvailable || isRejectAvailable || isCloseAvailable)
Container(
padding: const EdgeInsets.only(
top: 14, bottom: 14, left: 21, right: 21),
padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21),
decoration: const BoxDecoration(
color: Colors.white,
border: Border(
top: BorderSide(
color: MyColors.lightGreyEFColor, width: 1.0),
top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0),
),
),
child: Row(
@ -335,29 +309,20 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
DefaultButton(
LocaleKeys.reject.tr(),
() => performAction(rejectAction),
colors: const [
Color(0xffE47A7E),
Color(0xffDE6D71)
],
colors: const [Color(0xffE47A7E), Color(0xffDE6D71)],
).expanded,
if (isApproveAvailable && isRejectAvailable) 8.width,
if (isApproveAvailable)
DefaultButton(
LocaleKeys.approve.tr(),
() => performAction(approveAction),
colors: const [
Color(0xff28C884),
Color(0xff1BB271)
],
colors: const [Color(0xff28C884), Color(0xff1BB271)],
).expanded,
if (isCloseAvailable)
DefaultButton(
LocaleKeys.ok.tr(),
() => performAction("CLOSE"),
colors: const [
Color(0xff32D892),
Color(0xff1AB170)
],
colors: const [Color(0xff32D892), Color(0xff1AB170)],
).expanded,
8.width,
Container(
@ -367,11 +332,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(
showFabOptions
? Icons.more_vert_rounded
: Icons.more_horiz_rounded,
color: MyColors.darkIconColor),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
@ -388,8 +349,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
opacity: showFabOptions ? 1 : 0,
duration: const Duration(milliseconds: 250),
child: Container(
padding: const EdgeInsets.only(
left: 21, right: 21, bottom: 75 - 12),
padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75 - 12),
width: double.infinity,
height: double.infinity,
color: Colors.white.withOpacity(.67),
@ -398,19 +358,15 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg")
.onPress(() {
if (AppState().workList!.length - 1 >
AppState().workListIndex!) {
myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() {
if (AppState().workList!.length - 1 > AppState().workListIndex!) {
animationIndex = animationIndex + 1;
AppState().setWorkListIndex =
AppState().workListIndex! + 1;
AppState().setWorkListIndex = AppState().workListIndex! + 1;
workListData = null;
showFabOptions = false;
tabIndex = 0;
getDataFromState();
} else if (AppState().workList!.length - 1 ==
AppState().workListIndex!) {
} else if (AppState().workList!.length - 1 == AppState().workListIndex!) {
Navigator.pop(context);
}
}),
@ -428,31 +384,25 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
],
),
),
floatingActionButton:
(!isApproveAvailable && !isRejectAvailable && !isCloseAvailable)
? Container(
height: 43,
width: 43,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(
showFabOptions
? Icons.more_vert_rounded
: Icons.more_horiz_rounded,
color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
});
})
: null,
floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable)
? Container(
height: 43,
width: 43,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
});
})
: null,
);
}
List<Widget> viewApiButtonsList(
List<GetNotificationButtonsList> notificationButtonsList) {
List<Widget> viewApiButtonsList(List<GetNotificationButtonsList> notificationButtonsList) {
List<Widget> fabs = [];
for (int i = 0; i < notificationButtonsList.length; i++) {
if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" ||
@ -466,9 +416,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
notificationButtonsList[i].bUTTONLABEL!,
getActionImage(notificationButtonsList[i].bUTTONACTION!),
isIconAsset: true,
)
.paddingOnly(bottom: 12)
.onPress(() => handleFabAction(notificationButtonsList[i])));
).paddingOnly(bottom: 12).onPress(() => handleFabAction(notificationButtonsList[i])));
}
return fabs;
}
@ -547,8 +495,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
));
break;
case "ANSWER_INFO":
performAction(notificationButton.bUTTONACTION!,
title: notificationButton.bUTTONLABEL);
performAction(notificationButton.bUTTONACTION!, title: notificationButton.bUTTONLABEL);
break;
case "RFC":
getRFCEmployeeListFunc();
@ -568,31 +515,21 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
callBackFunc: reloadWorkList,
child: UpdateContinueSheet(
workListData: workListData,
getEitCollectionNotificationBodyList:
getEitCollectionNotificationBodyList,
dynamicParams: DynamicListViewParams(
workListData!.sUBJECT!, workListData!.fUNCTIONNAME!,
isUpdate: true,
collectionNotificationList:
getEitCollectionNotificationBodyList![0]
.collectionNotification)),
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!,
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)),
);
break;
case "CONTINUE_ACTION":
showMyBottomSheet(
context,
type:"CONTINUE_ACTION",
type: "CONTINUE_ACTION",
callBackFunc: reloadWorkList,
child: UpdateContinueSheet(
workListData: workListData,
getEitCollectionNotificationBodyList:
getEitCollectionNotificationBodyList,
dynamicParams: DynamicListViewParams(
workListData!.sUBJECT!, workListData!.fUNCTIONNAME!,
isUpdate: true,
collectionNotificationList:
getEitCollectionNotificationBodyList![0]
.collectionNotification)),
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!,
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)),
);
break;
case "APPROVE_AND_FORWARD":
@ -604,8 +541,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
notificationID: workListData!.nOTIFICATIONID,
actionHistoryList: actionHistoryList,
callBackFunc: reloadWorkList,
getNotificationRespondAttributes:
getNotificationRespondAttributes,
getNotificationRespondAttributes: getNotificationRespondAttributes,
));
break;
case "FORWARD":
@ -617,8 +553,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
notificationID: workListData!.nOTIFICATIONID,
actionHistoryList: actionHistoryList,
callBackFunc: reloadWorkList,
getNotificationRespondAttributes:
getNotificationRespondAttributes,
getNotificationRespondAttributes: getNotificationRespondAttributes,
));
break;
case "DEL":
@ -639,8 +574,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void getRFCEmployeeListFunc() async {
try {
Utils.showLoading(context);
getRFCEmployeeList = await WorkListApiClient()
.getRFCEmployeeeList(workListData!.nOTIFICATIONID!);
getRFCEmployeeList = await WorkListApiClient().getRFCEmployeeeList(workListData!.nOTIFICATIONID!);
Utils.hideLoading(context);
actionHistoryList.last.sEQUENCE = getRFCEmployeeList[0].sEQ;
showMyBottomSheet(context,
@ -660,8 +594,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
}
Future<void> performNetworkCall(BuildContext context,
{String? email, String? userId}) async {
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
showDialog(
context: context,
builder: (BuildContext cxt) => ConfirmDialog(
@ -671,12 +604,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
Navigator.pop(cxt);
Utils.showLoading(context);
try {
await WorkListApiClient().submitComment(
comment: "",
email: email,
userId: userId,
notificationId: workListData!.nOTIFICATIONID,
apiMode: "REJECT");
await WorkListApiClient().submitComment(comment: "", email: email, userId: userId, notificationId: workListData!.nOTIFICATIONID, apiMode: "REJECT");
Utils.hideLoading(context);
Navigator.pop(context, "delegate_reload");
} catch (ex) {
@ -694,9 +622,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
title.toText12(
color: isSelected ? Colors.white : Colors.white.withOpacity(.74),
isCenter: true),
title.toText12(color: isSelected ? Colors.white : Colors.white.withOpacity(.74), isCenter: true),
4.height,
Container(
height: 8,
@ -764,10 +690,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
for (var element in getNotificationRespondAttributes!) {
responseAttribute.add({
"ATTRIBUTE_NAME": element!.attributeName,
if (element!.attributeType == "number")
"ATTRIBUTE_NUMBER_VALUE": note
else if (element!.attributeType == "VARCHAR2")
"ATTRIBUTE_TEXT_VALUE": note
if (element!.attributeType == "number") "ATTRIBUTE_NUMBER_VALUE": note else if (element!.attributeType == "VARCHAR2") "ATTRIBUTE_TEXT_VALUE": note
});
}
@ -780,11 +703,15 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
"RespondAttributeList": responseAttribute,
};
if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE" || actionMode == "ANSWER_INFO" || actionMode == "RFC" || actionMode == "TRY_APPROVE_AGAIN" || actionMode == "SEND_BACK_TO_PREPARER") {
if (actionMode == "APPROVED" ||
actionMode == "APPROVE" ||
actionMode == "CLOSE" ||
actionMode == "ANSWER_INFO" ||
actionMode == "RFC" ||
actionMode == "TRY_APPROVE_AGAIN" ||
actionMode == "SEND_BACK_TO_PREPARER") {
performNotificationAction(payload);
} else if (note.isNotEmpty &&
(actionMode != "APPROVED" || actionMode != "APPROVE")) {
} else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) {
performNotificationAction(payload);
} else {
Utils.showToast(LocaleKeys.pleaseEnterComments.tr());
@ -797,8 +724,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void performNotificationAction(Map<String, dynamic> payload) async {
try {
Utils.showLoading(context);
GenericResponseModel model =
await WorkListApiClient().postNotificationActions(payload);
GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload);
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
animationIndex = animationIndex + 1;
@ -839,8 +765,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getEitCollectionNotificationBodyList!.clear();
getEitCollectionNotificationBodyList = await WorkListApiClient()
.GetEitNotificationBody(workListData!.nOTIFICATIONID);
getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -858,8 +783,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
memberInformationListModel = null;
memberInformationListModel = await WorkListApiClient()
.getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -877,8 +801,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getPhonesNotificationBodyList!.clear();
getPhonesNotificationBodyList = await WorkListApiClient()
.getPhonesNotificationBodyList(workListData!.nOTIFICATIONID);
getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -896,8 +819,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getBasicDetNtfBodyList!.clear();
getBasicDetNtfBodyList = await WorkListApiClient()
.getBasicDetNtfBodyList(workListData!.nOTIFICATIONID);
getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -915,8 +837,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getAbsenceCollectionNotificationBodyList!.clear();
getAbsenceCollectionNotificationBodyList = await WorkListApiClient()
.getAbsenceNotificationBody(workListData!.nOTIFICATIONID);
getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -933,8 +854,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getContactNotificationBodyList = await WorkListApiClient()
.getContactNotificationBodyList(workListData!.nOTIFICATIONID);
getContactNotificationBodyList = await WorkListApiClient().getContactNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -951,8 +871,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getAddressNotificationBodyList = await WorkListApiClient()
.getAddressNotificationBodyList(workListData!.nOTIFICATIONID);
getAddressNotificationBodyList = await WorkListApiClient().getAddressNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -968,8 +887,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void getTerminationNotificationBody() async {
try {
if (apiCallCount == 0) apiCallCount++;
getTerminationNotificationBodyList = await WorkListApiClient()
.getTerminationNotificationBodyList(workListData!.nOTIFICATIONID);
getTerminationNotificationBodyList = await WorkListApiClient().getTerminationNotificationBodyList(workListData!.nOTIFICATIONID);
Utils.hideLoading(context);
apiCallCount--;
if (apiCallCount == 0) {
@ -987,11 +905,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
if (workListData!.rEQUESTTYPE == "STAMP_MS") {
getStampMsNotifications = await WorkListApiClient()
.getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999);
getStampMsNotifications = await WorkListApiClient().getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999);
} else {
getStampNsNotifications = await WorkListApiClient()
.getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999);
getStampNsNotifications = await WorkListApiClient().getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999);
}
apiCallCount--;
if (apiCallCount == 0) {
@ -1009,8 +925,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getMoNotificationBodyList = await WorkListApiClient()
.getMoNotificationBody(workListData!.nOTIFICATIONID!, -999);
getMoNotificationBodyList = await WorkListApiClient().getMoNotificationBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -1027,8 +942,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getItemCreationNtfBody = await WorkListApiClient()
.getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999);
getItemCreationNtfBody = await WorkListApiClient().getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -1045,8 +959,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getPoNotificationBody = await WorkListApiClient()
.getPoNotificationBody(workListData!.nOTIFICATIONID!, -999);
getPoNotificationBody = await WorkListApiClient().getPoNotificationBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -1063,8 +976,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getPrNotificationBody = await WorkListApiClient()
.getPRNotificationBody(workListData!.nOTIFICATIONID!, -999);
getPrNotificationBody = await WorkListApiClient().getPRNotificationBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -1081,8 +993,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getPaymentNotificationBodyList = await WorkListApiClient()
.getPaymentNotificationBody(workListData!.nOTIFICATIONID!, -999);
getPaymentNotificationBodyList = await WorkListApiClient().getPaymentNotificationBody(workListData!.nOTIFICATIONID!, -999);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
@ -1100,8 +1011,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getNotificationRespondAttributes.clear();
getNotificationRespondAttributes = await WorkListApiClient()
.notificationGetRespondAttributes(workListData!.nOTIFICATIONID!);
getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!);
if (getNotificationRespondAttributes.isNotEmpty) {
notificationNoteInput = getNotificationRespondAttributes.first;
}
@ -1122,25 +1032,18 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
notificationButtonsList.clear();
notificationButtonsList = await WorkListApiClient()
.getNotificationButtons(workListData!.nOTIFICATIONID!);
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!);
if (notificationButtonsList.isNotEmpty) {
isCloseAvailable = notificationButtonsList.any(
(GetNotificationButtonsList element) =>
element.bUTTONACTION == "CLOSE");
isApproveAvailable =
notificationButtonsList.any((GetNotificationButtonsList element) {
if (element.bUTTONACTION == "APPROVED" ||
element.bUTTONACTION == "APPROVE") {
isCloseAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "CLOSE");
isApproveAvailable = notificationButtonsList.any((GetNotificationButtonsList element) {
if (element.bUTTONACTION == "APPROVED" || element.bUTTONACTION == "APPROVE") {
approveAction = element.bUTTONACTION!;
return true;
}
return false;
});
isRejectAvailable =
notificationButtonsList.any((GetNotificationButtonsList element) {
if (element.bUTTONACTION == "REJECTED" ||
element.bUTTONACTION == "REJECT") {
isRejectAvailable = notificationButtonsList.any((GetNotificationButtonsList element) {
if (element.bUTTONACTION == "REJECTED" || element.bUTTONACTION == "REJECT") {
rejectAction = element.bUTTONACTION!;
return true;
}
@ -1163,8 +1066,10 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
isActionHistoryLoaded = false;
actionHistoryList.clear();
actionHistoryList = await WorkListApiClient()
.getActionHistory(workListData!.nOTIFICATIONID!);
List<GetActionHistoryList> _actionHistoryList = await WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!);
if (!isActionHistoryLoaded) {
actionHistoryList = _actionHistoryList;
}
setState(() {
isActionHistoryLoaded = true;
});
@ -1177,8 +1082,10 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
isAttachmentLoaded = false;
getAttachmentList.clear();
getAttachmentList = await WorkListApiClient()
.getAttachments(workListData!.nOTIFICATIONID!);
List<GetAttachementList> _getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!);
if (!isAttachmentLoaded) {
getAttachmentList = _getAttachmentList;
}
setState(() {
isAttachmentLoaded = true;
});

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

@ -0,0 +1,176 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
/// Animated progress bar. Behaves like implicitly animated widget.
/// Check basic implicit animated Flutter widgets like [AnimatedContainer]
/// It animates [value] changes.
/// Requires [duration] to set filling duration timer
/// [onEnd] callback to trigger additional actions (e.g. another animation)
/// at the end of the current animation
/// [color] or [gradient] to fill the progress bar. Only one parameter is allowed.
/// Optional [backgroundColor], defaults to transparent
/// Optional [width] defaults to 200.0
/// Optional [height] defaults to 10.0
/// Optional [curve] defaults to [Curves.linear]
class AnimatedProgressBar extends ImplicitlyAnimatedWidget {
const AnimatedProgressBar({
key,
required duration,
required this.value,
this.width = 200.0,
this.height = 10.0,
this.color,
this.gradient,
this.backgroundColor = Colors.transparent,
curve = Curves.linear,
onEnd,
}) : super(key: key, duration: duration, curve: curve, onEnd: onEnd);
///progress bar width
final double width;
///progress bar height
final double height;
///current progress value
final double? value;
///progress bar gradient parameter
final Gradient? gradient;
///progress bar color parameter
final Color? color;
///progress bar color parameter
final Color backgroundColor;
@override
AnimatedWidgetBaseState<AnimatedProgressBar> createState() => _AnimatedBarState();
}
class _AnimatedBarState extends AnimatedWidgetBaseState<AnimatedProgressBar> {
Tween<double>? _progressValue;
@override
void forEachTween(TweenVisitor<dynamic> visitor) {
_progressValue = visitor(_progressValue, widget.value, (value) => Tween<double>(begin: value)) as Tween<double>?;
}
@override
Widget build(BuildContext context) {
return ProgressBar(
value: _progressValue?.evaluate(animation),
width: widget.width,
height: widget.height,
gradient: widget.gradient,
color: widget.color,
backgroundColor: widget.backgroundColor,
);
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description.add(DiagnosticsProperty<Tween>('progressValue', _progressValue, showName: false, defaultValue: null));
}
}
class ProgressBar extends StatelessWidget {
const ProgressBar({
Key? key,
required this.value,
this.width = 200.0,
this.height = 10.0,
this.color,
this.backgroundColor = Colors.transparent,
this.gradient,
}) : assert(
gradient == null || color == null,
'Cannot provide both a color and a gradient',
),
assert(
gradient != null || color != null,
'Need to provide color or gradient',
),
super(key: key);
///progress bar width
final double width;
///progress bar height
final double height;
///current progress value
final double? value;
///progress bar gradient parameter
final Gradient? gradient;
///progress bar color parameter
final Color? color;
///progress bar color parameter
final Color backgroundColor;
@override
Widget build(BuildContext context) {
return CustomPaint(
size: Size(width, height),
foregroundPainter: ProgressPainter(
value: value!,
color: color,
gradient: gradient,
),
painter: BackgroundPainter(
backgroundColor: backgroundColor,
),
);
}
}
class BackgroundPainter extends CustomPainter {
const BackgroundPainter({required this.backgroundColor});
///progress bar backgroundColor
final Color backgroundColor;
@override
void paint(Canvas canvas, Size size) {
Paint paint = Paint()..color = backgroundColor;
canvas.drawRRect(RRect.fromRectAndRadius(Offset.zero & size, Radius.circular(6)), paint);
}
@override
bool shouldRepaint(covariant BackgroundPainter oldDelegate) => false;
}
class ProgressPainter extends CustomPainter {
const ProgressPainter({required this.value, this.gradient, this.color});
///current progress bar value
final double value;
///progress bar gradient infill
final Gradient? gradient;
///progress bar gradient color
final Color? color;
@override
void paint(Canvas canvas, Size size) {
Paint paint = Paint();
if (gradient != null) {
paint.shader = gradient?.createShader(Offset.zero & size);
}
if (color != null) {
paint.color = color!;
}
canvas.clipRRect(RRect.fromRectAndRadius(Offset.zero & size, Radius.circular(6)));
canvas.drawRRect(RRect.fromRectAndRadius(Rect.fromLTRB(0, 0, size.width * value, size.height), Radius.circular(6)), paint);
}
@override
bool shouldRepaint(covariant ProgressPainter oldDelegate) {
return value != oldDelegate.value;
}
}

@ -47,28 +47,21 @@ class DefaultButton extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
gradient: onPress == null
? const LinearGradient(
? LinearGradient(
colors: <Color>[
Color(0xffEAEAEA),
Color(0xffEAEAEA),
disabledColor ?? Color(0xffEAEAEA),
disabledColor ?? Color(0xffEAEAEA),
],
)
: color == MyColors.yellowColorII
? const LinearGradient(
colors: <Color>[
MyColors.yellowColorII,
MyColors.yellowColorII,
],
colors: <Color>[MyColors.yellowColorII, MyColors.yellowColorII],
)
: LinearGradient(
transform: const GradientRotation(.83),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: colors ??
<Color>[
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
],
colors: colors ?? <Color>[MyColors.gradiantEndColor, MyColors.gradiantStartColor],
),
),
child: Row(

@ -86,7 +86,8 @@ class ItemDetailViewGridItem extends StatelessWidget {
type != null
? type!.toLowerCase() == "table"
? getStringFromJSON(value!)
: Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor))
// : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 5))
: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: 6)
: Container(),
],
),

@ -0,0 +1,134 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/widgets/AnimatedProgressBar.dart';
import 'package:video_player/video_player.dart';
class MyVideoProgressIndicator extends StatefulWidget {
const MyVideoProgressIndicator(
this.controller, {
Key? key,
this.colors = const VideoProgressColors(),
required this.allowScrubbing,
this.padding = const EdgeInsets.only(top: 5.0),
}) : super(key: key);
final VideoPlayerController controller;
final VideoProgressColors colors;
final bool allowScrubbing;
final EdgeInsets padding;
@override
State<MyVideoProgressIndicator> createState() => _VideoProgressIndicatorState();
}
class _VideoProgressIndicatorState extends State<MyVideoProgressIndicator> {
_VideoProgressIndicatorState() {
listener = () {
if (!mounted) {
return;
}
setState(() {});
};
}
late VoidCallback listener;
VideoPlayerController get controller => widget.controller;
VideoProgressColors get colors => widget.colors;
@override
void initState() {
super.initState();
controller.addListener(listener);
}
@override
void deactivate() {
controller.removeListener(listener);
super.deactivate();
}
@override
Widget build(BuildContext context) {
Widget progressIndicator;
if (controller.value.isInitialized) {
int duration = controller.value.duration.inMilliseconds;
int position = controller.value.position.inMilliseconds;
int maxBuffering = 0;
for (DurationRange range in controller.value.buffered) {
int end = range.end.inMilliseconds;
if (end > maxBuffering) {
maxBuffering = end;
}
}
progressIndicator = Stack(
fit: StackFit.passthrough,
children: <Widget>[
// LinearProgressIndicator(
// value: maxBuffering / duration,
// valueColor: AlwaysStoppedAnimation<Color>(colors.bufferedColor),
// backgroundColor: colors.backgroundColor,
// minHeight: 8,
// ),
// LinearProgressIndicator(
// value: position / duration,
// valueColor: AlwaysStoppedAnimation<Color>(colors.playedColor),
// backgroundColor: Colors.transparent,
// minHeight: 8,
// ),
AnimatedProgressBar(
value: position / duration,
duration: const Duration(seconds: 2),
height: 43,
width: MediaQuery.of(context).size.width - 120,
gradient: const LinearGradient(
transform: GradientRotation(.83),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
],
),
backgroundColor: Colors.grey.withOpacity(0.6),
),
],
);
} else {
// progressIndicator = LinearProgressIndicator(
// valueColor: AlwaysStoppedAnimation<Color>(colors.playedColor),
// backgroundColor: colors.backgroundColor,
// minHeight: 8,
// );
progressIndicator = AnimatedProgressBar(
value: 1,
duration: const Duration(seconds: 2),
height: 43,
width: MediaQuery.of(context).size.width - 120,
gradient: const LinearGradient(
transform: GradientRotation(.83),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
],
),
backgroundColor: Colors.grey.withOpacity(0.6),
);
}
Widget paddedProgressIndicator = Padding(padding: widget.padding, child: progressIndicator);
if (widget.allowScrubbing) {
return VideoScrubber(controller: controller, child: paddedProgressIndicator);
} else {
return paddedProgressIndicator;
}
}
}

@ -16,7 +16,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 4.4.4+4000026
#version: 3.3.01+300040
version: 3.7.96+1
environment:
sdk: ">=2.16.0 <3.0.0"
@ -65,7 +66,7 @@ dependencies:
month_picker_dialog_2: ^0.5.5
# open_file: ^3.2.1
open_filex: ^4.4.0
wifi_iot: ^0.3.18
wifi_iot: ^0.3.19+1
flutter_html: ^3.0.0-alpha.6
# flutter_barcode_scanner: ^2.0.0
qr_code_scanner: ^1.0.1
@ -75,11 +76,13 @@ dependencies:
flutter_rating_bar: ^4.0.1
auto_size_text: ^3.0.0
pull_to_refresh: ^2.0.0
fl_chart: ^0.62.0
# lottie json animations
lottie: any
# Marathon Card Swipe
appinio_swiper: ^1.1.1
expandable: ^5.0.1
safe_device: ^1.1.9
# networkImage
cached_network_image: ^3.2.2

Loading…
Cancel
Save