|  |  |  | @ -17,6 +17,7 @@ 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/offers_and_discounts/get_offers_list.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/privilege_list_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/provider/chat_call_provider.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; | 
		
	
	
		
			
				
					|  |  |  | @ -26,6 +27,7 @@ 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'; | 
		
	
		
			
				|  |  |  |  | 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'; | 
		
	
	
		
			
				
					|  |  |  | @ -64,7 +66,9 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb | 
		
	
		
			
				|  |  |  |  |       marathonProvider = Provider.of<MarathonProvider>(context, listen: false); | 
		
	
		
			
				|  |  |  |  |       cProvider = Provider.of<ChatProviderModel>(context, listen: false); | 
		
	
		
			
				|  |  |  |  |       chatCallProvider = Provider.of<ChatCallProvider>(context, listen: false); | 
		
	
		
			
				|  |  |  |  |       _bHubCon(); | 
		
	
		
			
				|  |  |  |  |       if (checkIfPrivilegedForChat()) { | 
		
	
		
			
				|  |  |  |  |         _bHubCon(); | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |       _onRefresh(true); | 
		
	
		
			
				|  |  |  |  |     }); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
	
		
			
				
					|  |  |  | @ -127,7 +131,6 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb | 
		
	
		
			
				|  |  |  |  |     if (chatHubConnection.state == HubConnectionState.Connected) { | 
		
	
		
			
				|  |  |  |  |       Utils.hideLoading(context); | 
		
	
		
			
				|  |  |  |  |       Navigator.pushNamed(context, AppRoutes.chat); | 
		
	
		
			
				|  |  |  |  |       Utils.saveStringFromPrefs("isAppOpendByChat", "false"); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | @ -146,7 +149,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb | 
		
	
		
			
				|  |  |  |  |     data.fetchMenuEntries(); | 
		
	
		
			
				|  |  |  |  |     data.getCategoryOffersListAPI(context); | 
		
	
		
			
				|  |  |  |  |     marathonProvider.getMarathonDetailsFromApi(); | 
		
	
		
			
				|  |  |  |  |     if(isFromInit) { | 
		
	
		
			
				|  |  |  |  |     if (isFromInit) { | 
		
	
		
			
				|  |  |  |  |       checkERMChannel(); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon(); | 
		
	
	
		
			
				
					|  |  |  | @ -291,9 +294,27 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb | 
		
	
		
			
				|  |  |  |  |                   children: [ | 
		
	
		
			
				|  |  |  |  |                     Column( | 
		
	
		
			
				|  |  |  |  |                       crossAxisAlignment: CrossAxisAlignment.start, | 
		
	
		
			
				|  |  |  |  |                       children: [ | 
		
	
		
			
				|  |  |  |  |                       children: <Widget>[ | 
		
	
		
			
				|  |  |  |  |                         LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color), | 
		
	
		
			
				|  |  |  |  |                         (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true), | 
		
	
		
			
				|  |  |  |  |                         (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true).onPress(() async { | 
		
	
		
			
				|  |  |  |  |                           return showMDialog( | 
		
	
		
			
				|  |  |  |  |                             context, | 
		
	
		
			
				|  |  |  |  |                             backgroundColor: Colors.transparent, | 
		
	
		
			
				|  |  |  |  |                             isDismissable: true, | 
		
	
		
			
				|  |  |  |  |                             child: SizedBox( | 
		
	
		
			
				|  |  |  |  |                               width: MediaQuery.of(context).size.width / 2.2, | 
		
	
		
			
				|  |  |  |  |                               height: MediaQuery.of(context).size.width / 2.2, | 
		
	
		
			
				|  |  |  |  |                               child: Card( | 
		
	
		
			
				|  |  |  |  |                                 shape: RoundedRectangleBorder( | 
		
	
		
			
				|  |  |  |  |                                   borderRadius: BorderRadius.circular(25.0), | 
		
	
		
			
				|  |  |  |  |                                 ), | 
		
	
		
			
				|  |  |  |  |                                 child: Center( | 
		
	
		
			
				|  |  |  |  |                                   child: "This app is installed from ${await Utils.getInstallationSource()}".toText16(isCentered: true), | 
		
	
		
			
				|  |  |  |  |                                 ), | 
		
	
		
			
				|  |  |  |  |                               ), | 
		
	
		
			
				|  |  |  |  |                             ), | 
		
	
		
			
				|  |  |  |  |                           ); | 
		
	
		
			
				|  |  |  |  |                         }), | 
		
	
		
			
				|  |  |  |  |                         16.height, | 
		
	
		
			
				|  |  |  |  |                         Row( | 
		
	
		
			
				|  |  |  |  |                           children: [ | 
		
	
	
		
			
				
					|  |  |  | @ -599,24 +620,28 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb | 
		
	
		
			
				|  |  |  |  |                 children: [ | 
		
	
		
			
				|  |  |  |  |                   SvgPicture.asset( | 
		
	
		
			
				|  |  |  |  |                     "assets/icons/chat/chat.svg", | 
		
	
		
			
				|  |  |  |  |                     color: currentIndex == 4 | 
		
	
		
			
				|  |  |  |  |                         ? MyColors.grey3AColor | 
		
	
		
			
				|  |  |  |  |                         : cProvider.disbaleChatForThisUser | 
		
	
		
			
				|  |  |  |  |                             ? MyColors.lightGreyE3Color | 
		
	
		
			
				|  |  |  |  |                             : MyColors.grey98Color, | 
		
	
		
			
				|  |  |  |  |                     color: !checkIfPrivilegedForChat() | 
		
	
		
			
				|  |  |  |  |                         ? MyColors.lightGreyE3Color | 
		
	
		
			
				|  |  |  |  |                         : currentIndex == 4 | 
		
	
		
			
				|  |  |  |  |                             ? MyColors.grey3AColor | 
		
	
		
			
				|  |  |  |  |                             : cProvider.disbaleChatForThisUser | 
		
	
		
			
				|  |  |  |  |                                 ? MyColors.lightGreyE3Color | 
		
	
		
			
				|  |  |  |  |                                 : MyColors.grey98Color, | 
		
	
		
			
				|  |  |  |  |                   ).paddingAll(4), | 
		
	
		
			
				|  |  |  |  |                   Consumer<ChatProviderModel>( | 
		
	
		
			
				|  |  |  |  |                     builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { | 
		
	
		
			
				|  |  |  |  |                       return 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), | 
		
	
		
			
				|  |  |  |  |                         ), | 
		
	
		
			
				|  |  |  |  |                       ); | 
		
	
		
			
				|  |  |  |  |                       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), | 
		
	
		
			
				|  |  |  |  |                               ), | 
		
	
		
			
				|  |  |  |  |                             ); | 
		
	
		
			
				|  |  |  |  |                     }, | 
		
	
		
			
				|  |  |  |  |                   ), | 
		
	
		
			
				|  |  |  |  |                 ], | 
		
	
	
		
			
				
					|  |  |  | @ -668,4 +693,15 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   bool checkIfPrivilegedForChat() { | 
		
	
		
			
				|  |  |  |  |     for (PrivilegeListModel element in AppState().privilegeListModel!) { | 
		
	
		
			
				|  |  |  |  |       if (element.serviceName?.toLowerCase() == "chat") { | 
		
	
		
			
				|  |  |  |  |         if (element.previlege != null) { | 
		
	
		
			
				|  |  |  |  |           return element.previlege!; | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     return false; | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | } | 
		
	
	
		
			
				
					|  |  |  | 
 |