| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -12,17 +12,13 @@ import 'package:mohem_flutter_app/classes/utils.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/exceptions/api_exception.dart';
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/exceptions/api_exception.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/main.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/chat_user_image_model.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/create_group_request.dart'
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/create_group_request.dart' as createGroup;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    as createGroup;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_group_chat_history.dart';
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_group_chat_history.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_search_user_chat_model.dart';
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_search_user_chat_model.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_user_groups_by_id.dart'
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_user_groups_by_id.dart' as groups;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    as groups;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_user_groups_by_id.dart';
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_user_groups_by_id.dart';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart'
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart' as user;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    as user;
 | 
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/make_user_favotire_unfavorite_chat_model.dart' as fav;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import 'package:mohem_flutter_app/models/chat/make_user_favotire_unfavorite_chat_model.dart'
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    as fav;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					class ChatApiClient {
 | 
					 | 
					 | 
					 | 
					class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  static final ChatApiClient _instance = ChatApiClient._internal();
 | 
					 | 
					 | 
					 | 
					  static final ChatApiClient _instance = ChatApiClient._internal();
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -36,13 +32,11 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      "${ApiConsts.chatLoginTokenUrl}externaluserlogin",
 | 
					 | 
					 | 
					 | 
					      "${ApiConsts.chatLoginTokenUrl}externaluserlogin",
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      {
 | 
					 | 
					 | 
					 | 
					      {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "employeeNumber":
 | 
					 | 
					 | 
					 | 
					        "employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(),
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            AppState().memberInformationList!.eMPLOYEENUMBER.toString(),
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG",
 | 
					 | 
					 | 
					 | 
					        "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG",
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "isMobile": true,
 | 
					 | 
					 | 
					 | 
					        "isMobile": true,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "deviceToken": AppState().getIsHuawei
 | 
					 | 
					 | 
					 | 
					        "platform": Platform.isIOS ? "ios" : "android",
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            ? AppState().getHuaweiPushToken
 | 
					 | 
					 | 
					 | 
					        "deviceToken": AppState().getIsHuawei ? AppState().getHuaweiPushToken : AppState().getDeviceToken,
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            : AppState().getDeviceToken,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "isHuaweiDevice": AppState().getIsHuawei,
 | 
					 | 
					 | 
					 | 
					        "isHuaweiDevice": AppState().getIsHuawei,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      },
 | 
					 | 
					 | 
					 | 
					      },
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    );
 | 
					 | 
					 | 
					 | 
					    );
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -52,10 +46,7 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (response.statusCode == 200) {
 | 
					 | 
					 | 
					 | 
					    if (response.statusCode == 200) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      userLoginResponse = user.userAutoLoginModelFromJson(response.body);
 | 
					 | 
					 | 
					 | 
					      userLoginResponse = user.userAutoLoginModelFromJson(response.body);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } else if (response.statusCode == 501 ||
 | 
					 | 
					 | 
					 | 
					    } else if (response.statusCode == 501 || response.statusCode == 502 || response.statusCode == 503 || response.statusCode == 504) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        response.statusCode == 502 ||
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        response.statusCode == 503 ||
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        response.statusCode == 504) {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      getUserLoginToken();
 | 
					 | 
					 | 
					 | 
					      getUserLoginToken();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } else {
 | 
					 | 
					 | 
					 | 
					    } else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      userLoginResponse = user.userAutoLoginModelFromJson(response.body);
 | 
					 | 
					 | 
					 | 
					      userLoginResponse = user.userAutoLoginModelFromJson(response.body);
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -64,16 +55,9 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return userLoginResponse;
 | 
					 | 
					 | 
					 | 
					    return userLoginResponse;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  Future<ChatUserModel> getChatMemberFromSearch(
 | 
					 | 
					 | 
					 | 
					  Future<ChatUserModel> getChatMemberFromSearch(String searchParam, int cUserId, int pageNo) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      String searchParam, int cUserId, int pageNo) async {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    ChatUserModel chatUserModel;
 | 
					 | 
					 | 
					 | 
					    ChatUserModel chatUserModel;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse("${ApiConsts.chatLoginTokenUrl}getUserWithStatusAndFavAsync", {"employeeNumber": cUserId, "userName": searchParam, "pageNumber": pageNo},
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "${ApiConsts.chatLoginTokenUrl}getUserWithStatusAndFavAsync",
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          "employeeNumber": cUserId,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          "userName": searchParam,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          "pageNumber": pageNo
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        },
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        token: AppState().chatDetails!.response!.token);
 | 
					 | 
					 | 
					 | 
					        token: AppState().chatDetails!.response!.token);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!kReleaseMode) {
 | 
					 | 
					 | 
					 | 
					    if (!kReleaseMode) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      logger.i("res: " + response.body);
 | 
					 | 
					 | 
					 | 
					      logger.i("res: " + response.body);
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -113,12 +97,7 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  //Get User Chat History
 | 
					 | 
					 | 
					 | 
					  //Get User Chat History
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  Future<Response> getSingleUserChatHistory(
 | 
					 | 
					 | 
					 | 
					  Future<Response> getSingleUserChatHistory({required int senderUID, required int receiverUID, required bool loadMore, bool isNewChat = false, required int paginationVal}) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      {required int senderUID,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      required int receiverUID,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      required bool loadMore,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      bool isNewChat = false,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      required int paginationVal}) async {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    try {
 | 
					 | 
					 | 
					 | 
					    try {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      Response response = await ApiClient().getJsonForResponse(
 | 
					 | 
					 | 
					 | 
					      Response response = await ApiClient().getJsonForResponse(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "${ApiConsts.chatSingleUserHistoryUrl}GetUserChatHistory/$senderUID/$receiverUID/$paginationVal",
 | 
					 | 
					 | 
					 | 
					        "${ApiConsts.chatSingleUserHistoryUrl}GetUserChatHistory/$senderUID/$receiverUID/$paginationVal",
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -129,33 +108,23 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      }
 | 
					 | 
					 | 
					 | 
					      }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      return response;
 | 
					 | 
					 | 
					 | 
					      return response;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } catch (e) {
 | 
					 | 
					 | 
					 | 
					    } catch (e) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      getSingleUserChatHistory(
 | 
					 | 
					 | 
					 | 
					      getSingleUserChatHistory(senderUID: senderUID, receiverUID: receiverUID, loadMore: loadMore, paginationVal: paginationVal);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          senderUID: senderUID,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          receiverUID: receiverUID,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          loadMore: loadMore,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          paginationVal: paginationVal);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      throw e;
 | 
					 | 
					 | 
					 | 
					      throw e;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					//Favorite Users
 | 
					 | 
					 | 
					 | 
					//Favorite Users
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  Future<fav.FavoriteChatUser> favUser(
 | 
					 | 
					 | 
					 | 
					  Future<fav.FavoriteChatUser> favUser({required int userID, required int targetUserID}) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      {required int userID, required int targetUserID}) async {
 | 
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse("${ApiConsts.chatFavUser}addFavUser", {"targetUserId": targetUserID, "userId": userID}, token: AppState().chatDetails!.response!.token);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "${ApiConsts.chatFavUser}addFavUser",
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {"targetUserId": targetUserID, "userId": userID},
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        token: AppState().chatDetails!.response!.token);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!kReleaseMode) {
 | 
					 | 
					 | 
					 | 
					    if (!kReleaseMode) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      logger.i("res: " + response.body);
 | 
					 | 
					 | 
					 | 
					      logger.i("res: " + response.body);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fav.FavoriteChatUser favoriteChatUser =
 | 
					 | 
					 | 
					 | 
					    fav.FavoriteChatUser favoriteChatUser = fav.FavoriteChatUser.fromRawJson(response.body);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        fav.FavoriteChatUser.fromRawJson(response.body);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return favoriteChatUser;
 | 
					 | 
					 | 
					 | 
					    return favoriteChatUser;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  //UnFavorite Users
 | 
					 | 
					 | 
					 | 
					  //UnFavorite Users
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  Future<fav.FavoriteChatUser> unFavUser(
 | 
					 | 
					 | 
					 | 
					  Future<fav.FavoriteChatUser> unFavUser({required int userID, required int targetUserID}) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      {required int userID, required int targetUserID}) async {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    try {
 | 
					 | 
					 | 
					 | 
					    try {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					      Response response = await ApiClient().postJsonForResponse(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        "${ApiConsts.chatFavUser}deleteFavUser",
 | 
					 | 
					 | 
					 | 
					        "${ApiConsts.chatFavUser}deleteFavUser",
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -165,8 +134,7 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if (!kReleaseMode) {
 | 
					 | 
					 | 
					 | 
					      if (!kReleaseMode) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        logger.i("res: " + response.body);
 | 
					 | 
					 | 
					 | 
					        logger.i("res: " + response.body);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      }
 | 
					 | 
					 | 
					 | 
					      }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      fav.FavoriteChatUser favoriteChatUser =
 | 
					 | 
					 | 
					 | 
					      fav.FavoriteChatUser favoriteChatUser = fav.FavoriteChatUser.fromRawJson(response.body);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          fav.FavoriteChatUser.fromRawJson(response.body);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      return favoriteChatUser;
 | 
					 | 
					 | 
					 | 
					      return favoriteChatUser;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } catch (e) {
 | 
					 | 
					 | 
					 | 
					    } catch (e) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      e as APIException;
 | 
					 | 
					 | 
					 | 
					      e as APIException;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -181,12 +149,10 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      print(AppState().chatDetails!.response!.token);
 | 
					 | 
					 | 
					 | 
					      print(AppState().chatDetails!.response!.token);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    dynamic request = MultipartRequest(
 | 
					 | 
					 | 
					 | 
					    dynamic request = MultipartRequest('POST', Uri.parse('${ApiConsts.chatMediaImageUploadUrl}upload'));
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        'POST', Uri.parse('${ApiConsts.chatMediaImageUploadUrl}upload'));
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    request.fields.addAll({'userId': userId, 'fileSource': '1'});
 | 
					 | 
					 | 
					 | 
					    request.fields.addAll({'userId': userId, 'fileSource': '1'});
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    request.files.add(await MultipartFile.fromPath('files', file.path));
 | 
					 | 
					 | 
					 | 
					    request.files.add(await MultipartFile.fromPath('files', file.path));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    request.headers.addAll(
 | 
					 | 
					 | 
					 | 
					    request.headers.addAll({'Authorization': 'Bearer ${AppState().chatDetails!.response!.token}'});
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {'Authorization': 'Bearer ${AppState().chatDetails!.response!.token}'});
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    StreamedResponse response = await request.send();
 | 
					 | 
					 | 
					 | 
					    StreamedResponse response = await request.send();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    String data = await response.stream.bytesToString();
 | 
					 | 
					 | 
					 | 
					    String data = await response.stream.bytesToString();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!kReleaseMode) {
 | 
					 | 
					 | 
					 | 
					    if (!kReleaseMode) {
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -196,8 +162,7 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // Download File For Chat
 | 
					 | 
					 | 
					 | 
					  // Download File For Chat
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  Future<Uint8List> downloadURL(
 | 
					 | 
					 | 
					 | 
					  Future<Uint8List> downloadURL({required String fileName, required String fileTypeDescription}) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      {required String fileName, required String fileTypeDescription}) async {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      "${ApiConsts.chatMediaImageUploadUrl}download",
 | 
					 | 
					 | 
					 | 
					      "${ApiConsts.chatMediaImageUploadUrl}download",
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      {"fileType": fileTypeDescription, "fileName": fileName, "fileSource": 1},
 | 
					 | 
					 | 
					 | 
					      {"fileType": fileTypeDescription, "fileName": fileName, "fileSource": 1},
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -208,8 +173,7 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  //Get Chat Users & Favorite Images
 | 
					 | 
					 | 
					 | 
					  //Get Chat Users & Favorite Images
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  Future<List<ChatUserImageModel>> getUsersImages(
 | 
					 | 
					 | 
					 | 
					  Future<List<ChatUserImageModel>> getUsersImages({required List<String> encryptedEmails}) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      {required List<String> encryptedEmails}) async {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    List<ChatUserImageModel> imagesData = [];
 | 
					 | 
					 | 
					 | 
					    List<ChatUserImageModel> imagesData = [];
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					    Response response = await ApiClient().postJsonForResponse(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      "${ApiConsts.chatUserImages}images",
 | 
					 | 
					 | 
					 | 
					      "${ApiConsts.chatUserImages}images",
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -252,7 +216,7 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    try {
 | 
					 | 
					 | 
					 | 
					    try {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					      Response response = await ApiClient().postJsonForResponse(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        ApiConsts.deleteGroup,
 | 
					 | 
					 | 
					 | 
					        ApiConsts.deleteGroup,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {"groupId":groupId},
 | 
					 | 
					 | 
					 | 
					        {"groupId": groupId},
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        token: AppState().chatDetails!.response!.token,
 | 
					 | 
					 | 
					 | 
					        token: AppState().chatDetails!.response!.token,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      );
 | 
					 | 
					 | 
					 | 
					      );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if (!kReleaseMode) {
 | 
					 | 
					 | 
					 | 
					      if (!kReleaseMode) {
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -266,8 +230,7 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  Future<Response> updateGroupAdmin(
 | 
					 | 
					 | 
					 | 
					  Future<Response> updateGroupAdmin(int? groupId, List<GroupUserList> groupList) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      int? groupId, List<GroupUserList> groupList) async {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    try {
 | 
					 | 
					 | 
					 | 
					    try {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					      Response response = await ApiClient().postJsonForResponse(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        ApiConsts.updateGroupAdmin,
 | 
					 | 
					 | 
					 | 
					        ApiConsts.updateGroupAdmin,
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -285,16 +248,11 @@ class ChatApiClient {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  Future<List<GetGroupChatHistoryAsync>> getGroupChatHistory(
 | 
					 | 
					 | 
					 | 
					  Future<List<GetGroupChatHistoryAsync>> getGroupChatHistory(int? groupId, List<GroupUserList> groupList) async {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      int? groupId, List<GroupUserList> groupList) async {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    try {
 | 
					 | 
					 | 
					 | 
					    try {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      Response response = await ApiClient().postJsonForResponse(
 | 
					 | 
					 | 
					 | 
					      Response response = await ApiClient().postJsonForResponse(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        ApiConsts.getGroupChatHistoryAsync,
 | 
					 | 
					 | 
					 | 
					        ApiConsts.getGroupChatHistoryAsync,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {"groupId": groupId, "targetUserList": groupList, "CurrentId": AppState().chatDetails!.response!.id},
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          "groupId": groupId,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          "targetUserList": groupList,
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          "CurrentId": AppState().chatDetails!.response!.id
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        },
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        token: AppState().chatDetails!.response!.token,
 | 
					 | 
					 | 
					 | 
					        token: AppState().chatDetails!.response!.token,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      );
 | 
					 | 
					 | 
					 | 
					      );
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if (!kReleaseMode) {
 | 
					 | 
					 | 
					 | 
					      if (!kReleaseMode) {
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |