From 3be279d57197c11c54237d8965a3b61435f2b52e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Nov 2022 18:00:26 +0300 Subject: [PATCH 1/9] Worklist images added --- lib/ui/work_list/itg_detail_screen.dart | 18 +++++++----------- lib/ui/work_list/worklist_detail_screen.dart | 9 +++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index b215435..0a29a72 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -274,16 +274,19 @@ class _ItgDetailScreenState extends State { returnActionImage = "assets/images/request_info.svg"; break; case "ReportGenerated": - returnActionImage = "assets/images/request_info.svg"; + returnActionImage = "assets/images/worklist/report_generated.svg"; break; case "DataCorrected": - returnActionImage = "assets/images/request_info.svg"; + returnActionImage = "assets/images/worklist/report_generated.svg"; break; case "Doable": - returnActionImage = "assets/images/request_info.svg"; + returnActionImage = "assets/images/worklist/doable.svg"; break; case "NotDoable": - returnActionImage = "assets/images/request_info.svg"; + returnActionImage = "assets/images/worklist/not_doable.svg"; + break; + case "Answer": + returnActionImage = "assets/images/worklist/answer_hr.svg"; break; default: returnActionImage = "assets/images/request_info.svg"; @@ -358,13 +361,6 @@ class _ItgDetailScreenState extends State { case "Answer": performAction("Answer"); break; - - case "RFC": - // do something else - break; - case "UPDATE_ACTION": - // do something else - break; } setState(() { showFabOptions = false; diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 262ec4f..3c05204 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -404,6 +404,15 @@ class _WorkListDetailScreenState extends State { case "UPDATE_ACTION": returnActionImage = "assets/images/worklist/update_action.svg"; break; + case "APPROVE_AND_FORWARD": + returnActionImage = "assets/images/worklist/approve_and_forward.svg"; + break; + case "FORWARD": + returnActionImage = "assets/images/worklist/forward.svg"; + break; + default: + returnActionImage = "assets/images/request_info.svg"; + break; } return returnActionImage; From 4d0d3a980eeab4acacd10a2d97059e9b2dc83cd6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Nov 2022 10:44:15 +0300 Subject: [PATCH 2/9] Item history updated --- lib/ui/work_list/item_history_screen.dart | 48 ++++++++++++++++------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/lib/ui/work_list/item_history_screen.dart b/lib/ui/work_list/item_history_screen.dart index 6cf80ca..782e34d 100644 --- a/lib/ui/work_list/item_history_screen.dart +++ b/lib/ui/work_list/item_history_screen.dart @@ -131,21 +131,39 @@ class _ItemHistoryScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - ItemDetailView(LocaleKeys.operatingUnit.tr(), poItemHistoryList[index].oUNAME ?? ""), - ItemDetailView(LocaleKeys.poNumber.tr(), poItemHistoryList[index].pONUMBER ?? ""), - ItemDetailView(LocaleKeys.revision.tr(), poItemHistoryList[index].rEVISIONNUM?.toString() ?? ""), - ItemDetailView(LocaleKeys.creationDate.tr(), poItemHistoryList[index].cREATIONDATE ?? ""), - ItemDetailView(LocaleKeys.supplier.tr(), poItemHistoryList[index].sUPPLIER ?? ""), - ItemDetailView(LocaleKeys.buyer.tr(), poItemHistoryList[index].bUYER ?? ""), - ItemDetailView(LocaleKeys.uom.tr(), poItemHistoryList[index].uOM ?? ""), - ItemDetailView(LocaleKeys.quantityOrdered.tr(), poItemHistoryList[index].qUANTITYORDERED?.toString() ?? ""), - ItemDetailView(LocaleKeys.quantityReceived.tr(), poItemHistoryList[index].qUANTITYRECEIVED?.toString() ?? ""), - ItemDetailView(LocaleKeys.bonusQuantity.tr(), poItemHistoryList[index].bONUSQUANTITY?.toString() ?? ""), - ItemDetailView(LocaleKeys.purchasePrice.tr(), poItemHistoryList[index].pURCHASEPRICE?.toString() ?? ""), - ItemDetailView(LocaleKeys.discountPer.tr(), poItemHistoryList[index].dISCOUNTPERCENTAGE?.toString() ?? ""), - ItemDetailView(LocaleKeys.balanceQuantity.tr(), poItemHistoryList[index].bALANCEQUANTITY?.toString() ?? ""), - ItemDetailView(LocaleKeys.netPrice.tr(), poItemHistoryList[index].nETPRICE?.toString() ?? ""), - ItemDetailView(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""), + // ItemDetailGrid( + // ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), + // ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), + // ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), poItemHistoryList[index].oUNAME ?? ""), + ItemDetailViewCol(LocaleKeys.poNumber.tr(), poItemHistoryList[index].pONUMBER ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.revision.tr(), poItemHistoryList[index].rEVISIONNUM?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.creationDate.tr(), poItemHistoryList[index].cREATIONDATE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.supplier.tr(), poItemHistoryList[index].sUPPLIER ?? ""), + ItemDetailViewCol(LocaleKeys.buyer.tr(), poItemHistoryList[index].bUYER ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.uom.tr(), poItemHistoryList[index].uOM ?? ""), + ItemDetailViewCol(LocaleKeys.quantityOrdered.tr(), poItemHistoryList[index].qUANTITYORDERED?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.quantityReceived.tr(), poItemHistoryList[index].qUANTITYRECEIVED?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.bonusQuantity.tr(), poItemHistoryList[index].bONUSQUANTITY?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.purchasePrice.tr(), poItemHistoryList[index].pURCHASEPRICE?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.discountPer.tr(), poItemHistoryList[index].dISCOUNTPERCENTAGE?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.balanceQuantity.tr(), poItemHistoryList[index].bALANCEQUANTITY?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.netPrice.tr(), poItemHistoryList[index].nETPRICE?.toString() ?? ""), + ), + ItemDetailGrid(ItemDetailViewCol(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""), Container(), isItLast: true,) ], ).objectContainerView(), separatorBuilder: (cxt, index) => 12.height, From c22556d9b6afae97cf514ce7c63ac4674baa7484 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Nov 2022 15:43:28 +0300 Subject: [PATCH 3/9] fixes --- lib/classes/consts.dart | 4 +- lib/main.dart | 6 ++ lib/ui/dialogs/success_dialog.dart | 2 +- lib/ui/landing/dashboard_screen.dart | 4 +- lib/ui/landing/widget/services_widget.dart | 90 ++++++++++++++++++- .../fragments/add_details_fragment.dart | 6 +- .../fragments/item_review_fragment.dart | 2 + pubspec.yaml | 1 + 8 files changed, 107 insertions(+), 8 deletions(-) diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 6276213..eea2481 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -1,7 +1,7 @@ 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://hmgwebservices.com"; // Live server + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT 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 static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/main.dart b/lib/main.dart index adca4aa..a2ae0ae 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -92,6 +92,12 @@ class MyApp extends StatelessWidget { MonthYearPickerLocalizations.delegate, ); return MaterialApp( + builder: (BuildContext context, Widget? child) { + return MediaQuery( + data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), + child: child!, + ); + }, theme: AppTheme.getTheme( EasyLocalization.of(context)?.locale.languageCode == "ar", ), diff --git a/lib/ui/dialogs/success_dialog.dart b/lib/ui/dialogs/success_dialog.dart index 5150110..a5df64f 100644 --- a/lib/ui/dialogs/success_dialog.dart +++ b/lib/ui/dialogs/success_dialog.dart @@ -53,8 +53,8 @@ class _SuccessDialogState extends State with TickerProviderStateM repeat: false, reverse: false, controller: _controller, + frameRate: FrameRate(60.0), onLoaded: (LottieComposition v) async { - print("calling_lottie " + v.seconds.toString()); await playSuccessSound(); _controller ..duration = v.duration diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index d342072..b49b98b 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -256,7 +256,7 @@ class _DashboardScreenState extends State { margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0), width: 45, height: 45, - padding: const EdgeInsets.only(left: 14, right: 14), + padding: const EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( color: Color(0xff259EA4), borderRadius: BorderRadius.only( @@ -296,7 +296,7 @@ class _DashboardScreenState extends State { ), ], ).paddingOnly(left: 21, right: 21, top: 7), - MarathonBanner().paddingAll(20), + const MarathonBanner().paddingAll(20), ServicesWidget(), // 8.height, Container( diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index 0b257c5..ae24dde 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -39,7 +39,7 @@ class ServicesWidget extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, - children: [ + children: [ data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21), SizedBox( height: 105 + 26, @@ -69,7 +69,7 @@ class ServicesWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset(iconT[index]), + SvgPicture.asset(AppState().isArabic(context) ? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!) : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ @@ -102,6 +102,92 @@ class ServicesWidget extends StatelessWidget { ); } + String getMenuIconAr(String name) { + String returnImage = ""; + switch (name) { + case "الحضور الشهري": + returnImage = "assets/images/services_icons/monthly_attendance.svg"; + break; + case "كشف الراتب": + returnImage = "assets/images/services_icons/payslips.svg"; + break; + case "تغيير معلومات البنك": + returnImage = "assets/images/services_icons/change_bank_details.svg"; + break; + case "طلب بدل السكن مقدما": + returnImage = "assets/images/services_icons/housing_allowance.svg"; + break; + case "شهادات تعريف الموظف": + returnImage = "assets/images/services_icons/employee_certificates.svg"; + break; + case "البيانات الشخصية": + returnImage = "assets/images/personal-info.svg"; + break; + case "الحضور": + returnImage = "assets/images/services_icons/my_attendance.svg"; + break; + case "طلبات أخرى": + returnImage = "assets/images/services_icons/other_requests.svg"; + break; + case "الإجازات": + returnImage = "assets/images/services_icons/my_leaves.svg"; + break; + case "طلب تذكرة": + returnImage = "assets/images/services_icons/ticket_bal.svg"; + break; + case "قاعدة الاجازات": + returnImage = "assets/images/services_icons/vacation_rule.svg"; + break; + default: + returnImage = "assets/images/monthly_attendance.svg"; + break; + } + return returnImage; + } + + String getMenuIconEn(String name) { + String returnImage = ""; + switch (name) { + case "Monthly Attendance": + returnImage = "assets/images/services_icons/monthly_attendance.svg"; + break; + case "Payslip": + returnImage = "assets/images/services_icons/payslips.svg"; + break; + case "Change Bank Details": + returnImage = "assets/images/services_icons/change_bank_details.svg"; + break; + case "Housing Advance": + returnImage = "assets/images/services_icons/housing_allowance.svg"; + break; + case "Employee Certificate": + returnImage = "assets/images/services_icons/employee_certificates.svg"; + break; + case "Personal Information": + returnImage = "assets/images/personal-info.svg"; + break; + case "My Attendance": + returnImage = "assets/images/services_icons/my_attendance.svg"; + break; + case "Other Requests": + returnImage = "assets/images/services_icons/other_requests.svg"; + break; + case "My Leave": + returnImage = "assets/images/services_icons/my_leaves.svg"; + break; + case "Ticket Request": + returnImage = "assets/images/services_icons/ticket_bal.svg"; + break; + case "Vacation Rule": + returnImage = "assets/images/services_icons/vacation_rule.svg"; + break; + default: + returnImage = "assets/images/monthly_attendance.svg"; + break; + } + return returnImage; + } + void handleOnPress(context, GetMenuEntriesList menuEntry) { var pro = Provider.of(context, listen: false); if (menuEntry.requestType == "MONTHLY_ATTENDANCE") { diff --git a/lib/ui/screens/items_for_sale/fragments/add_details_fragment.dart b/lib/ui/screens/items_for_sale/fragments/add_details_fragment.dart index b2791ec..f0f2c62 100644 --- a/lib/ui/screens/items_for_sale/fragments/add_details_fragment.dart +++ b/lib/ui/screens/items_for_sale/fragments/add_details_fragment.dart @@ -25,8 +25,9 @@ class AddItemDetailsFragment extends StatefulWidget { final Function changePageViewIndex; final GetSaleCategoriesList selectedSaleCategory; static late ItemReviewModel itemReviewModel; + static late bool isUpdate; - const AddItemDetailsFragment({Key? key, required this.changePageViewIndex, required this.selectedSaleCategory}) : super(key: key); + AddItemDetailsFragment({Key? key, required this.changePageViewIndex, required this.selectedSaleCategory}) : super(key: key); @override State createState() => _AddItemDetailsFragmentState(); @@ -246,6 +247,7 @@ class _AddItemDetailsFragmentState extends State { String details = await Utils.getStringFromPrefs(SharedPrefsConsts.editItemForSale); if(details.isNotEmpty) { var body = json.decode(details); + AddItemDetailsFragment.isUpdate = true; GetRegionsList selectedRegionAd = GetRegionsList(); @@ -268,6 +270,8 @@ class _AddItemDetailsFragmentState extends State { AddItemDetailsFragment.itemReviewModel = itemReviewModel; SelectCategoryFragment.selectedSaleCategory = selectedSaleCategoryAd; + } else { + AddItemDetailsFragment.isUpdate = false; } } diff --git a/lib/ui/screens/items_for_sale/fragments/item_review_fragment.dart b/lib/ui/screens/items_for_sale/fragments/item_review_fragment.dart index 0b02658..190460e 100644 --- a/lib/ui/screens/items_for_sale/fragments/item_review_fragment.dart +++ b/lib/ui/screens/items_for_sale/fragments/item_review_fragment.dart @@ -26,11 +26,13 @@ class ItemReviewFragment extends StatefulWidget { class _ItemReviewFragmentState extends State { ItemReviewModel? itemReviewModel; + late bool isUpdate; @override void initState() { itemReviewModel = AddItemDetailsFragment.itemReviewModel; itemReviewModel!.selectedSaleCategory = SelectCategoryFragment.selectedSaleCategory; + isUpdate = AddItemDetailsFragment.isUpdate; super.initState(); } diff --git a/pubspec.yaml b/pubspec.yaml index bba295d..9fb50ac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -128,6 +128,7 @@ flutter: - assets/audio/ - assets/images/ - assets/images/worklist/ + - assets/images/services_icons/ - assets/images/login/ - assets/icons/chat/ - assets/images/logos/ From 6fe015d10466c850e94731fc5678f42f2650d02d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Nov 2022 16:25:48 +0300 Subject: [PATCH 4/9] fixes --- lib/ui/work_list/sheets/selected_item_sheet.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ui/work_list/sheets/selected_item_sheet.dart b/lib/ui/work_list/sheets/selected_item_sheet.dart index 4f7f6b3..54f87d0 100644 --- a/lib/ui/work_list/sheets/selected_item_sheet.dart +++ b/lib/ui/work_list/sheets/selected_item_sheet.dart @@ -140,7 +140,7 @@ class SelectedItemSheet extends StatelessWidget { Future performNetworkCall(BuildContext context, {String? email, String? userId}) async { Utils.showLoading(context); try { - await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList!.sEQUENCE); + await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList != null ? actionHistoryList!.sEQUENCE : null); Utils.hideLoading(context); // Navigator.pop(context); // Navigator.pop(context); @@ -212,7 +212,7 @@ class SelectedItemSheet extends StatelessWidget { : CircularAvatar( height: 40, width: 40, - ).toShimmer() + ) : (actionHistoryList != null && actionHistoryList!.eMPLOYEEIMAGE != null) ? CircularAvatar( height: 40, @@ -223,7 +223,7 @@ class SelectedItemSheet extends StatelessWidget { : CircularAvatar( height: 40, width: 40, - ).toShimmer(), + ), 16.width, Expanded( child: (name ?? "").toText12(), From c2a4df89bb518fdb775c3a9957ab14b3f2cf63c2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 13 Nov 2022 11:19:21 +0300 Subject: [PATCH 5/9] offers & discouts --- .../offers_and_discounts/offers_and_discounts_home.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 45247dc..343eed8 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 @@ -173,7 +173,7 @@ class _OffersAndDiscountsHomeState extends State { tag: "ItemImage" + getOffersList.rowID!, transitionOnUserGestures: true, child: AspectRatio( - aspectRatio: 148 / 127, + aspectRatio: 118 / 127, child: ClipRRect( borderRadius: BorderRadius.circular(6), child: Image.network( @@ -192,10 +192,10 @@ class _OffersAndDiscountsHomeState extends State { // // launchUrl(Uri.parse(url!)); // // } // ), - getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), + // getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), // 8.height, getOffersList.discount!.toText14(isBold: true, maxlines: 1), - 10.height, + 20.height, Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [checkDate(getOffersList.endDate!), SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)], @@ -211,7 +211,7 @@ class _OffersAndDiscountsHomeState extends State { if (enteredKeyword.isEmpty) { results = getOffersList; } else { - if(AppState().isArabic(context)) { + 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(); From cffe185cdad9f6ecc1b65a53b49399173b75a3c3 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 13 Nov 2022 16:32:53 +0300 Subject: [PATCH 6/9] ITG Count fixes --- lib/app_state/app_state.dart | 6 ++++++ lib/classes/consts.dart | 4 ++-- lib/ui/login/login_screen.dart | 4 ++-- lib/ui/work_list/item_history_screen.dart | 12 ++++++++---- lib/ui/work_list/itg_detail_screen.dart | 6 ++++++ lib/ui/work_list/work_list_screen.dart | 1 + 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 9e61872..49f4186 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -120,6 +120,12 @@ class AppState { set setItgWorkListIndex(int? _itgWorkListIndex) => itgWorkListIndex = _itgWorkListIndex; + String? itgRequestType; + + set setItgRequestType(String? _itgRequestType) => itgRequestType = _itgRequestType; + + String? get getItgRequestType => itgRequestType; + UserAutoLoginModel? chatDetails; set setchatUserDetails(UserAutoLoginModel details) => chatDetails = details; diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 646e498..789ef40 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -1,7 +1,7 @@ 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://hmgwebservices.com"; // Live server + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT 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 static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 97282d3..20fa8bc 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -142,8 +142,8 @@ class _LoginScreenState extends State { isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; if (!kReleaseMode) { // username.text = "15444"; // Maha User - username.text = "15153"; // Tamer User - password.text = "Abcd@12345"; + // username.text = "15153"; // Tamer User + // password.text = "Abcd@12345"; // username.text = "206535"; // Hashim User // password.text = "Namira786"; diff --git a/lib/ui/work_list/item_history_screen.dart b/lib/ui/work_list/item_history_screen.dart index 782e34d..fb1066b 100644 --- a/lib/ui/work_list/item_history_screen.dart +++ b/lib/ui/work_list/item_history_screen.dart @@ -86,9 +86,9 @@ class _ItemHistoryScreenState extends State { padding: const EdgeInsets.all(21), physics: const BouncingScrollPhysics(), children: [ - if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData(), - if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData(), - if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData() + if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData() else Utils.getNoDataWidget(context), + if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData() else Utils.getNoDataWidget(context), + if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData() else Utils.getNoDataWidget(context) ], ), ); @@ -163,7 +163,11 @@ class _ItemHistoryScreenState extends State { ItemDetailViewCol(LocaleKeys.balanceQuantity.tr(), poItemHistoryList[index].bALANCEQUANTITY?.toString() ?? ""), ItemDetailViewCol(LocaleKeys.netPrice.tr(), poItemHistoryList[index].nETPRICE?.toString() ?? ""), ), - ItemDetailGrid(ItemDetailViewCol(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""), Container(), isItLast: true,) + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""), + Container(), + isItLast: true, + ) ], ).objectContainerView(), separatorBuilder: (cxt, index) => 12.height, diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index 0a29a72..bbb0267 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -14,6 +14,7 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/allowed_actions_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart'; +import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/ui/work_list/itg_fragments/approval_level_fragment.dart'; import 'package:mohem_flutter_app/ui/work_list/itg_fragments/request_detail_fragment.dart'; import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; @@ -21,6 +22,7 @@ import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/dialogs/itg_comments_dialog.dart'; +import 'package:provider/provider.dart'; class ItgDetailScreen extends StatefulWidget { ItgDetailScreen({Key? key}) : super(key: key); @@ -42,8 +44,11 @@ class _ItgDetailScreenState extends State { List allowedActionList = []; + late DashboardProviderModel providerData; + @override void initState() { + providerData = Provider.of(context, listen: false); super.initState(); } @@ -78,6 +83,7 @@ class _ItgDetailScreenState extends State { void getDataFromState() { if (requestDetails == null) { requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; + providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1; getItgData(); } } diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 9471568..8efd789 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -347,6 +347,7 @@ class _WorkListScreenState extends State { return InkWell( onTap: () async { AppState().setItgWorkListIndex = index; + AppState().setItgRequestType = requestDetails.requestType; var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.itgDetail); if (shouldReloadData != null) { if (shouldReloadData.toString() == "delegate_reload") { From 4ff3a5093bd2bc70f49d81df6d6fa2e0a539db67 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 14 Nov 2022 10:22:16 +0300 Subject: [PATCH 7/9] Action duration implemented --- lib/classes/date_uitl.dart | 76 ++++++++----- lib/extensions/string_extensions.dart | 3 +- lib/ui/work_list/item_history_screen.dart | 101 +++++++++++------- .../worklist_fragments/actions_fragment.dart | 28 ++++- 4 files changed, 140 insertions(+), 68 deletions(-) diff --git a/lib/classes/date_uitl.dart b/lib/classes/date_uitl.dart index 73945f8..f7b8192 100644 --- a/lib/classes/date_uitl.dart +++ b/lib/classes/date_uitl.dart @@ -381,6 +381,30 @@ class DateUtil { return ""; } + static String formatDuration(Duration d) { + var seconds = d.inSeconds; + var days = seconds ~/ Duration.secondsPerDay; + seconds -= days * Duration.secondsPerDay; + var hours = seconds ~/ Duration.secondsPerHour; + seconds -= hours * Duration.secondsPerHour; + var minutes = seconds ~/ Duration.secondsPerMinute; + seconds -= minutes * Duration.secondsPerMinute; + + List tokens = []; + if (days != 0) { + tokens.add('$days days'); + } + if (tokens.isNotEmpty || hours != 0) { + tokens.add('$hours hours'); + } + if (tokens.isNotEmpty || minutes != 0) { + tokens.add('$minutes mins'); + } + tokens.add('$seconds secs'); + + return tokens.join(' '); + } + /// get data formatted like 26/4/2020 /// [dateTime] convert DateTime to data formatted according to language static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) { @@ -431,30 +455,30 @@ class DateUtil { return "/Date(" + DateFormat('mm-dd-yyy').parse(isoDate).millisecondsSinceEpoch.toString() + ")/"; } - // static String getDay(DayOfWeek dayOfWeek) { - // switch (dayOfWeek) { - // case DayOfWeek.Monday: - // return "Monday"; - // break; - // case DayOfWeek.Tuesday: - // return "Tuesday"; - // break; - // case DayOfWeek.Wednesday: - // return "Wednesday"; - // break; - // case DayOfWeek.Thursday: - // return "Thursday"; - // break; - // case DayOfWeek.Friday: - // return "Friday"; - // break; - // case DayOfWeek.Saturday: - // return "Saturday"; - // break; - // case DayOfWeek.Sunday: - // return "Sunday"; - // break; - // } - // return ""; - // } +// static String getDay(DayOfWeek dayOfWeek) { +// switch (dayOfWeek) { +// case DayOfWeek.Monday: +// return "Monday"; +// break; +// case DayOfWeek.Tuesday: +// return "Tuesday"; +// break; +// case DayOfWeek.Wednesday: +// return "Wednesday"; +// break; +// case DayOfWeek.Thursday: +// return "Thursday"; +// break; +// case DayOfWeek.Friday: +// return "Friday"; +// break; +// case DayOfWeek.Saturday: +// return "Saturday"; +// break; +// case DayOfWeek.Sunday: +// return "Sunday"; +// break; +// } +// return ""; +// } } diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 9af8f2b..8bc15e7 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -22,8 +22,9 @@ extension EmailValidator on String { style: TextStyle(fontSize: 10, fontStyle: fontStyle ?? FontStyle.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), ); - Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false}) => Text( + Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false, int maxLine = 0}) => Text( this, + maxLines: (maxLine > 0) ? maxLine : null, style: TextStyle( fontSize: 11, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600), diff --git a/lib/ui/work_list/item_history_screen.dart b/lib/ui/work_list/item_history_screen.dart index fb1066b..562b59f 100644 --- a/lib/ui/work_list/item_history_screen.dart +++ b/lib/ui/work_list/item_history_screen.dart @@ -86,9 +86,9 @@ class _ItemHistoryScreenState extends State { padding: const EdgeInsets.all(21), physics: const BouncingScrollPhysics(), children: [ - if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData() else Utils.getNoDataWidget(context), - if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData() else Utils.getNoDataWidget(context), - if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData() else Utils.getNoDataWidget(context) + if (moItemHistoryList.isNotEmpty) loadMoItemHistoryData(), + if (poItemHistoryList.isNotEmpty) loadPoItemHistoryData(), + if (quotationAnalysisList.isNotEmpty) loadQuotationAnalysisData() ], ), ); @@ -102,21 +102,39 @@ class _ItemHistoryScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - ItemDetailView(LocaleKeys.requestNumber.tr(), moItemHistoryList[index].rEQUESTNUMBER ?? ""), - ItemDetailView(LocaleKeys.uom.tr(), moItemHistoryList[index].uNITOFMEASURE ?? ""), - ItemDetailView(LocaleKeys.quantity.tr(), moItemHistoryList[index].qUANTITY?.toString() ?? ""), - ItemDetailView(LocaleKeys.dateRequired.tr(), moItemHistoryList[index].dATEREQUIRED ?? ""), - ItemDetailView(LocaleKeys.lineStatus.tr(), moItemHistoryList[index].lINESTATUSDIS ?? ""), - ItemDetailView(LocaleKeys.statusDate.tr(), moItemHistoryList[index].sTATUSDATE ?? ""), - ItemDetailView(LocaleKeys.transactionType.tr(), moItemHistoryList[index].tRANSACTIONTYPENAME ?? ""), - ItemDetailView(LocaleKeys.organization.tr(), moItemHistoryList[index].oRGANIZATIONNAME ?? ""), - ItemDetailView(LocaleKeys.operatingCode.tr(), moItemHistoryList[index].oRGANIZATIONCODE ?? ""), - ItemDetailView(LocaleKeys.operatingUnit.tr(), moItemHistoryList[index].oPERATINGUNITNAME ?? ""), - ItemDetailView(LocaleKeys.fromSubInventory.tr(), moItemHistoryList[index].fROMSUBINVENTORYCODE ?? ""), - ItemDetailView(LocaleKeys.fromLocator.tr(), moItemHistoryList[index].fROMLOCATOR ?? ""), - ItemDetailView(LocaleKeys.toSubInventory.tr(), moItemHistoryList[index].tOSUBINVENTORYCODE ?? ""), - ItemDetailView(LocaleKeys.toLocator.tr(), moItemHistoryList[index].tOLOCATOR ?? ""), - ItemDetailView(LocaleKeys.shipToLocation.tr(), moItemHistoryList[index].sHIPTOLOCATION ?? ""), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.requestNumber.tr(), moItemHistoryList[index].rEQUESTNUMBER ?? ""), + ItemDetailViewCol(LocaleKeys.uom.tr(), moItemHistoryList[index].uNITOFMEASURE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.quantity.tr(), moItemHistoryList[index].qUANTITY?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.dateRequired.tr(), moItemHistoryList[index].dATEREQUIRED ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.lineStatus.tr(), moItemHistoryList[index].lINESTATUSDIS ?? ""), + ItemDetailViewCol(LocaleKeys.statusDate.tr(), moItemHistoryList[index].sTATUSDATE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.transactionType.tr(), moItemHistoryList[index].tRANSACTIONTYPENAME ?? ""), + ItemDetailViewCol(LocaleKeys.organization.tr(), moItemHistoryList[index].oRGANIZATIONNAME ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.operatingCode.tr(), moItemHistoryList[index].oRGANIZATIONCODE ?? ""), + ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), moItemHistoryList[index].oPERATINGUNITNAME ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.fromSubInventory.tr(), moItemHistoryList[index].fROMSUBINVENTORYCODE ?? ""), + ItemDetailViewCol(LocaleKeys.fromLocator.tr(), moItemHistoryList[index].fROMLOCATOR ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.toSubInventory.tr(), moItemHistoryList[index].tOSUBINVENTORYCODE ?? ""), + ItemDetailViewCol(LocaleKeys.toLocator.tr(), moItemHistoryList[index].tOLOCATOR ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), moItemHistoryList[index].sHIPTOLOCATION ?? ""), + Container(), + isItLast: true, + ), ], ).objectContainerView(), separatorBuilder: (cxt, index) => 12.height, @@ -131,10 +149,6 @@ class _ItemHistoryScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - // ItemDetailGrid( - // ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), - // ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), - // ), ItemDetailGrid( ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), poItemHistoryList[index].oUNAME ?? ""), ItemDetailViewCol(LocaleKeys.poNumber.tr(), poItemHistoryList[index].pONUMBER ?? ""), @@ -182,20 +196,35 @@ class _ItemHistoryScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - ItemDetailView(LocaleKeys.quotationNumber.tr(), quotationAnalysisList[index].qUOTNUM ?? ""), - ItemDetailView(LocaleKeys.vendorName.tr(), quotationAnalysisList[index].vENDORNAME ?? ""), - ItemDetailView(LocaleKeys.itemCode.tr(), quotationAnalysisList[index].iTEMCODE ?? ""), - ItemDetailView(LocaleKeys.description.tr(), quotationAnalysisList[index].iTEMDESC ?? ""), - ItemDetailView(LocaleKeys.quotationQty.tr(), quotationAnalysisList[index].qUOTQTY?.toString() ?? ""), - ItemDetailView(LocaleKeys.quotationUOM.tr(), quotationAnalysisList[index].qUOTUOM ?? ""), - ItemDetailView(LocaleKeys.quotationNetPrice.tr(), quotationAnalysisList[index].qUOTUNITPRICE?.toString() ?? ""), - ItemDetailView(LocaleKeys.quotationLineTotal.tr(), quotationAnalysisList[index].qUOTLINETOTAL?.toString() ?? ""), - ItemDetailView(LocaleKeys.quotationBonusQuantity.tr(), quotationAnalysisList[index].qUOTBONUSQTY ?? ""), - ItemDetailView(LocaleKeys.quotationDeliveryDate.tr(), quotationAnalysisList[index].qUOTDELIVERYDATE ?? ""), - ItemDetailView(LocaleKeys.quotationMFGPartNumber.tr(), quotationAnalysisList[index].qUOTMFGPARTNUM ?? ""), - ItemDetailView(LocaleKeys.rfqNumber.tr(), quotationAnalysisList[index].rFQNUM ?? ""), - ItemDetailView(LocaleKeys.rfqQty.tr(), quotationAnalysisList[index].rFQQTY?.toString() ?? ""), - ItemDetailView(LocaleKeys.rfqUOM.tr(), quotationAnalysisList[index].rFQUOM ?? ""), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), quotationAnalysisList[index].qUOTNUM ?? ""), + ItemDetailViewCol(LocaleKeys.vendorName.tr(), quotationAnalysisList[index].vENDORNAME ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.itemCode.tr(), quotationAnalysisList[index].iTEMCODE ?? ""), + ItemDetailViewCol(LocaleKeys.description.tr(), quotationAnalysisList[index].iTEMDESC ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.quotationQty.tr(), quotationAnalysisList[index].qUOTQTY?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.quotationUOM.tr(), quotationAnalysisList[index].qUOTUOM ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.quotationNetPrice.tr(), quotationAnalysisList[index].qUOTUNITPRICE?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.quotationLineTotal.tr(), quotationAnalysisList[index].qUOTLINETOTAL?.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.quotationBonusQuantity.tr(), quotationAnalysisList[index].qUOTBONUSQTY ?? ""), + ItemDetailViewCol(LocaleKeys.quotationDeliveryDate.tr(), quotationAnalysisList[index].qUOTDELIVERYDATE ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.quotationMFGPartNumber.tr(), quotationAnalysisList[index].qUOTMFGPARTNUM ?? ""), + ItemDetailViewCol(LocaleKeys.rfqNumber.tr(), quotationAnalysisList[index].rFQNUM ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.rfqQty.tr(), quotationAnalysisList[index].rFQQTY?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.rfqUOM.tr(), quotationAnalysisList[index].rFQUOM ?? ""), + isItLast: true, + ) ], ).objectContainerView(title: "${quotationAnalysisList[index].iTEMCODE}-${quotationAnalysisList[index].iTEMDESC}"), separatorBuilder: (cxt, index) => 12.height, diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index 8a69599..439888b 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -27,7 +27,7 @@ class ActionsFragment extends StatelessWidget { itemCount: actionHistoryList.length, padding: EdgeInsets.all(21), itemBuilder: (context, index) { - return showItem(context, actionHistoryList[index]); + return showItem(context, actionHistoryList[index], index); }, separatorBuilder: (BuildContext context, int index) { return 12.height; @@ -36,7 +36,7 @@ class ActionsFragment extends StatelessWidget { ); } - Widget showItem(BuildContext context, GetActionHistoryList actionHistory) { + Widget showItem(BuildContext context, GetActionHistoryList actionHistory, int index) { return Container( width: double.infinity, decoration: BoxDecoration( @@ -89,7 +89,9 @@ class ActionsFragment extends StatelessWidget { if (actionHistory.nOTIFICATIONDATE!.isNotEmpty) DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(actionHistory.nOTIFICATIONDATE!), false).toText12(color: MyColors.lightTextColor), ], - ) + ), + 10.height, + getActionDuration(index).toText11(maxLine: 1, color: const Color(0xff1FA269)) ], ), ) @@ -127,8 +129,24 @@ class ActionsFragment extends StatelessWidget { ); } + String getActionDuration(int index) { + if (actionHistoryList[index].aCTIONCODE == "SUBMIT") { + return ""; + } else if(actionHistoryList[index].aCTIONCODE == "PENDING") { + DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!); + Duration duration = DateTime.now().difference(dateTimeFrom); + return "Action duration: " + DateUtil.formatDuration(duration); + } else { + DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!); + DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!); + Duration duration = dateTimeTo.difference(dateTimeFrom); + print(dateTimeTo); + print(dateTimeFrom); + return "Action duration: " + DateUtil.formatDuration(duration); + } + } + Color getStatusColor(String code) { - print("code:$code"); if (code == "SUBMIT") { return const Color(0xff2E303A); } else if (code == "REJECTED") { @@ -139,7 +157,7 @@ class ActionsFragment extends StatelessWidget { return MyColors.orange; } else if (code == "APPROVED" || code == "APPROVE" || code == "ANSWER_INFO") { return const Color(0xff1FA269); - } else if (code == "REQUEST_INFO"|| code == "FORWARD") { + } else if (code == "REQUEST_INFO" || code == "FORWARD") { return const Color(0xff2E303A); } else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") { return MyColors.orange; From c436908d2509c72cbf754245798c7763263e7169 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 15 Nov 2022 14:23:51 +0300 Subject: [PATCH 8/9] updates & fixes --- lib/api/worklist/worklist_api_client.dart | 18 +++ .../attendance/monthly_attendance_screen.dart | 2 +- lib/ui/landing/today_attendance_screen2.dart | 2 +- lib/ui/landing/widget/services_widget.dart | 2 +- lib/ui/marathon/widgets/marathon_banner.dart | 4 +- .../dynamic_screens/dynamic_input_screen.dart | 10 +- lib/ui/my_team/view_attendance.dart | 2 +- lib/ui/profile/add_update_family_member.dart | 2 +- lib/ui/profile/family_members.dart | 3 +- lib/ui/screens/my_requests/my_requests.dart | 6 +- .../offers_and_discounts_details.dart | 4 +- lib/ui/work_list/itg_detail_screen.dart | 29 +++++ lib/ui/work_list/work_list_screen.dart | 1 - lib/ui/work_list/worklist_detail_screen.dart | 11 ++ .../worklist_fragments/actions_fragment.dart | 2 - lib/widgets/app_bar_widget.dart | 110 ++++++++++-------- 16 files changed, 135 insertions(+), 73 deletions(-) diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index d999d18..75992e7 100644 --- a/lib/api/worklist/worklist_api_client.dart +++ b/lib/api/worklist/worklist_api_client.dart @@ -403,6 +403,24 @@ class WorkListApiClient { }, url, postParams); } + Future grantITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async { + String url = "${ApiConsts.cocRest}ITGGrantAccess"; + Map postParams = { + "RequestType": requestType, + "TaskID": taskId, + "ItemID": itemId, + "EmployeeNumber": employeeNumber, + "Comments": "", + "AdditionalFields": null, + "NewUserEMPId":newUserEMPId + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, url, postParams); + } + Future informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGRequestInformation"; Map postParams = { diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index de35da0..8b62b7f 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -431,7 +431,7 @@ class _MonthlyAttendanceScreenState extends State { expand: false, builder: (_, controller) { dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; - DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); + DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString); return Column( children: [ Container( diff --git a/lib/ui/landing/today_attendance_screen2.dart b/lib/ui/landing/today_attendance_screen2.dart index 17bb03a..ada652c 100644 --- a/lib/ui/landing/today_attendance_screen2.dart +++ b/lib/ui/landing/today_attendance_screen2.dart @@ -86,7 +86,7 @@ class _TodayAttendanceScreenState extends State { child: CircularStepProgressBar( totalSteps: 16 * 4, currentStep: (model.progress * 100).toInt(), - selectedColor: MyColors.gradiantEndColor, + selectedColor: MyColors.gradiantStartColor, unselectedColor: MyColors.grey70Color, child: Center( child: Padding( diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index ae24dde..2333c18 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -74,7 +74,7 @@ class ServicesWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( - child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText10(isBold: true), + child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true), ), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)), ], diff --git a/lib/ui/marathon/widgets/marathon_banner.dart b/lib/ui/marathon/widgets/marathon_banner.dart index 5da5ed2..55ff715 100644 --- a/lib/ui/marathon/widgets/marathon_banner.dart +++ b/lib/ui/marathon/widgets/marathon_banner.dart @@ -142,7 +142,7 @@ class MarathonBanner extends StatelessWidget { bottom: 0, child: RotatedBox( quarterTurns: 4, - child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkDigitColor), + child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), ).paddingAll(15), ) : Positioned( @@ -150,7 +150,7 @@ class MarathonBanner extends StatelessWidget { left: 0, child: RotatedBox( quarterTurns: 2, - child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkDigitColor), + child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), ).paddingAll(15), ), ], 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 045b808..e602c21 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -68,7 +68,7 @@ class _DynamicInputScreenState extends State { } void validateTransaction() async { - // try { + try { Utils.showLoading(context); List> values = getEitDffStructureList!.map((e) { String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? ""; @@ -114,10 +114,10 @@ class _DynamicInputScreenState extends State { Utils.showLoading(context); await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!); Utils.hideLoading(context); - // } catch (ex) { - // Utils.hideLoading(context); - // Utils.handleException(ex, context, null); - // } + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } } String dESCFLEXCONTEXTCODE = ""; diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index 90414d1..0896d5e 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -439,7 +439,7 @@ class _ViewAttendanceState extends State { expand: false, builder: (_, controller) { dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; - DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); + DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString); return Column( children: [ Container( diff --git a/lib/ui/profile/add_update_family_member.dart b/lib/ui/profile/add_update_family_member.dart index 528e38d..36a8394 100644 --- a/lib/ui/profile/add_update_family_member.dart +++ b/lib/ui/profile/add_update_family_member.dart @@ -383,7 +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(1920, 1), lastDate: DateTime.now()); if (picked != null && picked != selectedDate) { time = picked; } diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index fd7bd13..25f62c0 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -128,7 +128,8 @@ class _FamilyMembersState extends State { ), DefaultButton(LocaleKeys.addNewFamilyMember.tr(), menuEntries.updateButton == 'Y' - ? () async { + ? + () async { Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); // ProfileScreen(); } : null).insideContainer, diff --git a/lib/ui/screens/my_requests/my_requests.dart b/lib/ui/screens/my_requests/my_requests.dart index f9d8d39..dd6147f 100644 --- a/lib/ui/screens/my_requests/my_requests.dart +++ b/lib/ui/screens/my_requests/my_requests.dart @@ -76,9 +76,7 @@ class _MyRequestsState extends State { }), ), 12.height, - Expanded( - // todo list don't have data, need to confirm later , because have issues, need fixes - + getCCPTransactionsList.isNotEmpty ? Expanded( child: ListView.separated( physics: const BouncingScrollPhysics(), shrinkWrap: true, @@ -141,7 +139,7 @@ class _MyRequestsState extends State { }, separatorBuilder: (BuildContext context, int index) => 12.height, itemCount: getCCPTransactionsList.length), - ), + ) : Container(), ], ).expanded, 1.divider, diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index 9a308ba..325f4f3 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -176,8 +176,8 @@ class _OffersAndDiscountsDetailsState extends State { // // launchUrl(Uri.parse(url!)); // // } // ), - getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), - 16.height, + // getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), + // 16.height, getOffersList.discount!.toText14(isBold: true, maxlines: 1), 8.height, Row( diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index bbb0267..cf33648 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -367,6 +367,12 @@ class _ItgDetailScreenState extends State { case "Answer": performAction("Answer"); break; + case "ReportGenerated": + performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + break; + case "DataCorrected": + performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + break; } setState(() { showFabOptions = false; @@ -525,6 +531,29 @@ class _ItgDetailScreenState extends State { } } + void performDataCorrectionORReportGeneratedAction(String requestType, int taskId, int itemId, String employeeNumber) async { + try { + Utils.showLoading(context); + ITGRequest? itgRequest = await WorkListApiClient().grantITGRequest(requestType, taskId, itemId, employeeNumber, "", ""); + Utils.hideLoading(context); + Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); + 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(); + } + } + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + void reloadITG() { AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); if (AppState().requestAllList!.isEmpty) { diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 8efd789..f9f8d91 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -226,7 +226,6 @@ class _WorkListScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor), SizedBox( height: 40, child: ListView.separated( diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 3c05204..824edc3 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -476,6 +476,17 @@ class _WorkListDetailScreenState extends State { isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), ); break; + case "CONTINUE_ACTION": + showMyBottomSheet( + context, + callBackFunc: reloadWorkList, + child: UpdateContinueSheet( + workListData: workListData, + getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, + dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, + isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), + ); + break; case "APPROVE_AND_FORWARD": showMyBottomSheet(context, callBackFunc: reloadWorkList, diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index 439888b..58e9ac7 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -140,8 +140,6 @@ class ActionsFragment extends StatelessWidget { DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!); DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!); Duration duration = dateTimeTo.difference(dateTimeFrom); - print(dateTimeTo); - print(dateTimeFrom); return "Action duration: " + DateUtil.formatDuration(duration); } } diff --git a/lib/widgets/app_bar_widget.dart b/lib/widgets/app_bar_widget.dart index 745dedf..35c93ba 100644 --- a/lib/widgets/app_bar_widget.dart +++ b/lib/widgets/app_bar_widget.dart @@ -6,65 +6,73 @@ 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'; -AppBar AppBarWidget(BuildContext context, +PreferredSize AppBarWidget(BuildContext context, {required String title, bool showHomeButton = true, bool showNotificationButton = false, bool showMemberButton = false, String? image}) { - return AppBar( - leadingWidth: 0, - // leading: GestureDetector( - // behavior: HitTestBehavior.opaque, - // onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context), - // child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), - // ), - //titleSpacing: -1.44, - title: Row( + return PreferredSize( + preferredSize: const Size.fromHeight(57.0), + child: Column( children: [ - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: - Feedback.wrapForTap(() => Navigator.maybePop(context), context), - child: - const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), + AppBar( + leadingWidth: 0, + // leading: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context), + // child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), + // ), + //titleSpacing: -1.44, + title: Row( + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: + Feedback.wrapForTap(() => Navigator.maybePop(context), context), + child: + const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), + ), + 4.width, + if (image != null) SvgPicture.asset( + image, + height: 40, + width: 40, + ), + if (image != null) 14.width, + title.toText24(color: MyColors.darkTextColor, isBold: true).expanded, + ], + ), + centerTitle: false, + elevation: 0, + backgroundColor: Colors.white, + actions: [ + if (showHomeButton) + IconButton( + onPressed: () { + Navigator.popUntil( + context, ModalRoute.withName(AppRoutes.dashboard)); + }, + icon: const Icon(Icons.home, color: MyColors.darkIconColor), + ), + if (showNotificationButton) + IconButton( + onPressed: () { + Navigator.pushNamed(context, AppRoutes.worklistSettings); + }, + icon: const Icon(Icons.notifications, color: MyColors.textMixColor), + ), + if (showMemberButton) + IconButton( + onPressed: () { + Navigator.pushNamed(context, AppRoutes.subordinateLeave); + }, + icon: const Icon(Icons.people, color: MyColors.textMixColor), + ), + ], ), - 4.width, - if (image != null) SvgPicture.asset( - image, - height: 40, - width: 40, - ), - if (image != null) 14.width, - title.toText24(color: MyColors.darkTextColor, isBold: true).expanded, + Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor), ], ), - centerTitle: false, - elevation: 0, - backgroundColor: Colors.white, - actions: [ - if (showHomeButton) - IconButton( - onPressed: () { - Navigator.popUntil( - context, ModalRoute.withName(AppRoutes.dashboard)); - }, - icon: const Icon(Icons.home, color: MyColors.darkIconColor), - ), - if (showNotificationButton) - IconButton( - onPressed: () { - Navigator.pushNamed(context, AppRoutes.worklistSettings); - }, - icon: const Icon(Icons.notifications, color: MyColors.textMixColor), - ), - if (showMemberButton) - IconButton( - onPressed: () { - Navigator.pushNamed(context, AppRoutes.subordinateLeave); - }, - icon: const Icon(Icons.people, color: MyColors.textMixColor), - ), - ], ); } From 4f88f30368740e8e671a78cda2738b675d060eb9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 20 Nov 2022 10:26:14 +0300 Subject: [PATCH 9/9] updates --- lib/ui/landing/dashboard_screen.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 165793b..45eea24 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -479,9 +479,9 @@ class _DashboardScreenState extends State { ).paddingAll(4), Consumer( builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) { - if (data.chatUConvCounter == 0) { - return const SizedBox(); - } + // if (data.chatUConvCounter == 0) { + // return const SizedBox(); + // } return Positioned( right: 0, top: 0,