diff --git a/lib/api/chat/chat_provider_model.dart b/lib/api/chat/chat_provider_model.dart index b826753..a4ea408 100644 --- a/lib/api/chat/chat_provider_model.dart +++ b/lib/api/chat/chat_provider_model.dart @@ -148,7 +148,9 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { ({String? connectionId}) {}, ); if (hubConnection.state != HubConnectionState.Connected) { - print("================= Connection Established =========================="); + if (kDebugMode) { + print("================= Connection Established =========================="); + } await hubConnection.start(); hubConnection.on("OnUpdateUserStatusAsync", changeStatus); hubConnection.on("OnDeliveredChatUserAsync", onMsgReceived); @@ -176,7 +178,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } void userCountAsync(List? args) { - List items = args!.toList(); + dynamic items = args!.toList(); //logger.d("---------------------------------User Count Async -------------------------------------"); //logger.d(items); // for (var user in searchedChats!) { @@ -188,8 +190,10 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } void updateChatHistoryWindow(List? args) { - List items = args!.toList(); - print("---------------------------------Update Chat History Windows Async -------------------------------------"); + dynamic items = args!.toList(); + if (kDebugMode) { + print("---------------------------------Update Chat History Windows Async -------------------------------------"); + } logger.d(items); // for (var user in searchedChats!) { // if (user.id == items.first["id"]) { @@ -200,21 +204,25 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } void chatNotDelivered(List? args) { - List items = args!.toList(); - print("--------------------------------- Chat Not Delivered Windows Async -------------------------------------"); + dynamic items = args!.toList(); + if (kDebugMode) { + print("--------------------------------- Chat Not Delivered Windows Async -------------------------------------"); + } logger.d(items); // for (var user in searchedChats!) { // if (user.id == items.first["id"]) { // user.userStatus = items.first["userStatus"]; // } // } - // notifyListeners(); + // notifyListeners();2 } void changeStatus(List? args) { - // print("================= Status Online // Offline ===================="); - List items = args!.toList(); - // logger.d(items); + if (kDebugMode) { + print("================= Status Online // Offline ===================="); + } + dynamic items = args!.toList(); + logger.d(items); for (ChatUser user in searchedChats!) { if (user.id == items.first["id"]) { user.userStatus = items.first["userStatus"]; @@ -348,7 +356,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { // } Future sendChatToServer( - {required int chatEventId, required fileTypeId, required int targetUserId, required String targetUserName, required chatReplyId, required bool isAttachment, required bool isReply}) async { + {required int chatEventId, required fileTypeId, required int targetUserId, required String targetUserName, required chatReplyId, required bool isAttachment, required bool isReply}) async { Uuid uuid = const Uuid(); SingleUserChatModel data = SingleUserChatModel( chatEventId: chatEventId,