From cf9f84f38bc61f31f52e52eeb5228857fa84ee0d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 26 Oct 2022 16:47:13 +0300 Subject: [PATCH 1/3] PO fixes --- lib/models/get_item_creation_ntf_body_list_model.dart | 2 +- lib/models/get_po_Item_history_list_model.dart | 4 ++-- lib/models/get_po_notification_body_list_model.dart | 2 +- lib/models/get_quotation_analysis_list_model.dart | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/models/get_item_creation_ntf_body_list_model.dart b/lib/models/get_item_creation_ntf_body_list_model.dart index e4c22e7..6f98ebb 100644 --- a/lib/models/get_item_creation_ntf_body_list_model.dart +++ b/lib/models/get_item_creation_ntf_body_list_model.dart @@ -168,7 +168,7 @@ class ItemCreationLines { int? tOROWNUM; int? tRANSACTIONHEADERID; int? tRANSACTIONLINEID; - int? uNITPRICE; + num? uNITPRICE; String? uSERMANUFACTURERNAME; String? uSERMFGPARTNUM; diff --git a/lib/models/get_po_Item_history_list_model.dart b/lib/models/get_po_Item_history_list_model.dart index 656457d..35e81d6 100644 --- a/lib/models/get_po_Item_history_list_model.dart +++ b/lib/models/get_po_Item_history_list_model.dart @@ -7,11 +7,11 @@ class GetPoItemHistoryList { int? dISCOUNTPERCENTAGE; int? fROMROWNUM; int? iTEMID; - int? nETPRICE; + num? nETPRICE; int? nOOFROWS; String? oUNAME; String? pONUMBER; - int? pURCHASEPRICE; + num? pURCHASEPRICE; int? qUANTITYORDERED; int? qUANTITYRECEIVED; int? rEVISIONNUM; diff --git a/lib/models/get_po_notification_body_list_model.dart b/lib/models/get_po_notification_body_list_model.dart index 3bc92a0..e1dfbdf 100644 --- a/lib/models/get_po_notification_body_list_model.dart +++ b/lib/models/get_po_notification_body_list_model.dart @@ -164,7 +164,7 @@ class POLines { String? rEQUESTOR; int? rOWNUM; int? tOROWNUM; - int? uNITPRICE; + num? uNITPRICE; String? uOM; POLines( diff --git a/lib/models/get_quotation_analysis_list_model.dart b/lib/models/get_quotation_analysis_list_model.dart index 4ceaa96..e041f95 100644 --- a/lib/models/get_quotation_analysis_list_model.dart +++ b/lib/models/get_quotation_analysis_list_model.dart @@ -8,8 +8,8 @@ class GetQuotationAnalysisList { int? qUOTLINETOTAL; String? qUOTMFGPARTNUM; String? qUOTNUM; - int? qUOTQTY; - int? qUOTUNITPRICE; + num? qUOTQTY; + num? qUOTUNITPRICE; String? qUOTUOM; String? rFQNUM; int? rFQQTY; From c87a00df6ab5b6a86da6af1121271e9cc930289e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 30 Oct 2022 17:26:39 +0300 Subject: [PATCH 2/3] Jira fixes --- lib/api/profile_api_client.dart | 2 +- lib/classes/utils.dart | 4 +++- lib/ui/landing/dashboard_screen.dart | 8 ++------ .../dynamic_screens/dynamic_input_screen.dart | 2 +- .../dynamic_screens/dynamic_input_address_screen.dart | 11 +++++++++-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lib/api/profile_api_client.dart b/lib/api/profile_api_client.dart index 832b6d8..d7ceba0 100644 --- a/lib/api/profile_api_client.dart +++ b/lib/api/profile_api_client.dart @@ -97,7 +97,7 @@ class ProfileApiClient { Future getDffStructure(String pFunctionName, String uRL, String requestType) async { String url = ApiConsts.erpRest + uRL; - Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_REQUEST_TYPE": pFunctionName, "P_COUNTRY_CODE": "SA"}; + Map postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_REQUEST_TYPE": pFunctionName, "P_FUNCTION_NAME": pFunctionName, "P_COUNTRY_CODE": "SA"}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel? responseData = GenericResponseModel.fromJson(json); diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart index af9e340..8f9df26 100644 --- a/lib/classes/utils.dart +++ b/lib/classes/utils.dart @@ -287,7 +287,9 @@ class Utils { String formattedDate; if (date.isNotEmpty) { formattedDate = date.split('T')[0]; - formattedDate = formattedDate + ' 00:00:00'; + if(!formattedDate.contains("00:00:00")) { + formattedDate = formattedDate + ' 00:00:00'; + } } else { formattedDate = date; } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index f5f1d7f..bb4ee43 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -1,10 +1,10 @@ import 'dart:async'; import 'dart:io'; + import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:mohem_flutter_app/api/dashboard_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'; @@ -13,17 +13,13 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; -import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; -import 'package:mohem_flutter_app/ui/dialogs/success_dialog.dart'; -import 'package:mohem_flutter_app/ui/landing/itg/video_page.dart'; import 'package:mohem_flutter_app/ui/landing/widget/app_drawer.dart'; import 'package:mohem_flutter_app/ui/landing/widget/menus_widget.dart'; import 'package:mohem_flutter_app/ui/landing/widget/services_widget.dart'; import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; -import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart'; import 'package:mohem_flutter_app/widgets/mark_attendance_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart'; @@ -268,7 +264,7 @@ class _DashboardScreenState extends State { bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0), ), ), - child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"), + child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/attendance.svg" : "assets/images/attendance.svg"), ).onPress(() { showMyBottomSheet( context, 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 1c97b28..0a6c9d4 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -260,7 +260,7 @@ class _DynamicInputScreenState extends State { for (int i = 0; i < parentsList.length; i++) { for (int j = 0; j < (getEitDffStructureList?.length ?? 0); j++) { - if (getEitDffStructureList![j].sEGMENTNAME == parentsList[i].opt1) { + if (getEitDffStructureList![j].sEGMENTNAME == parentsList[i].name) { if (getEitDffStructureList![j].dISPLAYFLAG != "N") { if (getEitDffStructureList![j].vALIDATIONTYPE == "N") { String? idColName; 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 5c54b6d..cc8e861 100644 --- a/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart +++ b/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart @@ -283,10 +283,17 @@ class _DynamicInputScreenState extends State { tempVar = e.getEmployeeAddressList!.sEGMENTVALUEDSP ?? ""; } - return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson(); + return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 0, vARCHAR2VALUE: tempVar.toString()).toJson(); }).toList(); - submitPhoneNumbers = await ProfileApiClient().submitAddressTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, dynamicParams!.correctOrNew, countryCode, effectiveDate); + submitPhoneNumbers = await ProfileApiClient().submitAddressTransaction( + dESCFLEXCONTEXTCODE, + dynamicParams!.dynamicId, + values, + dynamicParams!.correctOrNew, + countryCode, + effectiveDate.isEmpty ? DateFormat('dd-MMM-yyy').format(DateTime.now().add(Duration(days: 35))) : effectiveDate, + ); print(values); Utils.hideLoading(context); From d77f9a33628cbc6d9644c98a19a55450d7bb88db Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 1 Nov 2022 09:22:30 +0300 Subject: [PATCH 3/3] Worklist fixes --- assets/lottie/loading.json | 1 + .../get_po_notification_body_list_model.dart | 2 +- .../itg_worklist_table_model.dart | 21 ++++++ lib/provider/dashboard_provider_model.dart | 14 +++- .../attendance/add_vacation_rule_screen.dart | 1 + lib/ui/chat/chat_home.dart | 1 + lib/ui/landing/dashboard_screen.dart | 1 + .../add_leave_balance_screen.dart | 1 + lib/ui/profile/profile_screen.dart | 2 +- lib/ui/work_list/itg_detail_screen.dart | 23 ++++++- .../approval_level_fragment.dart | 20 ++++-- .../request_detail_fragment.dart | 2 + lib/ui/work_list/sheets/delegate_sheet.dart | 5 ++ .../work_list/sheets/selected_item_sheet.dart | 8 +-- lib/ui/work_list/work_list_screen.dart | 1 + lib/ui/work_list/worklist_detail_screen.dart | 69 ++++++++++++++++--- .../worklist_fragments/actions_fragment.dart | 16 +++-- lib/widgets/bottom_sheet.dart | 12 +++- lib/widgets/circular_avatar.dart | 2 +- .../dialogs/accept_reject_input_dialog.dart | 19 +++-- lib/widgets/dialogs/itg_comments_dialog.dart | 27 +++++--- lib/widgets/image_picker.dart | 1 + lib/widgets/item_detail_view_widget.dart | 19 ++++- 23 files changed, 216 insertions(+), 52 deletions(-) create mode 100644 assets/lottie/loading.json create mode 100644 lib/models/itg_forms_models/itg_worklist_table_model.dart diff --git a/assets/lottie/loading.json b/assets/lottie/loading.json new file mode 100644 index 0000000..8190459 --- /dev/null +++ b/assets/lottie/loading.json @@ -0,0 +1 @@ +{"v":"5.8.1","fr":30,"ip":0,"op":60,"w":300,"h":300,"nm":"loading_6","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":60,"s":[360]}],"ix":10},"p":{"a":0,"k":[150.00000000000003,150.00000000000003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[30.000000000000004,30.000000000000004,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.12941176470588237,0.7411764705882353,0.7764705882352941,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":60,"s":[99]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[1]},{"t":50,"s":[100]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":60,"s":[3]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":30,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150.00000000000003,150.00000000000003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[30.000000000000004,30.000000000000004,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.7450980392156863,0.9254901960784314,0.9372549019607843,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":300,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/lib/models/get_po_notification_body_list_model.dart b/lib/models/get_po_notification_body_list_model.dart index e1dfbdf..d0473dc 100644 --- a/lib/models/get_po_notification_body_list_model.dart +++ b/lib/models/get_po_notification_body_list_model.dart @@ -160,7 +160,7 @@ class POLines { int? pOHEADERID; String? pROMISEDDATE; String? pRNUM; - int? qUANTITY; + num? qUANTITY; String? rEQUESTOR; int? rOWNUM; int? tOROWNUM; diff --git a/lib/models/itg_forms_models/itg_worklist_table_model.dart b/lib/models/itg_forms_models/itg_worklist_table_model.dart new file mode 100644 index 0000000..e1212ba --- /dev/null +++ b/lib/models/itg_forms_models/itg_worklist_table_model.dart @@ -0,0 +1,21 @@ +class ITGWorkListTableModel { + String? label; + String? isTable; + String? textvalue; + + ITGWorkListTableModel({this.label, this.isTable, this.textvalue}); + + ITGWorkListTableModel.fromJson(Map json) { + label = json['label']; + isTable = json['isTable']; + textvalue = json['textvalue']; + } + + Map toJson() { + Map data = new Map(); + data['label'] = this.label; + data['isTable'] = this.isTable; + data['textvalue'] = this.textvalue; + return data; + } +} diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 4e53242..9396704 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -19,6 +19,7 @@ import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_respo import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; +import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; /// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool // ignore: prefer_mixin @@ -151,7 +152,18 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { logger.wtf(ex); if (showLoading) Utils.hideLoading(context); notifyListeners(); - Utils.handleException(ex, context, null); + Utils.handleException(ex, context, (err) { + Utils.hideLoading(context); + showDialog( + context: context, + builder: (cxt) => ConfirmDialog( + message: err, + onTap: () { + Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route route) => false); + }, + ), + ); + }); } } diff --git a/lib/ui/attendance/add_vacation_rule_screen.dart b/lib/ui/attendance/add_vacation_rule_screen.dart index aa48696..a698adc 100644 --- a/lib/ui/attendance/add_vacation_rule_screen.dart +++ b/lib/ui/attendance/add_vacation_rule_screen.dart @@ -430,6 +430,7 @@ class _AddVacationRuleScreenState extends State { onTap: () { showMyBottomSheet( context, + callBackFunc: (){}, child: SearchEmployeeBottomSheet( title: LocaleKeys.searchForEmployee.tr(), apiMode: LocaleKeys.delegate.tr(), diff --git a/lib/ui/chat/chat_home.dart b/lib/ui/chat/chat_home.dart index ef984a3..b8f7514 100644 --- a/lib/ui/chat/chat_home.dart +++ b/lib/ui/chat/chat_home.dart @@ -160,6 +160,7 @@ class _ChatHomeScreenState extends State { // .getChatMemberFromSearch("aamir.muhammad", 36239); showMyBottomSheet( context, + callBackFunc: (){}, child: SearchEmployeeBottomSheet( title: LocaleKeys.searchForEmployee.tr(), apiMode: LocaleKeys.delegate.tr(), diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index bb4ee43..d342072 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -268,6 +268,7 @@ class _DashboardScreenState extends State { ).onPress(() { showMyBottomSheet( context, + callBackFunc: (){}, child: MarkAttendanceWidget(model, isFromDashboard: true), ); }), diff --git a/lib/ui/leave_balance/add_leave_balance_screen.dart b/lib/ui/leave_balance/add_leave_balance_screen.dart index e600800..864a507 100644 --- a/lib/ui/leave_balance/add_leave_balance_screen.dart +++ b/lib/ui/leave_balance/add_leave_balance_screen.dart @@ -221,6 +221,7 @@ class _AddLeaveBalanceScreenState extends State { onTap: () { showMyBottomSheet( context, + callBackFunc: (){}, child: SearchEmployeeBottomSheet( title: LocaleKeys.searchForEmployee.tr(), apiMode: LocaleKeys.delegate.tr(), diff --git a/lib/ui/profile/profile_screen.dart b/lib/ui/profile/profile_screen.dart index c071d3f..0bf007e 100644 --- a/lib/ui/profile/profile_screen.dart +++ b/lib/ui/profile/profile_screen.dart @@ -112,7 +112,7 @@ class _ProfileScreenState extends State { } void startImageSheet() { - showMyBottomSheet(context, + showMyBottomSheet(context, callBackFunc: (){}, child: Column( children: [ Container( diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index e306750..0f45648 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -125,7 +125,7 @@ class _ItgDetailScreenState extends State { }, children: [ RequestDetailFragment(fields: itgRequest?.fieldGoups?[1].fields ?? []), - ApprovalLevelfragment(wFHistory: itgRequest?.wFHistory ?? []), + ApprovalLevelfragment(wFHistory: itgRequest?.wFHistory ?? [], voidCallback: reloadITG,), RequestDetailFragment(fields: itgRequest?.fieldGoups?[0].fields ?? []), ], ).expanded, @@ -263,12 +263,12 @@ class _ItgDetailScreenState extends State { print(action.toJson()); switch (action.action) { case "Delegate": - showMyBottomSheet(context, + showMyBottomSheet(context, callBackFunc: reloadITG, child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: action.action!, notificationID: null, actionHistoryList: null, wFHistory: itgRequest?.wFHistory ?? [])); break; case "RequestInformation": - showMyBottomSheet(context, + showMyBottomSheet(context, callBackFunc: reloadITG, child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: action.action!, notificationID: null, actionHistoryList: null, wFHistory: itgRequest?.wFHistory ?? [])); break; @@ -342,10 +342,12 @@ class _ItgDetailScreenState extends State { } void performAction(String actionMode) { + print(actionMode); showDialog( context: context, builder: (cxt) => ITGCommentsDialog( message: LocaleKeys.writeComment.tr(), + actionMode: actionMode, onTap: (note) { if (actionMode == "APPROVED") { performApproveAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); @@ -404,4 +406,19 @@ class _ItgDetailScreenState extends State { Utils.handleException(ex, context, null); } } + + void reloadITG() { + AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); + if (AppState().requestAllList!.isEmpty) { + Navigator.pop(context, "delegate_reload"); + } else { + if (AppState().requestAllList!.length <= AppState().itgWorkListIndex!) { + Navigator.pop(context, "delegate_reload"); + } else { + requestDetails = null; + getDataFromState(); + } + } + } + } diff --git a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart index 1d77f2a..eb478af 100644 --- a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart +++ b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart @@ -12,8 +12,9 @@ import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; class ApprovalLevelfragment extends StatelessWidget { List wFHistory; + VoidCallback voidCallback; - ApprovalLevelfragment({Key? key, this.wFHistory = const []}) : super(key: key); + ApprovalLevelfragment({Key? key, this.wFHistory = const [], required this.voidCallback}) : super(key: key); @override Widget build(BuildContext context) { @@ -98,6 +99,7 @@ class ApprovalLevelfragment extends StatelessWidget { LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() { showMyBottomSheet( context, + callBackFunc: voidCallback, child: SelectedItgItemSheet( LocaleKeys.comments.tr(), wfHistory: history, @@ -109,6 +111,7 @@ class ApprovalLevelfragment extends StatelessWidget { LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { showMyBottomSheet( context, + callBackFunc: voidCallback, child: SelectedItgItemSheet( LocaleKeys.comments.tr(), wfHistory: history, @@ -126,18 +129,21 @@ class ApprovalLevelfragment extends StatelessWidget { } Color getStatusColor(String code) { - if (code == "Submit") { + if (code.toLowerCase() == "submit") { return MyColors.grey3AColor; - } else if (code == "Pending") { + } else if (code.toLowerCase() == "pending") { return MyColors.yellowColor; - } else if (code == "Not Doable" || code == "Rejected") { + } else if (code.toLowerCase() == "not doable" || code.toLowerCase() == "rejected") { return MyColors.redColor; - } else if (code == "APPROVED") { + } else if (code.toLowerCase() == "approved" || + code.toLowerCase() == "auto-approve" || + code.toLowerCase() == "auto-approved" || + code.toLowerCase() == "doable") { return MyColors.greenColor; - } else if (code == "Requested Information") { + } else if (code.toLowerCase() == "requested information" || code.toLowerCase() == "assign" || code.toLowerCase() == "reassign") { return MyColors.orange; } else { - return MyColors.yellowColor; + return MyColors.whiteColor; } } } diff --git a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart index 6092bef..72b20d4 100644 --- a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart +++ b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart @@ -51,6 +51,7 @@ class RequestDetailFragment extends StatelessWidget { ? true : false : false, + type: fields[index].type, ); } return ItemDetailViewGridItem( @@ -62,6 +63,7 @@ class RequestDetailFragment extends StatelessWidget { ? true : false : false, + type: fields[index].type, ); }, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( diff --git a/lib/ui/work_list/sheets/delegate_sheet.dart b/lib/ui/work_list/sheets/delegate_sheet.dart index 4075332..28a90e6 100644 --- a/lib/ui/work_list/sheets/delegate_sheet.dart +++ b/lib/ui/work_list/sheets/delegate_sheet.dart @@ -194,6 +194,7 @@ class _DelegateSheetState extends State { ).onPress(() { showMyBottomSheet( context, + callBackFunc: (){}, child: SearchOptionsSheet( selectedType, onSelection: (String value) { @@ -392,6 +393,7 @@ class _DelegateSheetState extends State { return InkWell( onTap: () { showMyBottomSheet(context, + callBackFunc: (){}, child: SelectedItemSheet( "Comment", apiMode: widget.apiMode, @@ -437,6 +439,7 @@ class _DelegateSheetState extends State { return InkWell( onTap: () { showMyBottomSheet(context, + callBackFunc: (){}, child: SelectedItgItemSheet( "Comment", apiMode: widget.apiMode, @@ -461,6 +464,7 @@ class _DelegateSheetState extends State { return InkWell( onTap: () { showMyBottomSheet(context, + callBackFunc: (){}, child: SelectedItemSheet( "Comment", apiMode: widget.apiMode, @@ -506,6 +510,7 @@ class _DelegateSheetState extends State { return InkWell( onTap: () { showMyBottomSheet(context, + callBackFunc: (){}, child: SelectedItemSheet( LocaleKeys.comments.tr(), apiMode: widget.apiMode, diff --git a/lib/ui/work_list/sheets/selected_item_sheet.dart b/lib/ui/work_list/sheets/selected_item_sheet.dart index f3f8f0d..e053218 100644 --- a/lib/ui/work_list/sheets/selected_item_sheet.dart +++ b/lib/ui/work_list/sheets/selected_item_sheet.dart @@ -71,7 +71,7 @@ class SelectedItemSheet extends StatelessWidget { child: DefaultButton( LocaleKeys.cancel.tr(), () { - Navigator.pop(context); + Navigator.pop(context, "cancel"); }, textColor: Colors.black, colors: [ @@ -120,8 +120,8 @@ class SelectedItemSheet extends StatelessWidget { try { await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode); Utils.hideLoading(context); - Navigator.pop(context); - Navigator.pop(context); + // Navigator.pop(context); + // Navigator.pop(context); Navigator.pop(context, "delegate_reload"); } catch (ex) { Utils.hideLoading(context); @@ -142,7 +142,7 @@ class SelectedItemSheet extends StatelessWidget { padding: EdgeInsets.only(top: 16, bottom: 16, left: 21, right: 21), child: Row( children: [ - actionHistoryList != null + (actionHistoryList != null && actionHistoryList!.eMPLOYEEIMAGE != null) ? CircularAvatar( height: 30, width: 30, diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 2e362a9..9471568 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -429,6 +429,7 @@ class _WorkListScreenState extends State { void openBottomSheet(BuildContext context) { showMyBottomSheet( context, + callBackFunc: (){}, child: WorkListAdvanceSearch((selectedViewID, selectedItemTypeID, searchByInput, searchByDate) async { itgRequestTypeIndex = null; pNotificationType = selectedViewID; diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 8f43b8d..ec02631 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -1,6 +1,7 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:lottie/lottie.dart'; import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; @@ -82,6 +83,9 @@ class _WorkListDetailScreenState extends State { bool isApproveAvailable = false; bool isRejectAvailable = false; + bool isAttachmentLoaded = false; + bool isActionHistoryLoaded = false; + @override void initState() { super.initState(); @@ -241,8 +245,20 @@ class _WorkListDetailScreenState extends State { itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [], prLinesList: getPrNotificationBody?.pRLines ?? [], ), - actionHistoryList.isEmpty ? Utils.getNoDataWidget(context) : ActionsFragment(workListData!.nOTIFICATIONID, actionHistoryList), - getAttachmentList.isEmpty ? Utils.getNoDataWidget(context) : AttachmentsFragment(getAttachmentList), + isActionHistoryLoaded + ? actionHistoryList.isEmpty + ? Utils.getNoDataWidget(context) + : ActionsFragment( + workListData!.nOTIFICATIONID, + actionHistoryList, + voidCallback: reloadWorkList, + ) + : showLoadingAnimation(), + isAttachmentLoaded + ? getAttachmentList.isEmpty + ? Utils.getNoDataWidget(context) + : AttachmentsFragment(getAttachmentList) + : showLoadingAnimation(), ], ).expanded, if (isApproveAvailable || isRejectAvailable || isCloseAvailable) @@ -371,20 +387,24 @@ class _WorkListDetailScreenState extends State { switch (notificationButton.bUTTONACTION) { case "DELEGATE": showMyBottomSheet(context, + callBackFunc: reloadWorkList, child: DelegateSheet(title: LocaleKeys.delegate.tr(), apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); break; case "REQUEST_INFO": // do something else showMyBottomSheet(context, + callBackFunc: reloadWorkList, child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); break; case "TRANSFER_INFO": // do something else showMyBottomSheet(context, - child: DelegateSheet(title: notificationButton.bUTTONLABEL!, apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); + callBackFunc: reloadWorkList, + child: + DelegateSheet(title: notificationButton.bUTTONLABEL!, apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); break; case "ANSWER_INFO": - performAction(notificationButton.bUTTONACTION!,title: notificationButton.bUTTONLABEL); + performAction(notificationButton.bUTTONACTION!, title: notificationButton.bUTTONLABEL); break; case "RFC": // do something else @@ -396,10 +416,13 @@ class _WorkListDetailScreenState extends State { // do something else case "APPROVE_AND_FORWARD": showMyBottomSheet(context, + callBackFunc: reloadWorkList, child: DelegateSheet(title: "Approve and Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); break; case "FORWARD": - showMyBottomSheet(context, child: DelegateSheet(title: "Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); + showMyBottomSheet(context, + callBackFunc: reloadWorkList, + child: DelegateSheet(title: "Forward", apiMode: notificationButton.bUTTONACTION!, notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList)); break; case "REJECT": performNetworkCall(context, email: "", userId: ""); @@ -492,14 +515,15 @@ class _WorkListDetailScreenState extends State { ); } - void performAction(String actionMode,{String? title}) { + void performAction(String actionMode, {String? title}) { TextEditingController textEditingController = TextEditingController(); showDialog( context: context, builder: (cxt) => AcceptRejectInputDialog( - message: title !=null ? null:LocaleKeys.requestedItems.tr(), + message: title != null ? null : LocaleKeys.requestedItems.tr(), title: title, notificationGetRespond: notificationNoteInput, + actionMode: actionMode, onTap: (note) { Map payload = { "P_ACTION_MODE": actionMode, @@ -550,6 +574,20 @@ class _WorkListDetailScreenState extends State { } } + void reloadWorkList() { + AppState().workList!.removeAt(AppState().workListIndex!); + if (AppState().workList!.isEmpty) { + Navigator.pop(context, "delegate_reload"); + } else { + if (AppState().workList!.length <= AppState().workListIndex!) { + Navigator.pop(context, "delegate_reload"); + } else { + workListData = null; + getDataFromState(); + } + } + } + void getEitNotificationBody() async { try { if (apiCallCount == 0) Utils.showLoading(context); @@ -791,7 +829,9 @@ class _WorkListDetailScreenState extends State { // apiCallCount--; // if (apiCallCount == 0) { // Utils.hideLoading(context); - setState(() {}); + setState(() { + isActionHistoryLoaded = true; + }); // } } catch (ex) { // apiCallCount--; @@ -808,7 +848,9 @@ class _WorkListDetailScreenState extends State { // apiCallCount--; // if (apiCallCount == 0) { // Utils.hideLoading(context); - setState(() {}); + setState(() { + isAttachmentLoaded = true; + }); // } } catch (ex) { // apiCallCount--; @@ -816,4 +858,13 @@ class _WorkListDetailScreenState extends State { Utils.handleException(ex, context, null); } } + + Widget showLoadingAnimation() { + return Lottie.asset( + 'assets/lottie/loading.json', + repeat: true, + reverse: false, + fit: BoxFit.contain, + ); + } } diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index d5e1f89..8a69599 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -7,7 +7,6 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/get_action_history_list_model.dart'; -import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; import 'package:mohem_flutter_app/ui/work_list/sheets/selected_item_sheet.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; @@ -15,8 +14,9 @@ import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; class ActionsFragment extends StatelessWidget { int? notificationID; List actionHistoryList; + VoidCallback voidCallback; - ActionsFragment(this.notificationID, this.actionHistoryList, {Key? key}) : super(key: key); + ActionsFragment(this.notificationID, this.actionHistoryList, {Key? key, required this.voidCallback}) : super(key: key); @override Widget build(BuildContext context) { @@ -99,13 +99,17 @@ class ActionsFragment extends StatelessWidget { Row( children: [ LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() { - showMyBottomSheet(context, - child: DelegateSheet(title: LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistoryList)); + showMyBottomSheet( + context, + callBackFunc: voidCallback, + child: SelectedItemSheet(LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistory), + ); }).expanded, Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { showMyBottomSheet( context, + callBackFunc: voidCallback, child: SelectedItemSheet( LocaleKeys.comments.tr(), apiMode: "DELEGATE", @@ -133,9 +137,9 @@ class ActionsFragment extends StatelessWidget { return MyColors.redColor; } else if (code == "PENDING") { return MyColors.orange; - } else if (code == "APPROVED" || code == "APPROVE") { + } else if (code == "APPROVED" || code == "APPROVE" || code == "ANSWER_INFO") { return const Color(0xff1FA269); - } else if (code == "REQUEST_INFO") { + } else if (code == "REQUEST_INFO"|| code == "FORWARD") { return const Color(0xff2E303A); } else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") { return MyColors.orange; diff --git a/lib/widgets/bottom_sheet.dart b/lib/widgets/bottom_sheet.dart index 206d017..a15fc3b 100644 --- a/lib/widgets/bottom_sheet.dart +++ b/lib/widgets/bottom_sheet.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; -void showMyBottomSheet(BuildContext context, {required Widget child}) { - showModalBottomSheet( +void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc}) { + showModalBottomSheet( context: context, isScrollControlled: true, backgroundColor: Colors.transparent, @@ -37,7 +37,13 @@ void showMyBottomSheet(BuildContext context, {required Widget child}) { ), ); }, - ); + ).then((value) { + // print("BACK FROM DELEGATE!!!!"); + // print("value: $value"); + if (value == "delegate_reload") { + callBackFunc(); + } + }); } class BottomSheetItem extends StatelessWidget { diff --git a/lib/widgets/circular_avatar.dart b/lib/widgets/circular_avatar.dart index ad94052..a18cf03 100644 --- a/lib/widgets/circular_avatar.dart +++ b/lib/widgets/circular_avatar.dart @@ -25,7 +25,7 @@ class CircularAvatar extends StatelessWidget { image: NetworkImage(url ?? "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png"), ), ), - child: isImageBase64 ? imageFromBase64String(url!) : null, + child: (isImageBase64 && url != null) ? imageFromBase64String(url!) : Container(), ); } diff --git a/lib/widgets/dialogs/accept_reject_input_dialog.dart b/lib/widgets/dialogs/accept_reject_input_dialog.dart index ef2cfaa..a0faf2c 100644 --- a/lib/widgets/dialogs/accept_reject_input_dialog.dart +++ b/lib/widgets/dialogs/accept_reject_input_dialog.dart @@ -13,11 +13,13 @@ class AcceptRejectInputDialog extends StatelessWidget { final String? title; final String? message; final String? okTitle; + final String? actionMode; final NotificationGetRespondAttributesList? notificationGetRespond; final Function(String) onTap; + // final TextEditingController textEditingController; - AcceptRejectInputDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.notificationGetRespond}) : super(key: key); + AcceptRejectInputDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.notificationGetRespond, this.actionMode}) : super(key: key); String note = ""; @@ -85,15 +87,20 @@ class AcceptRejectInputDialog extends StatelessWidget { ).expanded, 10.width, DefaultButton( - LocaleKeys.ok.tr(), + actionMode == "REJECTED" ? LocaleKeys.reject.tr() : LocaleKeys.ok.tr(), () { Navigator.pop(context); onTap(note); }, - colors: const [ - Color(0xff28C884), - Color(0xff1BB271), - ], + colors: actionMode == "REJECTED" + ? const [ + Color(0xffE47A7E), + Color(0xffE47A7E), + ] + : const [ + Color(0xff28C884), + Color(0xff1BB271), + ], ).expanded, ], ), diff --git a/lib/widgets/dialogs/itg_comments_dialog.dart b/lib/widgets/dialogs/itg_comments_dialog.dart index b984851..34199ba 100644 --- a/lib/widgets/dialogs/itg_comments_dialog.dart +++ b/lib/widgets/dialogs/itg_comments_dialog.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; @@ -12,9 +13,10 @@ class ITGCommentsDialog extends StatelessWidget { final String? title; final String? message; final String? okTitle; + final String? actionMode; final Function(String) onTap; - ITGCommentsDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap}) : super(key: key); + ITGCommentsDialog({Key? key, this.title, @required this.message, this.okTitle, required this.onTap, this.actionMode}) : super(key: key); String note = ""; @@ -82,15 +84,24 @@ class ITGCommentsDialog extends StatelessWidget { ).expanded, 10.width, DefaultButton( - LocaleKeys.ok.tr(), + actionMode == "REJECTED" ? LocaleKeys.reject.tr() : LocaleKeys.approve.tr(), () { - Navigator.pop(context); - onTap(note); + if (actionMode == "REJECTED" && note.isEmpty) { + Utils.showToast(LocaleKeys.pleaseEnterComments.tr()); + } else { + Navigator.pop(context); + onTap(note); + } }, - colors: const [ - Color(0xff28C884), - Color(0xff1BB271), - ], + colors: actionMode == "REJECTED" + ? const [ + Color(0xffE47A7E), + Color(0xffE47A7E), + ] + : const [ + Color(0xff28C884), + Color(0xff1BB271), + ], ).expanded, ], ), diff --git a/lib/widgets/image_picker.dart b/lib/widgets/image_picker.dart index 4a99577..5e5ac01 100644 --- a/lib/widgets/image_picker.dart +++ b/lib/widgets/image_picker.dart @@ -13,6 +13,7 @@ class ImageOptions { static void showImageOptionsNew(BuildContext context, bool showFilesOption, Function(String, File) image) { showMyBottomSheet( context, + callBackFunc: (){}, child: AttachmentOptions( showFilesOption: showFilesOption, onCameraTap: () async { diff --git a/lib/widgets/item_detail_view_widget.dart b/lib/widgets/item_detail_view_widget.dart index 34b2eb3..05495e9 100644 --- a/lib/widgets/item_detail_view_widget.dart +++ b/lib/widgets/item_detail_view_widget.dart @@ -1,8 +1,11 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/models/itg_forms_models/itg_worklist_table_model.dart'; class ItemDetailView extends StatelessWidget { final String title; @@ -46,9 +49,10 @@ class ItemDetailViewGridItem extends StatelessWidget { int index; final String? title; final String? value; + final String? type; final bool isNeedToShowEmptyDivider; - ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false}) : super(key: key); + ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.type = ""}) : super(key: key); @override Widget build(BuildContext context) { @@ -78,7 +82,7 @@ class ItemDetailViewGridItem extends StatelessWidget { children: [ Flexible(child: "$title:".toText12Auto(isBold: true, color: const Color(0xff2BB8A6))), 4.width, - Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor)), + type!.toLowerCase() == "table" ? getStringFromJSON(value!) : Flexible(child: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor)), ], ), ); @@ -129,3 +133,14 @@ class ItemDetailGrid extends StatelessWidget { ); } } + +Widget getStringFromJSON(String jsonString) { + var body = json.decode(jsonString); + ITGWorkListTableModel itgWorkListTableModel = ITGWorkListTableModel(); + if (body.length != 0) { + itgWorkListTableModel = ITGWorkListTableModel.fromJson(body[0][0]); + return Flexible(child: (itgWorkListTableModel.textvalue).toString().toText12Auto(color: MyColors.normalTextColor)); + } else { + return Flexible(child: ("-").toString().toText12Auto(color: MyColors.normalTextColor)); + } +}