|  |  |  | @ -16,6 +16,7 @@ import 'package:mohem_flutter_app/app_state/app_state.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/classes/consts.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/classes/encryption.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/classes/utils.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/config/routes.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/main.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/chat/chat_user_image_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/chat/get_search_user_chat_model.dart'; | 
		
	
	
		
			
				
					|  |  |  | @ -23,6 +24,7 @@ import 'package:mohem_flutter_app/models/chat/get_single_user_chat_list_model.da | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart' as userLoginToken; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/chat/make_user_favotire_unfavorite_chat_model.dart' as fav; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/ui/chat/chat_detailed_screen.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/widgets/image_picker.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:open_file/open_file.dart'; | 
		
	
	
		
			
				
					|  |  |  | @ -125,9 +127,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { | 
		
	
		
			
				|  |  |  |  |     ChatUserModel favUList = await ChatApiClient().getFavUsers(); | 
		
	
		
			
				|  |  |  |  |     if (favUList.response != null && recentChat.response != null) { | 
		
	
		
			
				|  |  |  |  |       favUsersList = favUList.response!; | 
		
	
		
			
				|  |  |  |  |       favUsersList.sort( | 
		
	
		
			
				|  |  |  |  |         (ChatUser a, ChatUser b) => a.userName!.toLowerCase().compareTo(b.userName!.toLowerCase()), | 
		
	
		
			
				|  |  |  |  |       ); | 
		
	
		
			
				|  |  |  |  |       favUsersList.sort((ChatUser a, ChatUser b) => a.userName!.toLowerCase().compareTo(b.userName!.toLowerCase())); | 
		
	
		
			
				|  |  |  |  |       for (dynamic user in recentChat.response!) { | 
		
	
		
			
				|  |  |  |  |         for (dynamic favUser in favUList.response!) { | 
		
	
		
			
				|  |  |  |  |           if (user.id == favUser.id) { | 
		
	
	
		
			
				
					|  |  |  | @ -319,12 +319,10 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { | 
		
	
		
			
				|  |  |  |  |         user.userStatus = items.first["userStatus"]; | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     if (teamMembersList != null) { | 
		
	
		
			
				|  |  |  |  |       if (teamMembersList.isNotEmpty) { | 
		
	
		
			
				|  |  |  |  |         for (ChatUser user in teamMembersList!) { | 
		
	
		
			
				|  |  |  |  |           if (user.id == items.first["id"]) { | 
		
	
		
			
				|  |  |  |  |             user.userStatus = items.first["userStatus"]; | 
		
	
		
			
				|  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |     if (teamMembersList.isNotEmpty) { | 
		
	
		
			
				|  |  |  |  |       for (ChatUser user in teamMembersList!) { | 
		
	
		
			
				|  |  |  |  |         if (user.id == items.first["id"]) { | 
		
	
		
			
				|  |  |  |  |           user.userStatus = items.first["userStatus"]; | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
	
		
			
				
					|  |  |  | @ -1453,24 +1451,19 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   void openChatByNoti(BuildContext context) async { | 
		
	
		
			
				|  |  |  |  |     print(AppState().getNotificationData!.messageId); | 
		
	
		
			
				|  |  |  |  |     logger.d(AppState().getNotificationData!.toMap()); | 
		
	
		
			
				|  |  |  |  |     if (AppState().getNotificationData!.data != null) { | 
		
	
		
			
				|  |  |  |  |       logger.d(AppState().getNotificationData!.data["user_chat_history_response"]); | 
		
	
		
			
				|  |  |  |  |       logger.w("-----------------------This is the Read Data------------------------------------"); | 
		
	
		
			
				|  |  |  |  | var tempData = jsonDecode(AppState().getNotificationData!.data["user_chat_history_response"]); | 
		
	
		
			
				|  |  |  |  |       // List<SingleUserChatModel> Temp = singleUserChatModelFromJson(); | 
		
	
		
			
				|  |  |  |  |       // print(Temp.first.contant); | 
		
	
		
			
				|  |  |  |  |       AppState().setIsAppOpendByChat = false; | 
		
	
		
			
				|  |  |  |  |       AppState().setNotificationData = null; | 
		
	
		
			
				|  |  |  |  |       // Navigator.pushNamed( | 
		
	
		
			
				|  |  |  |  |       //   context, | 
		
	
		
			
				|  |  |  |  |       //   AppRoutes.chatDetailed, | 
		
	
		
			
				|  |  |  |  |       //   arguments: ChatDetailedScreenParams(m.searchedChats![index], false), | 
		
	
		
			
				|  |  |  |  |       // ).then((Object? value) { | 
		
	
		
			
				|  |  |  |  |       //   clearSelections(); | 
		
	
		
			
				|  |  |  |  |       //   notifyListeners(); | 
		
	
		
			
				|  |  |  |  |       // }); | 
		
	
		
			
				|  |  |  |  |     SingleUserChatModel nUser = SingleUserChatModel.fromJson( | 
		
	
		
			
				|  |  |  |  |       jsonDecode(await Utils.getStringFromPrefs("notificationData")), | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |     Utils.saveStringFromPrefs("isAppOpendByChat", "false"); | 
		
	
		
			
				|  |  |  |  |     Utils.saveStringFromPrefs("notificationData", "null"); | 
		
	
		
			
				|  |  |  |  |     Future.delayed(const Duration(seconds: 1)); | 
		
	
		
			
				|  |  |  |  |     for (ChatUser user in searchedChats!) { | 
		
	
		
			
				|  |  |  |  |       if (user.id == nUser.targetUserId) { | 
		
	
		
			
				|  |  |  |  |         Navigator.pushNamed(context, AppRoutes.chatDetailed, arguments: ChatDetailedScreenParams(user, false)); | 
		
	
		
			
				|  |  |  |  |         return; | 
		
	
		
			
				|  |  |  |  |       } else { | 
		
	
		
			
				|  |  |  |  |         openChatByNoti(context); | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | } | 
		
	
	
		
			
				
					|  |  |  | 
 |