|
|
|
|
@ -416,7 +416,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
await hubConnection.invoke("AddChatUserAsync", args: <Object>[json.decode(chatData)]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void sendChatMessage(int targetUserId, String targetUserName) async {
|
|
|
|
|
void sendChatMessage(int targetUserId, String targetUserName, BuildContext context) async {
|
|
|
|
|
dynamic contain = searchedChats!.where((ChatUser element) => element.id == targetUserId);
|
|
|
|
|
if (contain.isEmpty) {
|
|
|
|
|
searchedChats!.add(
|
|
|
|
|
@ -435,9 +435,11 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
sendChatToServer(chatEventId: 1, fileTypeId: null, targetUserId: targetUserId, targetUserName: targetUserName, isAttachment: false, chatReplyId: null, isReply: false);
|
|
|
|
|
}
|
|
|
|
|
if (isFileSelected && !isMsgReply) {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
logger.d("Normal Attachment Message");
|
|
|
|
|
dynamic value = await uploadAttachments(AppState().chatDetails!.response!.id.toString(), selectedFile);
|
|
|
|
|
String? ext = getFileExtension(selectedFile.path);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
sendChatToServer(chatEventId: 2, fileTypeId: getFileType(ext.toString()), targetUserId: targetUserId, targetUserName: targetUserName, isAttachment: true, chatReplyId: null, isReply: false);
|
|
|
|
|
}
|
|
|
|
|
if (!isFileSelected && isMsgReply) {
|
|
|
|
|
|