diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index e3ba914..7f94de7 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 10.0, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 33, versionID: 10.0, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 27e8ddc..7ce4d76 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -23,6 +23,7 @@ import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/ui/landing/event_activity_banner.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/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/landing/widget/services_widget.dart'; import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart'; import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart'; @@ -154,15 +155,15 @@ class _DashboardScreenState extends State with WidgetsBindingOb data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchMenuEntries(); - data.fetchEventActivity(); - data.getCategoryOffersListAPI(context); + // data.fetchEventActivity(); + // data.getCategoryOffersListAPI(context); data.fetchGreetingCards(); // marathonProvider.getMarathonDetailsFromApi(); // marathonProvider.getMarathonTutorial(); if (isFromInit) { checkERMChannel(); } - if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon(); + // if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon(); _refreshController.refreshCompleted(); await data.fetchTicketBooking(); @@ -293,9 +294,9 @@ class _DashboardScreenState extends State with WidgetsBindingOb Image .asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28) .expanded, - SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async { - await Navigator.pushNamed(context, AppRoutes.announcements); - }), + // SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async { + // await Navigator.pushNamed(context, AppRoutes.announcements); + // }), ], ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), Expanded( @@ -588,96 +589,96 @@ class _DashboardScreenState extends State with WidgetsBindingOb ), ], - (data != null && data.getOffersList.isNotEmpty) ? Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - LocaleKeys.offers.tr().toText12(), - Row( - children: [ - LocaleKeys.discounts.tr().toText24(isBold: true), - 6.width, - Container( - padding: const EdgeInsets.only(left: 8, right: 8), - decoration: BoxDecoration(color: MyColors.yellowColor, borderRadius: BorderRadius.circular(10)), - child: LocaleKeys.newString.tr().toText10(isBold: true), - ), - ], - ), - ], - ), - ), - LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { - Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); - }), - ], - ).paddingOnly(left: 21, right: 21), - Consumer( - builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - return SizedBox( - height: 103 + 33, - child: ListView.separated( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(left: 21, right: 21, top: 13), - scrollDirection: Axis.horizontal, - itemBuilder: (BuildContext cxt, int index) { - return model.isOffersLoading - ? const OffersShimmerWidget() - : InkWell( - onTap: () { - navigateToDetails(data.getOffersList[index]); - }, - child: SizedBox( - width: 73, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 73, - height: 73, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(100)), - border: Border.all(color: MyColors.lightGreyE3Color, width: 1), - ), - child: ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(50)), - child: Hero( - tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, - transitionOnUserGestures: true, - child: Image.network(data.getOffersList[index].logo ?? "", fit: BoxFit.contain), - ), - ), - ), - 4.height, - Expanded( - child: - AppState().isArabic(context) - ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) - : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), - ), - ], - ), - ), - ); - }, - separatorBuilder: (BuildContext cxt, int index) => 8.width, - itemCount: 9, - ), - ); - }, - ), - ], - ) : const SizedBox(), + // (data != null && data.getOffersList.isNotEmpty) ? Column( + // mainAxisSize: MainAxisSize.min, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + // children: [ + // LocaleKeys.offers.tr().toText12(), + // Row( + // children: [ + // LocaleKeys.discounts.tr().toText24(isBold: true), + // 6.width, + // Container( + // padding: const EdgeInsets.only(left: 8, right: 8), + // decoration: BoxDecoration(color: MyColors.yellowColor, borderRadius: BorderRadius.circular(10)), + // child: LocaleKeys.newString.tr().toText10(isBold: true), + // ), + // ], + // ), + // ], + // ), + // ), + // LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { + // Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); + // }), + // ], + // ).paddingOnly(left: 21, right: 21), + // Consumer( + // builder: (BuildContext context, DashboardProviderModel model, Widget? child) { + // return SizedBox( + // height: 103 + 33, + // child: ListView.separated( + // shrinkWrap: true, + // physics: const BouncingScrollPhysics(), + // padding: const EdgeInsets.only(left: 21, right: 21, top: 13), + // scrollDirection: Axis.horizontal, + // itemBuilder: (BuildContext cxt, int index) { + // return model.isOffersLoading + // ? const OffersShimmerWidget() + // : InkWell( + // onTap: () { + // navigateToDetails(data.getOffersList[index]); + // }, + // child: SizedBox( + // width: 73, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Container( + // width: 73, + // height: 73, + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: const BorderRadius.all(Radius.circular(100)), + // border: Border.all(color: MyColors.lightGreyE3Color, width: 1), + // ), + // child: ClipRRect( + // borderRadius: const BorderRadius.all(Radius.circular(50)), + // child: Hero( + // tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, + // transitionOnUserGestures: true, + // child: Image.network(data.getOffersList[index].logo ?? "", fit: BoxFit.contain), + // ), + // ), + // ), + // 4.height, + // Expanded( + // child: + // AppState().isArabic(context) + // ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) + // : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), + // ), + // ], + // ), + // ), + // ); + // }, + // separatorBuilder: (BuildContext cxt, int index) => 8.width, + // itemCount: 9, + // ), + // ); + // }, + // ), + // ], + // ) : const SizedBox(), Container( width: double.infinity, @@ -757,8 +758,8 @@ class _DashboardScreenState extends State with WidgetsBindingOb label: LocaleKeys.home.tr(), ), BottomNavigationBarItem( - icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), - label: LocaleKeys.mowadhafhiRequest.tr(), + icon: SvgPicture.asset("assets/images/drawer/my_requests.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), + label: LocaleKeys.myRequest.tr(), ), BottomNavigationBarItem( icon: Stack( @@ -787,43 +788,12 @@ class _DashboardScreenState extends State with WidgetsBindingOb label: LocaleKeys.workList.tr(), ), BottomNavigationBarItem( - icon: SvgPicture.asset("assets/icons/item_for_sale.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), - label: LocaleKeys.itemsForSale.tr(), + icon: SvgPicture.asset("assets/images/ticket_bal.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color, height: 22, width: 22).paddingAll(4), + label: LocaleKeys.ticketBalance.tr(), ), BottomNavigationBarItem( - icon: Stack( - alignment: Alignment.centerLeft, - children: [ - SvgPicture.asset( - "assets/icons/chat/chat.svg", - color: - !checkIfPrivilegedForChat() - ? MyColors.lightGreyE3Color - : currentIndex == 4 - ? MyColors.grey3AColor - : cProvider.disbaleChatForThisUser - ? MyColors.lightGreyE3Color - : MyColors.grey98Color, - ).paddingAll(4), - Consumer( - builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { - return !checkIfPrivilegedForChat() - ? const SizedBox() - : Positioned( - right: 0, - top: 0, - child: Container( - padding: const EdgeInsets.only(left: 4, right: 4), - alignment: Alignment.center, - decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)), - child: data.chatUConvCounter.toString().toText10(color: Colors.white), - ), - ); - }, - ), - ], - ), - label: LocaleKeys.chat.tr(), + icon: SvgPicture.asset("assets/images/drawer/my_profile.svg", color: currentIndex == 4 ? MyColors.grey3AColor : MyColors.grey98Color, height: 20, width: 20).paddingAll(4), + label: LocaleKeys.myProfile.tr(), ), ], currentIndex: currentIndex, @@ -836,15 +806,13 @@ class _DashboardScreenState extends State with WidgetsBindingOb unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28), onTap: (int index) { if (index == 1) { - Navigator.pushNamed(context, AppRoutes.mowadhafhi); + Navigator.pushNamed(context, AppRoutes.myRequests); } else if (index == 2) { Navigator.pushNamed(context, AppRoutes.workList); } else if (index == 3) { - Navigator.pushNamed(context, AppRoutes.itemsForSale); + Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS")); } else if (index == 4) { - if (!cProvider.disbaleChatForThisUser && checkIfPrivilegedForChat()) { - Navigator.pushNamed(context, AppRoutes.chat); - } + Navigator.pushNamed(context, AppRoutes.profile); } }, ), @@ -867,24 +835,24 @@ class _DashboardScreenState extends State with WidgetsBindingOb ? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) : const SizedBox(); } - - void navigateToDetails(OffersListModel offersListModelObj) { - List getOffersDetailList = []; - getOffersDetailList.clear(); - int counter = 1; - - getOffersDetailList.add(offersListModelObj); - - data.getOffersList.forEach((OffersListModel element) { - if (counter <= 4) { - if (element.offersDiscountId != offersListModelObj.offersDiscountId) { - getOffersDetailList.add(element); - counter++; - } - } - }); - Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList); - } + // + // void navigateToDetails(OffersListModel offersListModelObj) { + // List getOffersDetailList = []; + // getOffersDetailList.clear(); + // int counter = 1; + // + // getOffersDetailList.add(offersListModelObj); + // + // data.getOffersList.forEach((OffersListModel element) { + // if (counter <= 4) { + // if (element.offersDiscountId != offersListModelObj.offersDiscountId) { + // getOffersDetailList.add(element); + // counter++; + // } + // } + // }); + // Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList); + // } bool checkIfPrivilegedForChat() { for (PrivilegeListModel element in AppState().privilegeListModel!) { diff --git a/lib/ui/screens/my_requests/my_requests.dart b/lib/ui/screens/my_requests/my_requests.dart index 4d16219..21483c0 100644 --- a/lib/ui/screens/my_requests/my_requests.dart +++ b/lib/ui/screens/my_requests/my_requests.dart @@ -47,7 +47,7 @@ class _MyRequestsState extends State { backgroundColor: Colors.white, appBar: AppBarWidget( context, - title: LocaleKeys.concurrentReports, + title: LocaleKeys.concurrentReports.tr(), ), body: Column( children: [ diff --git a/lib/ui/screens/my_requests/new_request.dart b/lib/ui/screens/my_requests/new_request.dart index 04d7cb4..07bd96f 100644 --- a/lib/ui/screens/my_requests/new_request.dart +++ b/lib/ui/screens/my_requests/new_request.dart @@ -47,7 +47,7 @@ class _NewRequestState extends State { backgroundColor: Colors.white, appBar: AppBarWidget( context, - title: LocaleKeys.concurrentReports, + title: LocaleKeys.concurrentReports.tr(), ), body: Column( children: [ diff --git a/lib/widgets/mark_attendance_widget.dart b/lib/widgets/mark_attendance_widget.dart index ec3a400..1b5b556 100644 --- a/lib/widgets/mark_attendance_widget.dart +++ b/lib/widgets/mark_attendance_widget.dart @@ -574,7 +574,7 @@ class _MarkAttendanceWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset(image, color: Colors.white, alignment: Alignment.topLeft).expanded, + SvgPicture.asset(image, color: Colors.white, alignment: Alignment.topLeft, height: 42, ).expanded, title.toText17(isBold: true, color: Colors.white), ], ), diff --git a/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart index 5e0b62d..3fa08d6 100644 --- a/lib/widgets/nfc/nfc_reader_sheet.dart +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -140,6 +140,7 @@ class _NfcLayoutState extends State { Widget doneNfc() { return Container( key: ValueKey(2), + width: double.infinity, child: Column( mainAxisSize: MainAxisSize.min, children: [