From 1e7ff09f140942ff4ff7137f969c28f84ad1a856 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 11 Dec 2022 17:23:25 +0300 Subject: [PATCH 1/4] loader uncommented --- lib/ui/leave_balance/add_leave_balance_screen.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ui/leave_balance/add_leave_balance_screen.dart b/lib/ui/leave_balance/add_leave_balance_screen.dart index ed8396f..5ef03f4 100644 --- a/lib/ui/leave_balance/add_leave_balance_screen.dart +++ b/lib/ui/leave_balance/add_leave_balance_screen.dart @@ -96,7 +96,7 @@ class _AddLeaveBalanceScreenState extends State { } void validateAbsenceTransaction(selectedID) async { - //try { + try { Utils.showLoading(context); Map dffDataMap = {}; for (int i = 1; i <= 20; i++) { @@ -145,10 +145,10 @@ class _AddLeaveBalanceScreenState extends State { } await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!); Utils.hideLoading(context); - // } catch (ex) { - // Utils.hideLoading(context); - // Utils.handleException(ex, context, null); - // } + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } } @override From 43fb34c218c7455d725193e24abe300efd4979b9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 12 Dec 2022 16:15:50 +0300 Subject: [PATCH 2/4] fixes --- lib/classes/utils.dart | 4 ++-- lib/models/member_information_list_model.dart | 2 +- lib/ui/profile/contact_details.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart index 050ae4d..1336f3f 100644 --- a/lib/classes/utils.dart +++ b/lib/classes/utils.dart @@ -121,8 +121,8 @@ class Utils { ), ); } else { - // showToast(errorMessage); - confirmDialog(cxt, errorMessage); + showToast(errorMessage); + // confirmDialog(cxt, errorMessage); } } } diff --git a/lib/models/member_information_list_model.dart b/lib/models/member_information_list_model.dart index 4225905..4871855 100644 --- a/lib/models/member_information_list_model.dart +++ b/lib/models/member_information_list_model.dart @@ -48,7 +48,7 @@ class MemberInformationListModel { String? nATIONALITYCODE; String? nATIONALITYMEANING; String? nATIONALIDENTIFIER; - String? nORMALHOURS; + dynamic? nORMALHOURS; int? nOOFROWS; int? oRGANIZATIONID; String? oRGANIZATIONNAME; diff --git a/lib/ui/profile/contact_details.dart b/lib/ui/profile/contact_details.dart index 4d28a81..749978e 100644 --- a/lib/ui/profile/contact_details.dart +++ b/lib/ui/profile/contact_details.dart @@ -160,7 +160,7 @@ class _ContactDetailsState extends State { right: 1, child: const Icon(Icons.add_location_alt_outlined, size: 20).onPress(continueDynamicForms), ), - Utils.getNoDataWidget(context).expanded, + Utils.getNoDataWidget(context), ], ).objectContainerView() ], From 4a513c08d905ba8e82613ce4f0f889a9953e088f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 13 Dec 2022 10:46:30 +0300 Subject: [PATCH 3/4] fixes --- lib/classes/consts.dart | 1 + lib/classes/utils.dart | 2 +- lib/main.dart | 5 ++++ .../get_time_card_summary_list_model.dart | 24 +++++++++---------- lib/ui/landing/dashboard_screen.dart | 2 +- lib/ui/work_list/worklist_detail_screen.dart | 22 ++++++++++++++++- 6 files changed, 41 insertions(+), 15 deletions(-) diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index e9b902a..3d58efd 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -3,6 +3,7 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; class ApiConsts { //static String baseUrl = "http://10.200.204.20:2801/"; // Local server // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server + // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart index 1336f3f..3be8356 100644 --- a/lib/classes/utils.dart +++ b/lib/classes/utils.dart @@ -37,7 +37,7 @@ class Utils { timeInSecForIosWeb: 1, backgroundColor: Colors.black54, textColor: Colors.white, - fontSize: 16.0); + fontSize: 13.0); } static dynamic getNotNullValue(List list, int index) { diff --git a/lib/main.dart b/lib/main.dart index aa9f933..fdc4ad6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:logger/logger.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/consts.dart'; @@ -37,6 +38,10 @@ bool isTablet = false; Future main() async { WidgetsFlutterBinding.ensureInitialized(); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); await EasyLocalization.ensureInitialized(); AppState().setPostParamsInitConfig(); HttpOverrides.global = MyHttpOverrides(); diff --git a/lib/models/get_time_card_summary_list_model.dart b/lib/models/get_time_card_summary_list_model.dart index 85a2a8e..becc1d2 100644 --- a/lib/models/get_time_card_summary_list_model.dart +++ b/lib/models/get_time_card_summary_list_model.dart @@ -1,41 +1,41 @@ class GetTimeCardSummaryList { - int? aBSENTDAYS; + num? aBSENTDAYS; dynamic? aCTUALHRS; dynamic? aPPROVEDTIMEBACKHRS; - int? aSSIGNMENTID; - int? aTTENDEDDAYS; - int? bUSINESSTRIP; + num? aSSIGNMENTID; + num? aTTENDEDDAYS; + num? bUSINESSTRIP; dynamic? cOMPOFFHHRS; dynamic? cOMPOFFNHRS; dynamic? cOMPOFFWHRS; dynamic? dESIREDSCHEDULEDHRS; dynamic? eARLYOUTHRS; dynamic? eXCESSHRS; - int? hALFDAYLEAVE; + num? hALFDAYLEAVE; dynamic? lATEINHRS; dynamic? lEAVESHOLIDAYSHRS; dynamic? nONSCHEDULEDAYS; dynamic? nOTANALYZEDDAYS; - int? oFFDAYS; + num? oFFDAYS; dynamic? oNCALLHRS; dynamic? pAIDLEAVE; - int? pERIODDAYS; + num? pERIODDAYS; dynamic? pLANNEDOTHRS; - int? pUBLICHOLIDAY; + num? pUBLICHOLIDAY; dynamic? sCHEDULEDHRS; dynamic? sCHEDULEDONCALLHRS; dynamic? sCHEDULEDPLANNEDOTHRS; - int? sCHEDULEDAYS; + num? sCHEDULEDAYS; dynamic? sHORTAGEHRS; dynamic? sHORTAGESCHEDULEHRS; - int? sICKLEAVE; + num? sICKLEAVE; dynamic? tIMEBACKHRS; dynamic? tIMEBACKBALANCE; - int? uNAUTHORIZEDLEAVE; + num? uNAUTHORIZEDLEAVE; dynamic? uNCOVERDSHORTAGEHRS; - int? uNPAIDLEAVE; + num? uNPAIDLEAVE; GetTimeCardSummaryList( {this.aBSENTDAYS, diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 0e9053a..15fc795 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -196,7 +196,7 @@ class _DashboardScreenState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color), + LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color), (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true), 16.height, Row( diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 75ee88f..b5129a5 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -106,6 +106,19 @@ class _WorkListDetailScreenState extends State { void getData() async { // try { // Utils.showLoading(context); + + getEitCollectionNotificationBodyList!.clear(); + getAbsenceCollectionNotificationBodyList!.clear(); + getPrNotificationBody = null; + getStampMsNotifications.clear(); + getStampNsNotifications.clear(); + getPoNotificationBody?.pOHeader!.clear(); + getItemCreationNtfBody?.itemCreationHeader!.clear(); + getPhonesNotificationBodyList!.clear(); + getBasicDetNtfBodyList!.clear(); + getAbsenceCollectionNotificationBodyList!.clear(); + getContactNotificationBodyList = null; + if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { getUserInformation(); } @@ -688,7 +701,7 @@ class _WorkListDetailScreenState extends State { GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload); Utils.hideLoading(context); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); - animationIndex=animationIndex+1; + animationIndex = animationIndex + 1; AppState().workList!.removeAt(AppState().workListIndex!); if (AppState().workList!.isEmpty) { Navigator.pop(context, "delegate_reload"); @@ -725,6 +738,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; + getEitCollectionNotificationBodyList!.clear(); getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { @@ -742,6 +756,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; + memberInformationListModel = null; memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); apiCallCount--; if (apiCallCount == 0) { @@ -759,6 +774,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; + getPhonesNotificationBodyList!.clear(); getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { @@ -776,6 +792,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; + getBasicDetNtfBodyList!.clear(); getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { @@ -793,6 +810,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; + getAbsenceCollectionNotificationBodyList!.clear(); getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { @@ -916,6 +934,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; + getNotificationRespondAttributes.clear(); getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); if (getNotificationRespondAttributes.isNotEmpty) { notificationNoteInput = getNotificationRespondAttributes.first; @@ -936,6 +955,7 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; + notificationButtonsList.clear(); notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!); if (notificationButtonsList.isNotEmpty) { isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE"); From 67c4970897bb1d0493392ee32672b07d2482a62b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 13 Dec 2022 11:11:40 +0300 Subject: [PATCH 4/4] fixes --- lib/ui/chat/chat_home.dart | 27 +++++++++++++-------------- lib/ui/landing/dashboard_screen.dart | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/ui/chat/chat_home.dart b/lib/ui/chat/chat_home.dart index 807af1a..330242a 100644 --- a/lib/ui/chat/chat_home.dart +++ b/lib/ui/chat/chat_home.dart @@ -38,23 +38,22 @@ class _ChatHomeState extends State { data.clearAll(); } - // void fetchAgain() { - // print("Fetch Triggered"); - // if (chatHubConnection.state != HubConnectionState.Connected) { - // data.getUserAutoLoginToken().whenComplete(() async { - // await data.buildHubConnection(); - // data.getUserRecentChats(); - // }); - // return; - // } - // if (data.searchedChats == null || data.searchedChats!.isEmpty) { - // data.getUserRecentChats(); - // } - // } + void fetchAgain() { + if (chatHubConnection.state != HubConnectionState.Connected) { + data.getUserAutoLoginToken().whenComplete(() async { + await data.buildHubConnection(); + data.getUserRecentChats(); + }); + return; + } + if (data.searchedChats == null || data.searchedChats!.isEmpty) { + data.getUserRecentChats(); + } + } @override Widget build(BuildContext context) { - // fetchAgain(); + fetchAgain(); return Scaffold( backgroundColor: MyColors.white, appBar: AppBarWidget(context, title: LocaleKeys.chat.tr(), showHomeButton: true), diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 2d7de09..b423ebd 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -58,7 +58,6 @@ class _DashboardScreenState extends State { data = Provider.of(context, listen: false); marathonProvider = Provider.of(context, listen: false); cProvider = Provider.of(context, listen: false); - _bHubCon(); _onRefresh(); }); } @@ -80,6 +79,7 @@ class _DashboardScreenState extends State { void _onRefresh() async { data.initProvider(); + _bHubCon(); // data.getITGNotification().then((value) { // print("--------------------detail_1-----------------"); // print(value!.result!.data!.notificationMasterId);