actions & attachment api response overlapping other request responses. fixed.

master-Api2.0
Sikander Saleem 12 months ago
parent 11881b0ba1
commit b06fb6345a

@ -13,7 +13,7 @@ import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:firebase_messaging_web/firebase_messaging_web.dart'; import 'package:firebase_messaging_web/firebase_messaging_web.dart';
import 'package:fluttertoast/fluttertoast_web.dart'; import 'package:fluttertoast/fluttertoast_web.dart';
import 'package:geolocator_web/geolocator_web.dart'; import 'package:geolocator_web/geolocator_web.dart';
import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; // import 'package:google_maps_flutter_web/google_maps_flutter_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart'; import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:just_audio_web/just_audio_web.dart'; import 'package:just_audio_web/just_audio_web.dart';
// import 'package:record_web/record_web.dart'; // import 'package:record_web/record_web.dart';
@ -32,7 +32,7 @@ void registerPlugins(Registrar registrar) {
FirebaseMessagingWeb.registerWith(registrar); FirebaseMessagingWeb.registerWith(registrar);
FluttertoastWebPlugin.registerWith(registrar); FluttertoastWebPlugin.registerWith(registrar);
GeolocatorPlugin.registerWith(registrar); GeolocatorPlugin.registerWith(registrar);
GoogleMapsPlugin.registerWith(registrar); // GoogleMapsPlugin.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar); ImagePickerPlugin.registerWith(registrar);
JustAudioPlugin.registerWith(registrar); JustAudioPlugin.registerWith(registrar);
//RecordPluginWeb.registerWith(registrar); //RecordPluginWeb.registerWith(registrar);

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

Loading…
Cancel
Save