diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 119e418..97cb8e6 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -25,7 +25,6 @@ class ApiConsts { static String chatFavUser = chatServerBaseApiUrl + "FavUser/"; static String chatUserImages = chatServerBaseUrl + "empservice/api/employee/"; - //Brain Marathon Constants static String marathonBaseUrl = "https://marathoon.com/service/api/"; static String marathonParticipantLoginUrl = marathonBaseUrl + "auth/participantlogin"; diff --git a/lib/classes/encryption.dart b/lib/classes/encryption.dart index a4ab6be..a2b45b5 100644 --- a/lib/classes/encryption.dart +++ b/lib/classes/encryption.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:typed_data'; import 'package:flutter/services.dart'; diff --git a/lib/models/chat/get_single_user_chat_list_model.dart b/lib/models/chat/get_single_user_chat_list_model.dart index 07b2f51..80ffa5a 100644 --- a/lib/models/chat/get_single_user_chat_list_model.dart +++ b/lib/models/chat/get_single_user_chat_list_model.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:typed_data'; import 'package:flutter/foundation.dart'; diff --git a/lib/models/get_eit_dff_structure_list_model.dart b/lib/models/get_eit_dff_structure_list_model.dart index 832dc86..3aed98c 100644 --- a/lib/models/get_eit_dff_structure_list_model.dart +++ b/lib/models/get_eit_dff_structure_list_model.dart @@ -210,10 +210,10 @@ class GetEITDFFStructureList { } class ESERVICESDV { - String? pIDCOLUMNNAME; - String? pRETURNMSG; + dynamic pIDCOLUMNNAME; + dynamic pRETURNMSG; String? pRETURNSTATUS; - String? pVALUECOLUMNNAME; + dynamic pVALUECOLUMNNAME; ESERVICESDV({this.pIDCOLUMNNAME, this.pRETURNMSG, this.pRETURNSTATUS, this.pVALUECOLUMNNAME}); @@ -226,10 +226,10 @@ class ESERVICESDV { Map toJson() { Map data = new Map(); - data['P_ID_COLUMN_NAME'] = this.pIDCOLUMNNAME; - data['P_RETURN_MSG'] = this.pRETURNMSG; - data['P_RETURN_STATUS'] = this.pRETURNSTATUS; - data['P_VALUE_COLUMN_NAME'] = this.pVALUECOLUMNNAME; + data['P_ID_COLUMN_NAME'] = pIDCOLUMNNAME; + data['P_RETURN_MSG'] = pRETURNMSG; + data['P_RETURN_STATUS'] = pRETURNSTATUS; + data['P_VALUE_COLUMN_NAME'] = pVALUECOLUMNNAME; return data; } } diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 5fb4cbf..3f55417 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'dart:typed_data'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 08d2be7..62cafbd 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -50,18 +50,6 @@ class _DynamicInputScreenState extends State { descFlexConTextTitle = genericResponseModel!.pDESCFLEXCONTEXTNAME ?? ""; getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); - if (dynamicParams!.collectionNotificationList != null && dynamicParams!.collectionNotificationList!.isNotEmpty) { - getEitDffStructureList!.forEach((element) { - dynamicParams!.collectionNotificationList!.forEach((element2) { - if (element.sEGMENTNAME == element2.segmentName) { - element.fieldAnswer = element2.varchar2Value; - element.eSERVICESDV ??= ESERVICESDV(); - element.eSERVICESDV!.pIDCOLUMNNAME = element2.varchar2Value; - } - }); - }); - } - Utils.hideLoading(context); setState(() {}); } catch (ex) { @@ -108,11 +96,9 @@ class _DynamicInputScreenState extends State { SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp ?? ''); Utils.hideLoading(context); - var res = await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, + await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit')); - if (res != null && res == true) { - Utils.showLoading(context); - } + Utils.showLoading(context); await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!); Utils.hideLoading(context); } catch (ex) { @@ -345,7 +331,7 @@ class _DynamicInputScreenState extends State { idColName = val; if (getEitDffStructureList![j].fORMATTYPE == "X") { - idColName = Utils.formatDateDefault(idColName!); + idColName = Utils.formatDateNew(idColName!); // commenting to test // DateTime date = DateFormat('yyyy-MM-dd').parse(idColName!); // idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date); @@ -498,7 +484,7 @@ class _DynamicInputScreenState extends State { return DynamicTextFieldWidget( (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), model.eSERVICESDV?.pIDCOLUMNNAME ?? "", - // isReadOnly: model.rEADONLY == "Y", + isReadOnly: model.rEADONLY == "Y", isInputTypeNum: true, onChange: (text) { model.fieldAnswer = text; diff --git a/lib/ui/profile/contact_details.dart b/lib/ui/profile/contact_details.dart index 95c867a..78afc1c 100644 --- a/lib/ui/profile/contact_details.dart +++ b/lib/ui/profile/contact_details.dart @@ -1,3 +1,4 @@ +import 'package:auto_size_text/auto_size_text.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/api/profile_api_client.dart'; @@ -14,6 +15,7 @@ import 'package:mohem_flutter_app/models/get_employee_address_model.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; +import 'package:mohem_flutter_app/ui/misc/no_data_ui.dart'; import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_address_screen.dart'; import 'package:mohem_flutter_app/ui/profile/phone_numbers.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; @@ -33,7 +35,7 @@ class _ContactDetailsState extends State { String? civilIdentityNumber = ""; String? emailAddress = ""; String? employeeNo = ""; - int? correctOrNew = 1; + int? correctOrNew = 2; List getEmployeePhonesList = []; List getEmployeeAddressList = []; List getEmployeeBasicDetailsList = []; @@ -99,16 +101,17 @@ class _ContactDetailsState extends State { separatorBuilder: (cxt, index) => 12.height, itemCount: getEmployeePhonesList.length), if (menuEntriesPhone.updateButton == 'Y') - AppState().isArabic(context)? Positioned( - top: 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), - ), + AppState().isArabic(context) + ? Positioned( + top: 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, @@ -129,16 +132,35 @@ class _ContactDetailsState extends State { separatorBuilder: (cxt, index) => 12.height, itemCount: getEmployeeAddressList.length), if (menuEntriesAddress.updateButton == 'Y') - AppState().isArabic(context)? Positioned( - top: 1, - left: 1, - child: const Icon(Icons.edit_location_alt_outlined, size: 20).onPress(addUpdateAddress), - ) - :Positioned( - top: 1, - right: 1, - child: const Icon(Icons.edit_location_alt_outlined, size: 20).onPress(addUpdateAddress), - ), + AppState().isArabic(context) + ? Positioned( + top: 1, + left: 1, + child: const Icon(Icons.edit_location_alt_outlined, size: 20).onPress(addUpdateAddress), + ) + : Positioned( + top: 1, + right: 1, + child: const Icon(Icons.edit_location_alt_outlined, size: 20).onPress(addUpdateAddress), + ), + ], + ).objectContainerView() + else + Stack( + children: [ + if (menuEntriesAddress.addButton == 'Y') + AppState().isArabic(context) + ? Positioned( + top: 1, + left: 1, + child: const Icon(Icons.add_location_alt_outlined, size: 20).onPress(continueDynamicForms), + ) + : Positioned( + top: 1, + right: 1, + child: const Icon(Icons.add_location_alt_outlined, size: 20).onPress(continueDynamicForms), + ), + Utils.getNoDataWidget(context).expanded, ], ).objectContainerView() ], diff --git a/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart b/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart index 226eae9..a233839 100644 --- a/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart +++ b/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart @@ -191,7 +191,8 @@ class _DynamicInputScreenState extends State { ], onSelected: (int popupIndex) { model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME; - model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].dESCRIPTION; + model?.getEmployeeAddressList!.vARCHAR2VALUE = + model.eSERVICESVS![popupIndex].dESCRIPTION != "" ? model.eSERVICESVS![popupIndex].dESCRIPTION : model.eSERVICESVS![popupIndex].iDCOLUMNNAME; setState(() {}); }); } @@ -282,7 +283,7 @@ class _DynamicInputScreenState extends State { tempVar = e.getEmployeeAddressList!.sEGMENTVALUEDSP ?? ""; } - return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 0, vARCHAR2VALUE: tempVar.toString()).toJson(); + return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: 0, tRANSACTIONNUMBER: 0, vARCHAR2VALUE: tempVar.toString()).toJson(); }).toList(); submitPhoneNumbers = await ProfileApiClient().submitAddressTransaction( @@ -291,7 +292,7 @@ class _DynamicInputScreenState extends State { values, dynamicParams!.correctOrNew, countryCode, - effectiveDate.isEmpty ? DateFormat('dd-MMM-yyy').format(DateTime.now().add(Duration(days: 35))) : effectiveDate, + effectiveDate.isEmpty ? DateFormat('dd-MMM-yyy').format(DateTime.now()) : effectiveDate, ); print(values); Utils.hideLoading(context); diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index 25f62c0..6c564e3 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -34,12 +34,12 @@ class _FamilyMembersState extends State { @override void initState() { super.initState(); - List menuData = Provider.of(context, listen: false).getMenuEntriesList!; + List menuData = Provider.of(context, listen: false).getMenuEntriesList!; - List arr = menuData.where((GetMenuEntriesList e) => e.requestType == 'CONTACT').toList(); - if(arr.isNotEmpty){ + List arr = menuData.where((GetMenuEntriesList e) => e.requestType == 'CONTACT').toList(); + if (arr.isNotEmpty) { menuEntries = arr[0]; - }else{ + } else { menuEntries = new GetMenuEntriesList(); } @@ -66,9 +66,10 @@ class _FamilyMembersState extends State { ), backgroundColor: MyColors.backgroundColor, body: Column( - children: [ + children: [ Expanded( - child: getEmployeeContactsList.isEmpty ? Utils.getNoDataWidget(context) + child: getEmployeeContactsList.isEmpty + ? Utils.getNoDataWidget(context) : ListView.separated( padding: const EdgeInsets.all(21), separatorBuilder: (cxt, index) => 12.height, @@ -87,57 +88,68 @@ class _FamilyMembersState extends State { children: [ // todo @faitma clean below logic and write clean code. RichText( - text: TextSpan( - children: [ - WidgetSpan( - child: Icon(Icons.edit, size: 14, color: menuEntries.updateButton == 'Y' ? MyColors.grey67Color : MyColors.lightGreyColor,) - ), - TextSpan( - text: LocaleKeys.update.tr(), - 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; - menuEntries.updateButton == 'Y'? showUpdateAlertDialog(context, relationId, 2, "UPDATE"):null; - } - ) - ], - ), - ), - Container(height: 35, width: 1, color: const Color(0xffEFEFEF)), - RichText( - text: TextSpan( - children: [ - const WidgetSpan( + text: TextSpan( + children: [ + WidgetSpan( child: Icon( - Icons.delete, size: 15, color: MyColors.redColor,), - ), - TextSpan( - text: LocaleKeys.remove.tr(), - style: const TextStyle(color: MyColors.redColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600), + Icons.edit, + size: 14, + color: menuEntries.updateButton == 'Y' ? MyColors.grey67Color : MyColors.lightGreyColor, + )), + TextSpan( + text: LocaleKeys.update.tr(), + 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; + menuEntries.updateButton == 'Y' ? showUpdateAlertDialog(context, relationId, 2, "UPDATE") : null; + }) + ], + ), + ), + Container(height: 35, width: 1, color: const Color(0xffEFEFEF)), + RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.delete, + size: 15, + color: menuEntries.updateButton == 'Y' ? MyColors.redColor : MyColors.lightGreyColor, ), - ], - ), - ).onPress(() { relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID; - showRemoveAlertDialog(context, relationId);}), + ), + TextSpan( + text: LocaleKeys.remove.tr(), + style: TextStyle( + color: menuEntries.updateButton == 'Y' ? MyColors.redColor : MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600), + ), + ], + ), + ).onPress(() { + relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID; + menuEntries.updateButton == 'Y' ? showRemoveAlertDialog(context, relationId) : null; + }), ], ), ], ).objectContainerView(disablePadding: true); }), ), - DefaultButton(LocaleKeys.addNewFamilyMember.tr(), - menuEntries.updateButton == 'Y' - ? - () async { - Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); - // ProfileScreen(); - } : null).insideContainer, + DefaultButton( + LocaleKeys.addNewFamilyMember.tr(), + menuEntries.updateButton == 'Y' + ? () async { + Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); + // ProfileScreen(); + } + : null) + .insideContainer, ], )); } - void showUpdateAlertDialog(BuildContext context, relationId, int flag, String actionType) { + void showUpdateAlertDialog(BuildContext context, relationId, int flag, String actionType) { Widget cancelButton = TextButton( child: Text( LocaleKeys.cancel.tr(), @@ -176,7 +188,7 @@ class _FamilyMembersState extends State { ); } - void showRemoveAlertDialog(BuildContext context, relationId) { + void showRemoveAlertDialog(BuildContext context, relationId) { Widget cancelButton = TextButton( child: Text( LocaleKeys.cancel.tr(), diff --git a/pubspec.yaml b/pubspec.yaml index 39afde3..4fc00c8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -99,8 +99,6 @@ dependencies: video_player: ^2.4.7 just_audio: ^0.9.30 - safe_device: ^1.1.2 - dev_dependencies: flutter_test: sdk: flutter