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/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/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 7aea35e..f2cd760 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -98,6 +98,12 @@ class _WorkListDetailScreenState extends State { if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { getUserInformation(); } + + notificationGetRespondAttributes(); + getNotificationButtons(); + getAttachments(); + getActionHistory(); + if (workListData!.iTEMTYPE == "HRSSA") { if (workListData!.rEQUESTTYPE == "EIT") { getEitNotificationBody(); @@ -130,8 +136,6 @@ class _WorkListDetailScreenState extends State { getPRNotification(); } - notificationGetRespondAttributes(); - // List dataToFetch = await Future.wait([ // // WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!), @@ -142,10 +146,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 +487,6 @@ class _WorkListDetailScreenState extends State { builder: (cxt) => AcceptRejectInputDialog( message: LocaleKeys.requestedItems.tr(), notificationGetRespond: notificationNoteInput, - textEditingController: textEditingController, onTap: (note) { Map payload = { "P_ACTION_MODE": actionMode, @@ -773,17 +772,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 = "";