| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -16,6 +16,8 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/extensions/string_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/extensions/widget_extensions.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/itg/itg_main_response.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/models/offers_and_discounts/get_offers_list.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/privilege_list_model.dart';
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/privilege_list_model.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -158,39 +160,72 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    _refreshController.refreshCompleted();
 | 
					 | 
					 | 
					 | 
					    _refreshController.refreshCompleted();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  int ermIndex = 0;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  void handleErmChannel(List<ItgResponseData> list) async {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    try {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      if (ermIndex == list.length) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      Utils.showLoading(context);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      ItgMainRes? response = await DashboardApiClient().getAdvertisementDetail(list[ermIndex].notificationMasterId ?? "");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      Utils.hideLoading(context);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      if (response!.mohemmItgResponseItem!.result!.data != null) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (list[ermIndex].notificationType == "Survey") {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          await Navigator.pushNamed(context, AppRoutes.survey, arguments: response.mohemmItgResponseItem!.result!.data!.first);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          await Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            "masterId": list[ermIndex].notificationMasterId,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            "advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      ermIndex++;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      handleErmChannel(list);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    } catch (ex) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      Utils.hideLoading(context);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      Utils.handleException(ex, context, null);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  void checkERMChannel() {
 | 
					 | 
					 | 
					 | 
					  void checkERMChannel() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    data.getITGNotification().then((val) {
 | 
					 | 
					 | 
					 | 
					    data.getITGNotification().then((val) async {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if (val!.result!.data != null) {
 | 
					 | 
					 | 
					 | 
					      if (val!.result!.data != null) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        print("-------------------- Survey ----------------------------");
 | 
					 | 
					 | 
					 | 
					        ermIndex = 0;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (val.result!.data!.first.notificationType == "Survey") {
 | 
					 | 
					 | 
					 | 
					        val.result?.data?.removeWhere((element) => element.notificationType == "Announcement");
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          DashboardApiClient().getAdvertisementDetail(val.result!.data!.first.notificationMasterId ?? "").then(
 | 
					 | 
					 | 
					 | 
					        handleErmChannel(val.result?.data ?? []);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            (value) {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              if (value!.mohemmItgResponseItem!.statusCode == 200) {
 | 
					 | 
					 | 
					 | 
					          // if (ERMvalue.notificationType == "Survey") {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (value.mohemmItgResponseItem!.result!.data != null) {
 | 
					 | 
					 | 
					 | 
					          //   await DashboardApiClient().getAdvertisementDetail(val.result!.data!.first.notificationMasterId ?? "").then(
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                  // Navigator.pushNamed(context, AppRoutes.survey, arguments: val.result!.data);
 | 
					 | 
					 | 
					 | 
					          //         (value) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                  Navigator.pushNamed(context, AppRoutes.survey, arguments: value.mohemmItgResponseItem!.result!.data!.first);
 | 
					 | 
					 | 
					 | 
					          //       if (value!.mohemmItgResponseItem!.statusCode == 200) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                  // Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
 | 
					 | 
					 | 
					 | 
					          //         if (value.mohemmItgResponseItem!.result!.data != null) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                  //   "masterId": val.result!.data!.notificationMasterId,
 | 
					 | 
					 | 
					 | 
					          //           // Navigator.pushNamed(context, AppRoutes.survey, arguments: val.result!.data);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                  //   "advertisement": value.mohemmItgResponseItem!.result!.data!.advertisement,
 | 
					 | 
					 | 
					 | 
					          //           await Navigator.pushNamed(context, AppRoutes.survey, arguments: value.mohemmItgResponseItem!.result!.data!.first);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                  // });
 | 
					 | 
					 | 
					 | 
					          //           // Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                }
 | 
					 | 
					 | 
					 | 
					          //           //   "masterId": val.result!.data!.notificationMasterId,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              }
 | 
					 | 
					 | 
					 | 
					          //           //   "advertisement": value.mohemmItgResponseItem!.result!.data!.advertisement,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            },
 | 
					 | 
					 | 
					 | 
					          //           // });
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          );
 | 
					 | 
					 | 
					 | 
					          //         }
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } else {
 | 
					 | 
					 | 
					 | 
					          //       }
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          print("------------------------------------------- Ads --------------------");
 | 
					 | 
					 | 
					 | 
					          //     },
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          DashboardApiClient().getAdvertisementDetail(val.result!.data!.first.notificationMasterId ?? "").then(
 | 
					 | 
					 | 
					 | 
					          //   );
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            (value) {
 | 
					 | 
					 | 
					 | 
					          // } else {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              if (value!.mohemmItgResponseItem!.statusCode == 200) {
 | 
					 | 
					 | 
					 | 
					          //   print("------------------------------------------- Ads --------------------");
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (value.mohemmItgResponseItem!.result!.data != null) {
 | 
					 | 
					 | 
					 | 
					          //   await DashboardApiClient().getAdvertisementDetail(ERMvalue.notificationMasterId ?? "").then(
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                  Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
 | 
					 | 
					 | 
					 | 
					          //         (value) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    "masterId": val.result!.data!.first.notificationMasterId,
 | 
					 | 
					 | 
					 | 
					          //       if (value!.mohemmItgResponseItem!.statusCode == 200) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    "advertisement": value.mohemmItgResponseItem!.result!.data!.first.advertisement,
 | 
					 | 
					 | 
					 | 
					          //         if (value.mohemmItgResponseItem!.result!.data != null) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                  });
 | 
					 | 
					 | 
					 | 
					          //           await Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                }
 | 
					 | 
					 | 
					 | 
					          //             "masterId": val.result!.data!.first.notificationMasterId,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              }
 | 
					 | 
					 | 
					 | 
					          //             "advertisement": value.mohemmItgResponseItem!.result!.data!.first.advertisement,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            },
 | 
					 | 
					 | 
					 | 
					          //           });
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          );
 | 
					 | 
					 | 
					 | 
					          //         }
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          //       }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          //     },
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          //   );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          // }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      }
 | 
					 | 
					 | 
					 | 
					      }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    });
 | 
					 | 
					 | 
					 | 
					    });
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -535,7 +570,8 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                    ],
 | 
					 | 
					 | 
					 | 
					                                    ],
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                  ),
 | 
					 | 
					 | 
					 | 
					                                  ),
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                ).onPress(() {
 | 
					 | 
					 | 
					 | 
					                                ).onPress(() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                  Navigator.pushNamed(context, AppRoutes.marathonTutorialScreen);
 | 
					 | 
					 | 
					 | 
					                                  checkERMChannel();
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                                  // Navigator.pushNamed(context, AppRoutes.marathonTutorialScreen);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                }),
 | 
					 | 
					 | 
					 | 
					                                }),
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        ],
 | 
					 | 
					 | 
					 | 
					                        ],
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                      ),
 | 
					 | 
					 | 
					 | 
					                      ),
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |