From 1b13b732b87f55450402cb5fc34faaa1d80dcb6c Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 23 Oct 2022 15:51:15 +0300 Subject: [PATCH 01/11] fix issues --- lib/models/generic_response_model.dart | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index b96098e..c5a6b92 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -789,30 +789,13 @@ class GenericResponseModel { getCEIDFFStructureList = json['GetCEIDFFStructureList']; getCEITransactionList = json['GetCEITransactionList']; getCcpTransactionsList = json['GetCcpTransactionsList']; - if (json['GetContactDetailsList'] != null) { - getContactDetailsList = []; - json['GetContactDetailsList'].forEach((v) { - getContactDetailsList!.add(GetContactDetailsList.fromJson(v)); - }); - } - if (json['GetContactColsStructureList'] != null) { - getContactColsStructureList = []; - json['GetContactColsStructureList'].forEach((v) { - getContactColsStructureList!.add(GetContactColsStructureList.fromJson(v)); - }); - } - getContactColsStructureList = json['GetContactColsStructureList']; - getContactDetailsList = json['GetContactDetailsList']; - getContactDffStructureList = json['GetContactDffStructureList']; getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]); - if (json['GetContactColsStructureList'] != null) { getContactColsStructureList = []; json['GetContactColsStructureList'].forEach((v) { getContactColsStructureList!.add(GetContactColsStructureList.fromJson(v)); }); } - if (json['GetContactDetailsList'] != null) { getContactDetailsList = []; json['GetContactDetailsList'].forEach((v) { @@ -825,8 +808,6 @@ class GenericResponseModel { getContactDffStructureList!.add(GetContactDffStructureList.fromJson(v)); }); } - // getContactDetailsList = json['GetContactDetailsList']; - // getContactDffStructureList = json['GetContactDffStructureList']; getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]); if (json['GetCountriesList'] != null) { From 7b4fe5bcbc294db4e788e21516bbc0a5f6b0f11a Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 25 Oct 2022 10:29:49 +0300 Subject: [PATCH 02/11] fix issues --- assets/langs/ar-SA.json | 2 + assets/langs/en-US.json | 2 + lib/api/profile_api_client.dart | 11 +- lib/generated/codegen_loader.g.dart | 4 + lib/generated/locale_keys.g.dart | 2 + lib/ui/login/change_password_screen.dart | 6 +- lib/ui/profile/add_update_family_member.dart | 282 +++++++++++-------- lib/ui/profile/basic_details.dart | 52 ++-- lib/ui/profile/contact_details.dart | 12 +- lib/ui/profile/family_members.dart | 14 +- 10 files changed, 225 insertions(+), 162 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index a21411d..3aca8a6 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -419,6 +419,8 @@ "adult": "بالغ", "updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", "fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد", + "typeCurrentPasswordBelow": "اكتب كلمة المرور الحاليه", + "currentPassword": "كلمة المرور الحاليه", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index b5a607c..984f81f 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -419,6 +419,8 @@ "adult": "Adult", "updateMember": "Are You Sure You Want to Update this Member?", "fieldIsEmpty": "'{data}' Field is empty. Please select", + "typeCurrentPasswordBelow": "Type Your Current password below", + "currentPassword": "Current password", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/api/profile_api_client.dart b/lib/api/profile_api_client.dart index 2d8b71e..832b6d8 100644 --- a/lib/api/profile_api_client.dart +++ b/lib/api/profile_api_client.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'package:mohem_flutter_app/api/api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; @@ -377,7 +378,7 @@ class ProfileApiClient { }, url, postParams); } - Future submitContactTransactionAddAndUpdate(String actionType, int relationId, List> list) async { + Future submitContactTransactionAddAndUpdate(String actionType, relationId, List> list) async { String url = "${ApiConsts.erpRest}SUBMIT_CONTACT_TRANSACTION"; Map postParams = { "P_MENU_TYPE": "E", @@ -386,8 +387,14 @@ class ProfileApiClient { "P_ACTION": actionType, "P_CONTACT_RELATIONSHIP_ID": relationId, }; - postParams["EITTransactionTBL"] = list; + postParams.addAll(AppState().postParamsJson); + print("postParam:${json.encode(postParams)}"); + postParams["EITTransactionTBL"] = list; + list.forEach((element) { + print(json.encode(element)); + + }); return await ApiClient().postJsonForObject((json) { GenericResponseModel? responseData = GenericResponseModel.fromJson(json); return responseData.submitContactTransactionList; diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 37e5d4e..54438cd 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -435,6 +435,8 @@ class CodegenLoader extends AssetLoader{ "adult": "بالغ", "updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", "fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد", + "typeCurrentPasswordBelow": "اكتب كلمة المرور الحاليه", + "currentPassword": "كلمة المرور الحاليه", "profile": { "reset_password": { "label": "Reset Password", @@ -893,6 +895,8 @@ static const Map en_US = { "adult": "Adult", "updateMember": "Are You Sure You Want to Update this Member?", "fieldIsEmpty": "'{data}' Field is empty. Please select", + "typeCurrentPasswordBelow": "Type Your Current password below", + "currentPassword": "Current password", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 85b677d..896732c 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -420,6 +420,8 @@ abstract class LocaleKeys { static const adult = 'adult'; static const updateMember = 'updateMember'; static const fieldIsEmpty = 'fieldIsEmpty'; + static const typeCurrentPasswordBelow = 'typeCurrentPasswordBelow'; + static const currentPassword = 'currentPassword'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; diff --git a/lib/ui/login/change_password_screen.dart b/lib/ui/login/change_password_screen.dart index 01603d9..e2d292e 100644 --- a/lib/ui/login/change_password_screen.dart +++ b/lib/ui/login/change_password_screen.dart @@ -64,11 +64,11 @@ class _ChangePasswordScreenState extends State { ListView( padding: const EdgeInsets.all(21), children: [ - "Change Password".toText24(isBold: true), - "Type Your Current password below".toText16(), + LocaleKeys.changePassword.tr().toText24(isBold: true), + LocaleKeys.typeCurrentPasswordBelow.tr().toText16(), 16.height, InputWidget( - "Current password", + LocaleKeys.currentPassword.tr(), "**********", oldPassword, onChange: (value) { diff --git a/lib/ui/profile/add_update_family_member.dart b/lib/ui/profile/add_update_family_member.dart index 5e5efee..00ad7fc 100644 --- a/lib/ui/profile/add_update_family_member.dart +++ b/lib/ui/profile/add_update_family_member.dart @@ -38,7 +38,8 @@ class _AddUpdateFamilyMemberState extends State { SubmitContactTransactionList? submitContactTransactionList; dynamic args; String? date = "MM/DD/YYYY"; - + var dateTime = DateTime.now().timeZoneOffset; + var dateTime1 = DateTime.now().timeZoneName; GetApprovesList? getApprovesList; @@ -48,7 +49,7 @@ class _AddUpdateFamilyMemberState extends State { } void callAddAndUpdateFamilyMember() async { - try { + try { Utils.showLoading(context); getBasicDetDffStructureList = await ProfileApiClient().getBasicDetDffStructure(); getContactColsStructureList = await ProfileApiClient().getContactColsStructureList(args['actionType']); @@ -89,11 +90,13 @@ class _AddUpdateFamilyMemberState extends State { Widget build(BuildContext context) { if (args == null) { args = ModalRoute.of(context)!.settings.arguments; - callAddAndUpdateFamilyMember();} + callAddAndUpdateFamilyMember(); + } return Scaffold( appBar: AppBarWidget( context, - title: LocaleKeys.profile_familyDetails.tr(),), + title: LocaleKeys.profile_familyDetails.tr(), + ), backgroundColor: MyColors.backgroundColor, body: args['flag'] == 1 ? Column( @@ -125,49 +128,45 @@ class _AddUpdateFamilyMemberState extends State { separatorBuilder: (cxt, index) => 0.height, itemCount: getContactDffStructureList!.length), ]).expanded, - DefaultButton( - LocaleKeys.next.tr(), () async { - submitUpdateForm(); - } - ).insideContainer, + DefaultButton(LocaleKeys.next.tr(), () async { + submitUpdateForm(); + }).insideContainer, ], ) : args['flag'] == 2 ? Column( children: [ - // getContactDetailsList!.isEmpty - ListView(physics: const BouncingScrollPhysics(), padding: const EdgeInsets.all(21), children: [ - ListView.separated( - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemBuilder: (BuildContext cxt, int parentIndex) { - return parseDynamicFormatTypeCols(getContactColsStructureList![parentIndex], parentIndex); - }, - separatorBuilder: (cxt, index) => 0.height, - itemCount: getContactColsStructureList!.length), - 12.height, - ListView.separated( - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemBuilder: (BuildContext cxt, int parentIndex) { - return parseDynamicFormatTypeBasicDetDff(getBasicDetDffStructureList![parentIndex], parentIndex); - }, - separatorBuilder: (cxt, index) => 0.height, - itemCount: getBasicDetDffStructureList!.length), - ListView.separated( - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemBuilder: (BuildContext cxt, int parentIndex) { - return parseDynamicFormatTypeContactDff(getContactDffStructureList![parentIndex], parentIndex); - }, - separatorBuilder: (cxt, index) => 0.height, - itemCount: getContactDffStructureList!.length), - ]).expanded, - DefaultButton( - LocaleKeys.next.tr(), () async { + // getContactDetailsList!.isEmpty + ListView(physics: const BouncingScrollPhysics(), padding: const EdgeInsets.all(21), children: [ + ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (BuildContext cxt, int parentIndex) { + return parseDynamicFormatTypeCols(getContactColsStructureList![parentIndex], parentIndex); + }, + separatorBuilder: (cxt, index) => 0.height, + itemCount: getContactColsStructureList!.length), + 12.height, + ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (BuildContext cxt, int parentIndex) { + return parseDynamicFormatTypeBasicDetDff(getBasicDetDffStructureList![parentIndex], parentIndex); + }, + separatorBuilder: (cxt, index) => 0.height, + itemCount: getBasicDetDffStructureList!.length), + ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (BuildContext cxt, int parentIndex) { + return parseDynamicFormatTypeContactDff(getContactDffStructureList![parentIndex], parentIndex); + }, + separatorBuilder: (cxt, index) => 0.height, + itemCount: getContactDffStructureList!.length), + ]).expanded, + DefaultButton(LocaleKeys.next.tr(), () async { submitUpdateForm(); - } - ).insideContainer, + }).insideContainer, ], ) : Container(), @@ -199,13 +198,23 @@ class _AddUpdateFamilyMemberState extends State { }); } else { return DynamicTextFieldWidget( - (model!.sEGMENTPROMPT ?? "") + (model!.rEQUIREDFLAG == "Y" ? "*" : "") , - ( model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "")+ (model!.aPPLICATIONCOLUMNNAME == "NATIONAL_IDENTIFIER" ? "1-1111-1111-1" : ""), + (model!.sEGMENTPROMPT ?? "") + (model!.rEQUIREDFLAG == "Y" ? "*" : ""), + (model!.getContactDetailsList!.sEGMENTVALUEDSP ?? ""), + //isInputTypeNum: true, onChange: (text) { model!.getContactDetailsList!.sEGMENTVALUEDSP = text; }, ).paddingOnly(bottom: 12); } + } else if (model.dATATYPE == "NUMBER") { + return DynamicTextFieldWidget( + (model!.sEGMENTPROMPT ?? "") + (model!.rEQUIREDFLAG == "Y" ? "*" : ""), + (model!.getContactDetailsList!.sEGMENTVALUEDSP ?? ""), + isInputTypeNum: true, + onChange: (text) { + model!.getContactDetailsList!.sEGMENTVALUEDSP = text; + }, + ).paddingOnly(bottom: 12); } else if (model.dATATYPE == "DATE") { return DynamicTextFieldWidget( (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), @@ -214,8 +223,13 @@ class _AddUpdateFamilyMemberState extends State { isEnable: false, onTap: () async { DateTime dateValue = await _selectDate(context); - date = DateFormat('yyyy/MM/dd').format(dateValue); + //date = DateFormat('yyyy/MM/dd').format(dateValue); + date = "2022-10-23T09:17:38.653+03:00"; + // date = (DateFormat('yyyy-MM-dd').format(dateValue)+"T"+ dateTime.toString() + dateTime1.toString()); model!.getContactDetailsList!.sEGMENTVALUEDSP = date; + print(dateTime); + print(dateTime1); + print(date); setState(() {}); }, ).paddingOnly(bottom: 12); @@ -251,11 +265,21 @@ class _AddUpdateFamilyMemberState extends State { return DynamicTextFieldWidget( (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), model.getContactDetailsList!.sEGMENTVALUEDSP ?? "", + // isInputTypeNum: true, onChange: (text) { model.getContactDetailsList!.sEGMENTVALUEDSP = text; }, ).paddingOnly(bottom: 12); } + } else if (model.fORMATTYPE == "N") { + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.getContactDetailsList!.sEGMENTVALUEDSP ?? "", + isInputTypeNum: true, + onChange: (text) { + model.getContactDetailsList!.sEGMENTVALUEDSP = text; + }, + ).paddingOnly(bottom: 12); } else if (model.fORMATTYPE == "X") { return DynamicTextFieldWidget( (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), @@ -264,7 +288,9 @@ class _AddUpdateFamilyMemberState extends State { isEnable: false, onTap: () async { DateTime dateValue = await _selectDate(context); - date = DateFormat('yyyy/MM/dd').format(dateValue); + date = "2022-10-23T09:17:38.653+03:00"; + // date = (DateFormat('yyyy-MM-dd').format(dateValue) +"T"+ dateTime.toString() + dateTime1.toString()); + // date = DateFormat('yyyy/MM/dd').format(dateValue); model!.getContactDetailsList!.sEGMENTVALUEDSP = date; setState(() {}); }, @@ -300,11 +326,21 @@ class _AddUpdateFamilyMemberState extends State { return DynamicTextFieldWidget( (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), model.getContactDetailsList!.sEGMENTVALUEDSP ?? "", + // isInputTypeNum: true, onChange: (text) { model.getContactDetailsList!.sEGMENTVALUEDSP = text; }, ).paddingOnly(bottom: 12); } + } else if (model.fORMATTYPE == "N") { + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.getContactDetailsList!.sEGMENTVALUEDSP ?? "", + isInputTypeNum: true, + onChange: (text) { + model.getContactDetailsList!.sEGMENTVALUEDSP = text; + }, + ).paddingOnly(bottom: 12); } else if (model.fORMATTYPE == "X") { return DynamicTextFieldWidget( (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), @@ -313,7 +349,9 @@ class _AddUpdateFamilyMemberState extends State { isEnable: false, onTap: () async { DateTime dateValue = await _selectDate(context); - date = DateFormat('yyyy/MM/dd').format(dateValue); + date = "2022-10-23T09:17:38.653+03:00"; + // date = (DateFormat('yyyy-MM-dd').format(dateValue)+"T"+ dateTime.toString() + dateTime1.toString()); + // date = DateFormat('yyyy/MM/dd').format(dateValue); model!.getContactDetailsList!.sEGMENTVALUEDSP = date; setState(() {}); }, @@ -345,8 +383,7 @@ class _AddUpdateFamilyMemberState extends State { ), ); } else { - DateTime? picked = - await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); + DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); if (picked != null && picked != selectedDate) { time = picked; } @@ -354,80 +391,81 @@ class _AddUpdateFamilyMemberState extends State { return time; } - - void submitUpdateForm() async { - try { - List> values1 = getBasicDetDffStructureList!.map((e) { - String? dateVal = ''; - String? vatcherVal = ''; - int? numberVal; - if (e!.fORMATTYPE == 'N') { - dateVal = null; - vatcherVal = null; - numberVal = e!.getContactDetailsList!.nUMBERVALUE; - } else if (e.fORMATTYPE == 'X') { - dateVal = e!.getContactDetailsList!.dATEVALUE.toString(); - vatcherVal = null; - numberVal = null; - } else { - dateVal = null; - vatcherVal = e!.getContactDetailsList!.vARCHAR2VALUE.toString(); - numberVal = null; - } - return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); - }).toList(); - List> values2 = getContactDffStructureList!.map((e) { - String? dateVal = ''; - String? vatcherVal = ''; - int? numberVal; - if (e!.fORMATTYPE == 'N') { - dateVal = null; - vatcherVal = null; - numberVal = e!.getContactDetailsList!.nUMBERVALUE; - } else if (e.fORMATTYPE == 'X') { - dateVal = e!.getContactDetailsList!.dATEVALUE.toString(); - vatcherVal = null; - numberVal = null; - } else { - dateVal = null; - numberVal = null; - vatcherVal = e!.getContactDetailsList!.vARCHAR2VALUE.toString(); - } - return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); - }).toList(); - List> values3 = getContactColsStructureList!.map((e) { - // String tempVar = e!.getContactDetailsList!.sEGMENTVALUEDSP ?? ""; - String? dateVal = ''; - String? vatcherVal = ''; - int? numberVal; - if (e!.dATATYPE == 'VARCHAR2') { - dateVal = null; - numberVal = null; - vatcherVal = e!.getContactDetailsList!.vARCHAR2VALUE.toString(); - } else if (e.dATATYPE == 'DATE') { - dateVal = e!.getContactDetailsList!.dATEVALUE.toString(); - vatcherVal = null; - numberVal = null; - } else if (e.dATATYPE == 'NUMBER') { - dateVal = null; - vatcherVal = null; - numberVal = e!.getContactDetailsList!.nUMBERVALUE; - } else {} - return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); - }).toList(); - List> valuesFinal = [...values1, ...values2, ...values3]; - Utils.showLoading(context); - submitContactTransactionList = await ProfileApiClient().submitContactTransactionAddAndUpdate(args['actionType'], args['relationID'] ?? 0, valuesFinal); - var transactionId = submitContactTransactionList!.pTRANSACTIONID; - var itemKey = submitContactTransactionList!.pITEMKEY; - Utils.hideLoading(context); - Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, - arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member')); - setState(() {}); - } catch (ex) { - Utils.hideLoading(context); - Utils.handleException(ex, context, null); - } + // try { + List> values1 = getBasicDetDffStructureList!.map((e) { + String? dateVal = ''; + String? vatcherVal = ''; + int? numberVal; + if (e!.fORMATTYPE == 'N') { + dateVal = null; + vatcherVal = null; + numberVal = int.parse(e.getContactDetailsList!.sEGMENTVALUEDSP??"0"); + } else if (e.fORMATTYPE == 'X') { + dateVal = e!.getContactDetailsList!.sEGMENTVALUEDSP.toString(); + vatcherVal = null; + numberVal = null; + } else { + dateVal = null; + vatcherVal = e!.getContactDetailsList!.sEGMENTVALUEDSP; + numberVal = null; + } + return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); + }).toList(); + List> values2 = getContactDffStructureList!.map((e) { + String? dateVal = ''; + String? vatcherVal = ''; + int? numberVal; + if (e!.fORMATTYPE == 'N') { + dateVal = null; + vatcherVal = null; + numberVal = int.parse(e.getContactDetailsList!.sEGMENTVALUEDSP??"0"); + } else if (e.fORMATTYPE == 'X') { + dateVal = e!.getContactDetailsList!.sEGMENTVALUEDSP; + vatcherVal = null; + numberVal = null; + } else { + dateVal = null; + numberVal = null; + vatcherVal = e!.getContactDetailsList!.sEGMENTVALUEDSP; + } + return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); + }).toList(); + List> values3 = getContactColsStructureList!.map((e) { + // String tempVar = e!.getContactDetailsList!.sEGMENTVALUEDSP ?? ""; + String? dateVal = ''; + String? vatcherVal = ''; + int? numberVal; + + print("e.dATATYPE:${e?.dATATYPE}"); + if (e!.dATATYPE == 'VARCHAR2') { + dateVal = null; + numberVal = null; + vatcherVal = e.getContactDetailsList?.sEGMENTVALUEDSP ?? ""; + } else if (e.dATATYPE == 'DATE') { + dateVal = e.getContactDetailsList!.sEGMENTVALUEDSP.toString(); + print("dateVal:${dateVal ?? ""}"); + vatcherVal = null; + numberVal = null; + } else if (e.dATATYPE == 'NUMBER') { + dateVal = null; + vatcherVal = null; + numberVal = int.parse(e.getContactDetailsList!.sEGMENTVALUEDSP??"0"); + } else {} + return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal).toJson(); + }).toList(); + List> valuesFinal = [...values1, ...values2, ...values3]; + Utils.showLoading(context); + submitContactTransactionList = await ProfileApiClient().submitContactTransactionAddAndUpdate(args['actionType'], args['relationID'] ?? null, valuesFinal); + var transactionId = submitContactTransactionList!.pTRANSACTIONID; + var itemKey = submitContactTransactionList!.pITEMKEY; + Utils.hideLoading(context); + Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, + arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member')); + setState(() {}); + // } catch (ex) { + // Utils.hideLoading(context); + // Utils.handleException(ex, context, null); + // } } } diff --git a/lib/ui/profile/basic_details.dart b/lib/ui/profile/basic_details.dart index 7aad54b..c91adb5 100644 --- a/lib/ui/profile/basic_details.dart +++ b/lib/ui/profile/basic_details.dart @@ -78,31 +78,33 @@ class _BasicDetailsState extends State { backgroundColor: MyColors.backgroundColor, body: Column( children: [ - ListView( - padding: const EdgeInsets.all(21), - children: [ - getEmployeeBasicDetailsList == null - ? const SizedBox().expanded - : (getEmployeeBasicDetailsList!.isEmpty - ? Utils.getNoDataWidget(context).expanded - : Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: getEmployeeBasicDetailsList! - .map((e) => Column( - children: [ - e.dISPLAYFLAG == "Y" - ? Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - "${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), - "${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), - 12.height - ]) - : Container(), - ], - )) - .toList()) - .objectContainerView()) - ], - ).expanded, + Expanded( + child: ListView( + padding: const EdgeInsets.all(21), + children: [ + getEmployeeBasicDetailsList == null + ? const SizedBox() + : (getEmployeeBasicDetailsList!.isEmpty + ? Utils.getNoDataWidget(context) + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: getEmployeeBasicDetailsList! + .map((e) => Column( + children: [ + e.dISPLAYFLAG == "Y" + ? Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + "${e.sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${e.sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + 12.height + ]) + : Container(), + ], + )) + .toList()) + .objectContainerView()) + ], + ), + ), DefaultButton( LocaleKeys.update.tr(), menuEntries.updateButton == 'Y' diff --git a/lib/ui/profile/contact_details.dart b/lib/ui/profile/contact_details.dart index d64eeb4..9a6f25e 100644 --- a/lib/ui/profile/contact_details.dart +++ b/lib/ui/profile/contact_details.dart @@ -1,6 +1,7 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/api/profile_api_client.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/config/routes.dart'; @@ -98,11 +99,16 @@ class _ContactDetailsState extends State { separatorBuilder: (cxt, index) => 12.height, itemCount: getEmployeePhonesList.length), if (menuEntriesPhone.updateButton == 'Y') - Positioned( + AppState().isArabic(context)? Positioned( top: 1, - right: 1, + left: 1, child: const Icon(Icons.edit_location_alt_outlined, size: 20).onPress(updatePhone), - ), + ) + :Positioned( + top: 1, + right: 1, + child: const Icon(Icons.edit_location_alt_outlined, size: 20).onPress(updatePhone), + ), ], ).objectContainerView(), 12.height, diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index 52a6277..fd7bd13 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -27,7 +27,7 @@ class FamilyMembers extends StatefulWidget { class _FamilyMembersState extends State { List getEmployeeContactsList = []; - int? relationId; + dynamic? relationId; int? flag; GetMenuEntriesList menuEntries = GetMenuEntriesList(); @@ -97,8 +97,8 @@ class _FamilyMembersState extends State { style:TextStyle(color: menuEntries.updateButton == 'Y' ? MyColors.grey67Color : MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600), recognizer: TapGestureRecognizer() ..onTap = () async { - relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); - menuEntries.updateButton == 'Y'? showUpdateAlertDialog(context, relationId!.toInt(), 2, "UPDATE"):null; + relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID; + menuEntries.updateButton == 'Y'? showUpdateAlertDialog(context, relationId, 2, "UPDATE"):null; } ) ], @@ -118,8 +118,8 @@ class _FamilyMembersState extends State { ), ], ), - ).onPress(() { relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); - showRemoveAlertDialog(context, relationId!.toInt());}), + ).onPress(() { relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID; + showRemoveAlertDialog(context, relationId);}), ], ), ], @@ -136,7 +136,7 @@ class _FamilyMembersState extends State { )); } - void showUpdateAlertDialog(BuildContext context, int relationId, int flag, String actionType) { + void showUpdateAlertDialog(BuildContext context, relationId, int flag, String actionType) { Widget cancelButton = TextButton( child: Text( LocaleKeys.cancel.tr(), @@ -175,7 +175,7 @@ class _FamilyMembersState extends State { ); } - void showRemoveAlertDialog(BuildContext context, int relationId) { + void showRemoveAlertDialog(BuildContext context, relationId) { Widget cancelButton = TextButton( child: Text( LocaleKeys.cancel.tr(), From af56d8f71b708a5a98335f4b00afe10c110069e5 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 25 Oct 2022 14:55:25 +0300 Subject: [PATCH 03/11] fix issues --- lib/ui/screens/items_for_sale/fragments/items_for_sale.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ui/screens/items_for_sale/fragments/items_for_sale.dart b/lib/ui/screens/items_for_sale/fragments/items_for_sale.dart index ca75a7a..50a89cc 100644 --- a/lib/ui/screens/items_for_sale/fragments/items_for_sale.dart +++ b/lib/ui/screens/items_for_sale/fragments/items_for_sale.dart @@ -4,6 +4,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:mohem_flutter_app/api/items_for_sale/items_for_sale_api_client.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/config/routes.dart'; @@ -98,7 +99,9 @@ class _ItemsForSaleFragmentState extends State { currentCategoryID == getSaleCategoriesList[index].categoryID ? const Icon(Icons.check_circle_rounded, color: MyColors.greenColor, size: 16.0) : Container(), ], ).expanded, - getSaleCategoriesList[index].title!.toText10() + AppState().isArabic(context) + ?getSaleCategoriesList[index].titleAr!.toText10() + :getSaleCategoriesList[index].title!.toText10() ], ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12).expanded.objectContainerView(disablePadding: true), ), From 8b0bae0891657a227fef46a691ad1d1d3602a8ba Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 25 Oct 2022 17:49:16 +0300 Subject: [PATCH 04/11] Worklist updates --- lib/api/api_client.dart | 4 +- lib/classes/utils.dart | 8 +- lib/provider/dashboard_provider_model.dart | 6 +- lib/ui/landing/widget/app_drawer.dart | 1 + .../offers_and_discounts_home.dart | 9 +- lib/ui/work_list/work_list_screen.dart | 29 +++--- lib/ui/work_list/worklist_detail_screen.dart | 96 +++++++++---------- .../dialogs/accept_reject_input_dialog.dart | 4 +- 8 files changed, 83 insertions(+), 74 deletions(-) diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index 7a6f668..dc9375d 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -81,8 +81,8 @@ class ApiClient { } if (!kReleaseMode) { print("Url:$url"); - var bodyJson = json.encode(jsonObject); - print("body:$bodyJson"); + // var bodyJson = json.encode(jsonObject); + // print("body:$bodyJson"); } var response = await postJsonForResponse(url, jsonObject, token: token, diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart index dbe451c..af9e340 100644 --- a/lib/classes/utils.dart +++ b/lib/classes/utils.dart @@ -52,6 +52,10 @@ class Utils { } } + static Future delay(int millis) async { + return await Future.delayed(Duration(milliseconds: millis)); + } + static void showLoading(BuildContext context) { WidgetsBinding.instance.addPostFrameCallback((_) { _isLoadingVisible = true; @@ -65,10 +69,6 @@ class Utils { }); } - static Future delay(int millis) async { - return await Future.delayed(Duration(milliseconds: millis)); - } - static void hideLoading(BuildContext context) { if (_isLoadingVisible) { _isLoadingVisible = false; diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index c5286ef..eaa6277 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -134,15 +134,15 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0; - itgFormsModel = await DashboardApiClient().getItgFormsPendingTask(); - workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0); + if (showLoading) Utils.hideLoading(context); GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications(); cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem; if (cocCount != null) { cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0); workListCounter += cocFinalCount; } - if (showLoading) Utils.hideLoading(context); + itgFormsModel = await DashboardApiClient().getItgFormsPendingTask(); + workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0); notifyListeners(); } catch (ex) { isWorkListLoading = false; diff --git a/lib/ui/landing/widget/app_drawer.dart b/lib/ui/landing/widget/app_drawer.dart index 67adfcb..ac70035 100644 --- a/lib/ui/landing/widget/app_drawer.dart +++ b/lib/ui/landing/widget/app_drawer.dart @@ -164,6 +164,7 @@ class _AppDrawerState extends State { AppState().setPostParamsModel(obj!); Navigator.pop(context); widget.onLanguageChange(); + setState(() {}); } void performLogout() async { diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart index e33a161..45247dc 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart @@ -183,7 +183,6 @@ class _OffersAndDiscountsHomeState extends State { ), ), ), - 10.height, AppState().isArabic(context) ? getOffersList.titleAR!.toText16(isBold: true, color: const Color(0xff2B353E), maxlines: 1) : getOffersList.title!.toText16(isBold: true, color: const Color(0xff2B353E), maxlines: 1), @@ -194,7 +193,7 @@ class _OffersAndDiscountsHomeState extends State { // // } // ), getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), - 16.height, + // 8.height, getOffersList.discount!.toText14(isBold: true, maxlines: 1), 10.height, Row( @@ -212,7 +211,11 @@ class _OffersAndDiscountsHomeState extends State { if (enteredKeyword.isEmpty) { results = getOffersList; } else { - results = getOffersList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList(); + if(AppState().isArabic(context)) { + results = getOffersList.where((offer) => offer.titleAR!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList(); + } else { + results = getOffersList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList(); + } } setState(() { _foundOffersList = results; diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 369bf0c..190ac71 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -120,9 +120,8 @@ class _WorkListScreenState extends State { ItgFormsModel? itgFormsModel; int? itgRequestTypeIndex; - Future getWorkList({bool showLoading = true}) async { + Future getWorkList({bool showLoading = true, bool callWorkList = true}) async { try { - if (showLoading) Utils.showLoading(context); if (workListItemTypes[workListItemIndex].key == "ITG") { itgFormsModel = await WorkListApiClient().getITGTaskCountRequestType(); List requestAllList = []; @@ -138,31 +137,36 @@ class _WorkListScreenState extends State { itgRequestTypeIndex = 0; } } else { + if (showLoading) Utils.showLoading(context); itgRequestTypeIndex = null; - workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex].key, pNotificationType.toString()); - AppState().setWorkList = workList; + if (callWorkList) { + workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex].key, pNotificationType.toString()); + AppState().setWorkList = workList; + } + if (showLoading) Utils.hideLoading(context); + setState(() {}); } - if (showLoading) Utils.hideLoading(context); - if (showLoading) setState(() {}); } catch (ex) { if (showLoading) Utils.hideLoading(context); if (showLoading) Utils.handleException(ex, context, null); } } - void _onRefresh() async { + void _onRefresh({bool callWorkList = true}) async { try { _refreshController.refreshCompleted(); - Utils.showLoading(context); + if(callWorkList) Utils.showLoading(context); List dataOnRefresh = await Future.wait([ - providerData.fetchWorkListCounter(context, showLoading: false), - getWorkList(showLoading: false), + providerData.fetchWorkListCounter(context, showLoading: true).then((value) { + setState(() {}); + }), + getWorkList(showLoading: false, callWorkList: callWorkList), ]); calculateCounter(); - Utils.hideLoading(context); + if(callWorkList) Utils.hideLoading(context); setState(() {}); } catch (ex) { - Utils.hideLoading(context); + if(callWorkList) Utils.hideLoading(context); Utils.handleException(ex, context, null); } } @@ -443,6 +447,7 @@ class _WorkListScreenState extends State { if (mounted) setState(() {}); } } else { + _onRefresh(callWorkList: false); if (mounted) setState(() {}); } }, diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 7aea35e..feb424e 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -40,6 +40,7 @@ import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dar import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; class WorkListDetailScreen extends StatefulWidget { + WorkListDetailScreen({Key? key}) : super(key: key); @override @@ -98,6 +99,12 @@ class _WorkListDetailScreenState extends State { if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { getUserInformation(); } + + getNotificationButtons(); + notificationGetRespondAttributes(); + getAttachments(); + getActionHistory(); + if (workListData!.iTEMTYPE == "HRSSA") { if (workListData!.rEQUESTTYPE == "EIT") { getEitNotificationBody(); @@ -130,8 +137,6 @@ class _WorkListDetailScreenState extends State { getPRNotification(); } - notificationGetRespondAttributes(); - // List dataToFetch = await Future.wait([ // // WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!), @@ -142,10 +147,6 @@ class _WorkListDetailScreenState extends State { // actionHistoryList = dataToFetch[1]; // getAttachmentList = dataToFetch[2]; - getNotificationButtons(); - getActionHistory(); - getAttachments(); - // if (notificationButtonsList.isNotEmpty) { // isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE"); // isApproveAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "APPROVED"); @@ -487,7 +488,6 @@ class _WorkListDetailScreenState extends State { builder: (cxt) => AcceptRejectInputDialog( message: LocaleKeys.requestedItems.tr(), notificationGetRespond: notificationNoteInput, - textEditingController: textEditingController, onTap: (note) { Map payload = { "P_ACTION_MODE": actionMode, @@ -503,7 +503,7 @@ class _WorkListDetailScreenState extends State { } ], }; - if (actionMode == "APPROVED" || actionMode == "APPROVE") { + if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE") { performNotificationAction(payload); } else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) { performNotificationAction(payload); @@ -540,34 +540,34 @@ class _WorkListDetailScreenState extends State { void getEitNotificationBody() async { try { - if (apiCallCount == 0) Utils.showLoading(context); - apiCallCount++; + // if (apiCallCount == 0) Utils.showLoading(context); + // apiCallCount++; getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); - apiCallCount--; - if (apiCallCount == 0) { - Utils.hideLoading(context); + // apiCallCount--; + // if (apiCallCount == 0) { + // Utils.hideLoading(context); setState(() {}); - } + // } } catch (ex) { - apiCallCount--; - Utils.hideLoading(context); + // apiCallCount--; + // Utils.hideLoading(context); Utils.handleException(ex, context, null); } } void getUserInformation() async { try { - if (apiCallCount == 0) Utils.showLoading(context); - apiCallCount++; + // if (apiCallCount == 0) Utils.showLoading(context); + // apiCallCount++; memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); - apiCallCount--; - if (apiCallCount == 0) { - Utils.hideLoading(context); + // apiCallCount--; + // if (apiCallCount == 0) { + // Utils.hideLoading(context); setState(() {}); - } + // } } catch (ex) { - apiCallCount--; - Utils.hideLoading(context); + // apiCallCount--; + // Utils.hideLoading(context); Utils.handleException(ex, context, null); } } @@ -608,17 +608,17 @@ class _WorkListDetailScreenState extends State { void getAbsenceNotificationBody() async { try { - if (apiCallCount == 0) Utils.showLoading(context); - apiCallCount++; + // if (apiCallCount == 0) Utils.showLoading(context); + // apiCallCount++; getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID); - apiCallCount--; - if (apiCallCount == 0) { - Utils.hideLoading(context); + // apiCallCount--; + // if (apiCallCount == 0) { + // Utils.hideLoading(context); setState(() {}); - } + // } } catch (ex) { - apiCallCount--; - Utils.hideLoading(context); + // apiCallCount--; + // Utils.hideLoading(context); Utils.handleException(ex, context, null); } } @@ -731,20 +731,20 @@ class _WorkListDetailScreenState extends State { void notificationGetRespondAttributes() async { try { - if (apiCallCount == 0) Utils.showLoading(context); - apiCallCount++; + // if (apiCallCount == 0) Utils.showLoading(context); + // apiCallCount++; getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); if (getNotificationRespondAttributes.isNotEmpty) { notificationNoteInput = getNotificationRespondAttributes.first; } - apiCallCount--; - if (apiCallCount == 0) { - Utils.hideLoading(context); + // apiCallCount--; + // if (apiCallCount == 0) { + // Utils.hideLoading(context); setState(() {}); - } + // } } catch (ex) { - apiCallCount--; - Utils.hideLoading(context); + // apiCallCount--; + // Utils.hideLoading(context); Utils.handleException(ex, context, null); } } @@ -773,17 +773,17 @@ class _WorkListDetailScreenState extends State { void getActionHistory() async { try { - if (apiCallCount == 0) Utils.showLoading(context); - apiCallCount++; + // if (apiCallCount == 0) Utils.showLoading(context); + // apiCallCount++; actionHistoryList = await WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!); - apiCallCount--; - if (apiCallCount == 0) { - Utils.hideLoading(context); + // apiCallCount--; + // if (apiCallCount == 0) { + // Utils.hideLoading(context); setState(() {}); - } + // } } catch (ex) { - apiCallCount--; - Utils.hideLoading(context); + // apiCallCount--; + // Utils.hideLoading(context); Utils.handleException(ex, context, null); } } diff --git a/lib/widgets/dialogs/accept_reject_input_dialog.dart b/lib/widgets/dialogs/accept_reject_input_dialog.dart index ea84484..ef2cfaa 100644 --- a/lib/widgets/dialogs/accept_reject_input_dialog.dart +++ b/lib/widgets/dialogs/accept_reject_input_dialog.dart @@ -15,9 +15,9 @@ class AcceptRejectInputDialog extends StatelessWidget { final String? okTitle; final NotificationGetRespondAttributesList? notificationGetRespond; final Function(String) onTap; - final TextEditingController textEditingController; + // final TextEditingController textEditingController; - AcceptRejectInputDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.notificationGetRespond, required this.textEditingController}) : super(key: key); + AcceptRejectInputDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.notificationGetRespond}) : super(key: key); String note = ""; From b2810b53babcdfff0d23e134fe5ba02c1fb552f6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 26 Oct 2022 10:13:30 +0300 Subject: [PATCH 05/11] Revert yesterday changes --- lib/provider/dashboard_provider_model.dart | 6 +- lib/ui/work_list/work_list_screen.dart | 29 ++++---- lib/ui/work_list/worklist_detail_screen.dart | 69 ++++++++++---------- 3 files changed, 49 insertions(+), 55 deletions(-) diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index eaa6277..c5286ef 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -134,15 +134,15 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0; - if (showLoading) Utils.hideLoading(context); + itgFormsModel = await DashboardApiClient().getItgFormsPendingTask(); + workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0); GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications(); cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem; if (cocCount != null) { cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0); workListCounter += cocFinalCount; } - itgFormsModel = await DashboardApiClient().getItgFormsPendingTask(); - workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0); + if (showLoading) Utils.hideLoading(context); notifyListeners(); } catch (ex) { isWorkListLoading = false; diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 190ac71..369bf0c 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -120,8 +120,9 @@ class _WorkListScreenState extends State { ItgFormsModel? itgFormsModel; int? itgRequestTypeIndex; - Future getWorkList({bool showLoading = true, bool callWorkList = true}) async { + Future getWorkList({bool showLoading = true}) async { try { + if (showLoading) Utils.showLoading(context); if (workListItemTypes[workListItemIndex].key == "ITG") { itgFormsModel = await WorkListApiClient().getITGTaskCountRequestType(); List requestAllList = []; @@ -137,36 +138,31 @@ class _WorkListScreenState extends State { itgRequestTypeIndex = 0; } } else { - if (showLoading) Utils.showLoading(context); itgRequestTypeIndex = null; - if (callWorkList) { - workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex].key, pNotificationType.toString()); - AppState().setWorkList = workList; - } - if (showLoading) Utils.hideLoading(context); - setState(() {}); + workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex].key, pNotificationType.toString()); + AppState().setWorkList = workList; } + if (showLoading) Utils.hideLoading(context); + if (showLoading) setState(() {}); } catch (ex) { if (showLoading) Utils.hideLoading(context); if (showLoading) Utils.handleException(ex, context, null); } } - void _onRefresh({bool callWorkList = true}) async { + void _onRefresh() async { try { _refreshController.refreshCompleted(); - if(callWorkList) Utils.showLoading(context); + Utils.showLoading(context); List dataOnRefresh = await Future.wait([ - providerData.fetchWorkListCounter(context, showLoading: true).then((value) { - setState(() {}); - }), - getWorkList(showLoading: false, callWorkList: callWorkList), + providerData.fetchWorkListCounter(context, showLoading: false), + getWorkList(showLoading: false), ]); calculateCounter(); - if(callWorkList) Utils.hideLoading(context); + Utils.hideLoading(context); setState(() {}); } catch (ex) { - if(callWorkList) Utils.hideLoading(context); + Utils.hideLoading(context); Utils.handleException(ex, context, null); } } @@ -447,7 +443,6 @@ class _WorkListScreenState extends State { if (mounted) setState(() {}); } } else { - _onRefresh(callWorkList: false); if (mounted) setState(() {}); } }, diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index feb424e..f2cd760 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -40,7 +40,6 @@ import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dar import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; class WorkListDetailScreen extends StatefulWidget { - WorkListDetailScreen({Key? key}) : super(key: key); @override @@ -100,8 +99,8 @@ class _WorkListDetailScreenState extends State { getUserInformation(); } - getNotificationButtons(); notificationGetRespondAttributes(); + getNotificationButtons(); getAttachments(); getActionHistory(); @@ -503,7 +502,7 @@ class _WorkListDetailScreenState extends State { } ], }; - if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE") { + if (actionMode == "APPROVED" || actionMode == "APPROVE") { performNotificationAction(payload); } else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) { performNotificationAction(payload); @@ -540,34 +539,34 @@ class _WorkListDetailScreenState extends State { void getEitNotificationBody() async { try { - // if (apiCallCount == 0) Utils.showLoading(context); - // apiCallCount++; + if (apiCallCount == 0) Utils.showLoading(context); + apiCallCount++; getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); - // apiCallCount--; - // if (apiCallCount == 0) { - // Utils.hideLoading(context); + apiCallCount--; + if (apiCallCount == 0) { + Utils.hideLoading(context); setState(() {}); - // } + } } catch (ex) { - // apiCallCount--; - // Utils.hideLoading(context); + apiCallCount--; + Utils.hideLoading(context); Utils.handleException(ex, context, null); } } void getUserInformation() async { try { - // if (apiCallCount == 0) Utils.showLoading(context); - // apiCallCount++; + if (apiCallCount == 0) Utils.showLoading(context); + apiCallCount++; memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); - // apiCallCount--; - // if (apiCallCount == 0) { - // Utils.hideLoading(context); + apiCallCount--; + if (apiCallCount == 0) { + Utils.hideLoading(context); setState(() {}); - // } + } } catch (ex) { - // apiCallCount--; - // Utils.hideLoading(context); + apiCallCount--; + Utils.hideLoading(context); Utils.handleException(ex, context, null); } } @@ -608,17 +607,17 @@ class _WorkListDetailScreenState extends State { void getAbsenceNotificationBody() async { try { - // if (apiCallCount == 0) Utils.showLoading(context); - // apiCallCount++; + if (apiCallCount == 0) Utils.showLoading(context); + apiCallCount++; getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID); - // apiCallCount--; - // if (apiCallCount == 0) { - // Utils.hideLoading(context); + apiCallCount--; + if (apiCallCount == 0) { + Utils.hideLoading(context); setState(() {}); - // } + } } catch (ex) { - // apiCallCount--; - // Utils.hideLoading(context); + apiCallCount--; + Utils.hideLoading(context); Utils.handleException(ex, context, null); } } @@ -731,20 +730,20 @@ class _WorkListDetailScreenState extends State { void notificationGetRespondAttributes() async { try { - // if (apiCallCount == 0) Utils.showLoading(context); - // apiCallCount++; + if (apiCallCount == 0) Utils.showLoading(context); + apiCallCount++; getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); if (getNotificationRespondAttributes.isNotEmpty) { notificationNoteInput = getNotificationRespondAttributes.first; } - // apiCallCount--; - // if (apiCallCount == 0) { - // Utils.hideLoading(context); + apiCallCount--; + if (apiCallCount == 0) { + Utils.hideLoading(context); setState(() {}); - // } + } } catch (ex) { - // apiCallCount--; - // Utils.hideLoading(context); + apiCallCount--; + Utils.hideLoading(context); Utils.handleException(ex, context, null); } } From e2519b5df2335f3424344e0a4fe9e81862198de1 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 26 Oct 2022 10:30:08 +0300 Subject: [PATCH 06/11] fix issues --- lib/ui/my_team/employee_details.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ui/my_team/employee_details.dart b/lib/ui/my_team/employee_details.dart index e33dad8..82d289d 100644 --- a/lib/ui/my_team/employee_details.dart +++ b/lib/ui/my_team/employee_details.dart @@ -70,6 +70,7 @@ class _EmployeeDetailsState extends State { extendBody: true, backgroundColor: MyColors.lightGreyEFColor, body: Stack(children: [ + getEmployeeSubordinates!.eMPLOYEEIMAGE != null ? Container( height: 200, margin: EdgeInsets.only(top: 30), @@ -80,6 +81,8 @@ class _EmployeeDetailsState extends State { decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)), ), ), + ) : Container( + decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)), ), SingleChildScrollView( scrollDirection: Axis.vertical, From 2704fcd147dab76c5f22591cd48db06dd07ad99b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 26 Oct 2022 10:57:07 +0300 Subject: [PATCH 07/11] PR Fixes --- .../worklist_fragments/info_fragments.dart | 29 +++++--- .../worklist_fragments/request_fragment.dart | 67 ++++++++++--------- 2 files changed, 56 insertions(+), 40 deletions(-) diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 16a60e0..fb6a8e3 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -456,21 +456,32 @@ class InfoFragment extends StatelessWidget { ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), ), - ItemDetailGrid( - ItemDetailViewCol(getPrNotificationBodyList.pRHeader![2].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![2].hDRATTRIBUTEVALUE ?? ""), - ItemDetailViewCol(getPrNotificationBodyList.pRHeader![0].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![0].hDRATTRIBUTEVALUE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), - Container(), - isItLast: true, - ), + Column( + children: getPRHeaderValues(), + ) + // ItemDetailGrid( + // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![2].hDRATTRIBUTENAME ?? "", getPrNotificationBodyList.pRHeader![2].hDRATTRIBUTEVALUE ?? ""), + // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![0].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![0].hDRATTRIBUTEVALUE ?? ""), + // ), + // ItemDetailGrid( + // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), + // Container(), + // isItLast: true, + // ), ], ).objectContainerView(), ], ); } + List getPRHeaderValues() { + List pRHeaders = []; + getPrNotificationBodyList!.pRHeader!.forEach((element) { + pRHeaders.add(ItemDetailGrid(ItemDetailViewCol(element.hDRATTRIBUTENAME!, element.hDRATTRIBUTEVALUE!), Container())); + }); + return pRHeaders; + } + Widget getContactNotificationBodyListWidget(GetContactNotificationBodyList data) { bool isOdd = false; try { diff --git a/lib/ui/work_list/worklist_fragments/request_fragment.dart b/lib/ui/work_list/worklist_fragments/request_fragment.dart index b900578..b86bb1a 100644 --- a/lib/ui/work_list/worklist_fragments/request_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/request_fragment.dart @@ -115,37 +115,42 @@ class RequestFragment extends StatelessWidget { } Widget prLinesDataView() { - return Column( - children: [ - prLinesList[0].dESCRIPTION.toString().toText14(color: MyColors.textMixColor).objectContainerView(), - 12.height, - Column( - children: [ - ItemDetailGrid( - ItemDetailViewCol("Cost Center", prLinesList[0].cOSTCENTER ?? ""), - ItemDetailViewCol("Code", prLinesList[0].iTEMCODE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("Unit", prLinesList[0].uOM ?? ""), - ItemDetailViewCol("Price (SAR)", prLinesList[0].uNITPRICE.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("Amount (SAR)", prLinesList[0].lINEAMOUNT.toString() ?? ""), - ItemDetailViewCol("Quantity", prLinesList[0].qUANTITY.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("AMU (Last 3 months)", prLinesList[0].iTEMAMU.toString() ?? ""), - Container(), - isItLast: true, - ), - // ItemDetailGrid( - // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), - // Container(), - // isItLast: true, - // ), - ], - ).objectContainerView(), - ], + return ExpandableNotifier( + child: ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, index) => ExpandablePanel( + header: prLinesList[index].dESCRIPTION.toString().toText14(color: MyColors.textMixColor), + collapsed: Column( + children: [ + ItemDetailGrid( + ItemDetailViewCol("Cost Center", prLinesList[index].cOSTCENTER ?? ""), + ItemDetailViewCol("Code", prLinesList[index].iTEMCODE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol("Unit", prLinesList[index].uOM ?? ""), + ItemDetailViewCol("Price (SAR)", prLinesList[index].uNITPRICE.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol("Amount (SAR)", prLinesList[index].lINEAMOUNT.toString() ?? ""), + ItemDetailViewCol("Quantity", prLinesList[index].qUANTITY.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol("AMU (Last 3 months)", prLinesList[index].iTEMAMU.toString() ?? ""), + Container(), + isItLast: true, + ), + // ItemDetailGrid( + // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), + // Container(), + // isItLast: true, + // ), + ], + ), + expanded: const SizedBox(), + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: prLinesList.length), ); } From e4db7e0cc284495dabb6b38a96bba102b15fcfe9 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 26 Oct 2022 11:17:45 +0300 Subject: [PATCH 08/11] fix issues --- lib/ui/attendance/monthly_attendance_screen.dart | 2 ++ lib/ui/my_team/view_attendance.dart | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 39f33a4..439a5f4 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -116,6 +116,8 @@ class _MonthlyAttendanceScreenState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), + confirmText: Text(LocaleKeys.confirm.tr()), + cancelText: Text(LocaleKeys.cancel.tr()), ).then((selectedDate) { if (selectedDate != null) { searchMonth = getMonth(selectedDate.month); diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index 5d55ee8..c77b1b4 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -169,6 +169,8 @@ class _ViewAttendanceState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), + confirmText: Text(LocaleKeys.confirm.tr()), + cancelText: Text(LocaleKeys.cancel.tr()), ).then( (selectedDate) { if (selectedDate != null) { From 2002359ff1daeb96e5b395104ea01984a75e69c2 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 26 Oct 2022 14:58:22 +0300 Subject: [PATCH 09/11] fix issues --- lib/ui/profile/profile_screen.dart | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/ui/profile/profile_screen.dart b/lib/ui/profile/profile_screen.dart index 690633b..533834f 100644 --- a/lib/ui/profile/profile_screen.dart +++ b/lib/ui/profile/profile_screen.dart @@ -44,23 +44,26 @@ class _ProfileScreenState extends State { backgroundColor: const Color(0xffefefef), body: Stack( children: [ - Container( - height: 300, - margin: const EdgeInsets.only(top: 50), - decoration: BoxDecoration( + memberInformationList!.eMPLOYEEIMAGE != null + ? Container( + height: 300, + margin: const EdgeInsets.only(top: 50), + decoration: BoxDecoration( image: DecorationImage( image: MemoryImage( Utils.dataFromBase64String(memberInformationList.eMPLOYEEIMAGE!), ), fit: BoxFit.cover), ), - child: BackdropFilter( + child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), child: Container( color: Colors.white.withOpacity(0.0), ), ), - ), + ): Container( + decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)), + ), SingleChildScrollView( scrollDirection: Axis.vertical, child: Column( From 2d40ede37f74cdb16be7da9640356fbfb7bb8169 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 26 Oct 2022 14:59:18 +0300 Subject: [PATCH 10/11] fix issues --- lib/ui/my_team/employee_details.dart | 2 +- lib/ui/profile/profile_screen.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/my_team/employee_details.dart b/lib/ui/my_team/employee_details.dart index 82d289d..d0e167d 100644 --- a/lib/ui/my_team/employee_details.dart +++ b/lib/ui/my_team/employee_details.dart @@ -82,7 +82,7 @@ class _EmployeeDetailsState extends State { ), ), ) : Container( - decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)), + decoration: BoxDecoration(color: Colors.white.withOpacity(0.0)), ), SingleChildScrollView( scrollDirection: Axis.vertical, diff --git a/lib/ui/profile/profile_screen.dart b/lib/ui/profile/profile_screen.dart index 533834f..c071d3f 100644 --- a/lib/ui/profile/profile_screen.dart +++ b/lib/ui/profile/profile_screen.dart @@ -62,7 +62,7 @@ class _ProfileScreenState extends State { ), ), ): Container( - decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)), + decoration: BoxDecoration(color: Colors.white.withOpacity(0.0)), ), SingleChildScrollView( scrollDirection: Axis.vertical, From 966fb5e209d6c7a115acb1ecc4738e41e2432569 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 26 Oct 2022 16:23:00 +0300 Subject: [PATCH 11/11] Worklist fixes --- assets/langs/en-US.json | 2 +- lib/api/api_client.dart | 4 ++-- lib/generated/codegen_loader.g.dart | 4 ++++ lib/ui/work_list/sheets/delegate_sheet.dart | 8 ++++---- lib/ui/work_list/sheets/selected_item_sheet.dart | 15 +++++++++++---- lib/ui/work_list/worklist_detail_screen.dart | 7 ++++--- .../worklist_fragments/info_fragments.dart | 11 +---------- 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 2a7945c..34ffa75 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -420,7 +420,7 @@ "updateMember": "Are You Sure You Want to Update this Member?", "fieldIsEmpty": "'{data}' Field is empty. Please select", "pleaseEnterComments": "Please enter comments", - "skip": "skip", + "skip": "Skip", "typeCurrentPasswordBelow": "Type Your Current password below", "currentPassword": "Current password", "profile": { diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index dc9375d..7a6f668 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -81,8 +81,8 @@ class ApiClient { } if (!kReleaseMode) { print("Url:$url"); - // var bodyJson = json.encode(jsonObject); - // print("body:$bodyJson"); + var bodyJson = json.encode(jsonObject); + print("body:$bodyJson"); } var response = await postJsonForResponse(url, jsonObject, token: token, diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 5824fe1..2bcecf4 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -435,6 +435,8 @@ class CodegenLoader extends AssetLoader{ "adult": "بالغ", "updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", "fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد", + "pleaseEnterComments": "الرجاء إدخال التعليقات", + "skip": "يتخطى", "typeCurrentPasswordBelow": "اكتب كلمة المرور الحاليه", "currentPassword": "كلمة المرور الحاليه", "profile": { @@ -906,6 +908,8 @@ static const Map en_US = { "adult": "Adult", "updateMember": "Are You Sure You Want to Update this Member?", "fieldIsEmpty": "'{data}' Field is empty. Please select", + "pleaseEnterComments": "Please enter comments", + "skip": "Skip", "typeCurrentPasswordBelow": "Type Your Current password below", "currentPassword": "Current password", "profile": { diff --git a/lib/ui/work_list/sheets/delegate_sheet.dart b/lib/ui/work_list/sheets/delegate_sheet.dart index 75b33c9..2f963a7 100644 --- a/lib/ui/work_list/sheets/delegate_sheet.dart +++ b/lib/ui/work_list/sheets/delegate_sheet.dart @@ -407,10 +407,10 @@ class _DelegateSheetState extends State { child: Row( children: [ CircularAvatar( - url: actionHistory.employeeImage ?? "", + url: actionHistory.employeeImage, height: 30, width: 30, - isImageBase64: true, + isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false, ), 16.width, Expanded( @@ -452,10 +452,10 @@ class _DelegateSheetState extends State { child: Row( children: [ CircularAvatar( - url: actionHistory.employeeImage ?? "", + url: actionHistory.employeeImage, height: 30, width: 30, - isImageBase64: true, + isImageBase64: actionHistory.employeeImage != null ? true : false, ), 16.width, Expanded( diff --git a/lib/ui/work_list/sheets/selected_item_sheet.dart b/lib/ui/work_list/sheets/selected_item_sheet.dart index d406ef3..f3f8f0d 100644 --- a/lib/ui/work_list/sheets/selected_item_sheet.dart +++ b/lib/ui/work_list/sheets/selected_item_sheet.dart @@ -142,10 +142,17 @@ class SelectedItemSheet extends StatelessWidget { padding: EdgeInsets.only(top: 16, bottom: 16, left: 21, right: 21), child: Row( children: [ - CircularAvatar( - height: 30, - width: 30, - ), + actionHistoryList != null + ? CircularAvatar( + height: 30, + width: 30, + url: actionHistoryList!.eMPLOYEEIMAGE, + isImageBase64: true, + ) + : CircularAvatar( + height: 30, + width: 30, + ), 16.width, Expanded( child: (name ?? "").toText12(), diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index f2cd760..b1c2b1e 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -307,7 +307,7 @@ class _WorkListDetailScreenState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - myFab(LocaleKeys.pleaseEnterComments.tr(), "assets/images/skip.svg").onPress(() { + myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() { if (AppState().workList!.length - 1 > AppState().workListIndex!) { AppState().setWorkListIndex = AppState().workListIndex! + 1; workListData = null; @@ -354,7 +354,8 @@ class _WorkListDetailScreenState extends State { if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || notificationButtonsList[i].bUTTONACTION! == "APPROVED" || notificationButtonsList[i].bUTTONACTION! == "CLOSE") { continue; } - fabs.add(myFab(notificationButtonsList[i].bUTTONLABEL!, notificationButtonsList[i].bUTTONICON ?? "", isIconAsset: false) + fabs.add(myFab(notificationButtonsList[i].bUTTONLABEL!, notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? "assets/images/delegate.svg" : notificationButtonsList[i].bUTTONICON ?? "", + isIconAsset: notificationButtonsList[i].bUTTONACTION == "DELEGATE" ? true : false,) .paddingOnly(bottom: 12) .onPress(() => handleFabAction(notificationButtonsList[i]))); } @@ -778,7 +779,7 @@ class _WorkListDetailScreenState extends State { // apiCallCount--; // if (apiCallCount == 0) { // Utils.hideLoading(context); - setState(() {}); + setState(() {}); // } } catch (ex) { // apiCallCount--; diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index fb6a8e3..7cf8aa9 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -440,7 +440,7 @@ class InfoFragment extends StatelessWidget { Widget getPRNotificationBodyListWidget(GetPrNotificationBodyList getPrNotificationBodyList) { return Column( children: [ - getPrNotificationBodyList.pINFORMATION.toString().toText14(color: MyColors.textMixColor).objectContainerView(), + getPrNotificationBodyList.pINFORMATION != null ? getPrNotificationBodyList.pINFORMATION.toString().toText14(color: MyColors.textMixColor).objectContainerView() : Container(), 12.height, Column( children: [ @@ -459,15 +459,6 @@ class InfoFragment extends StatelessWidget { Column( children: getPRHeaderValues(), ) - // ItemDetailGrid( - // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![2].hDRATTRIBUTENAME ?? "", getPrNotificationBodyList.pRHeader![2].hDRATTRIBUTEVALUE ?? ""), - // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![0].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![0].hDRATTRIBUTEVALUE ?? ""), - // ), - // ItemDetailGrid( - // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), - // Container(), - // isItLast: true, - // ), ], ).objectContainerView(), ],