|
|
|
@ -380,10 +380,11 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
Future<void> sendChatToServer(
|
|
|
|
Future<void> 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();
|
|
|
|
Uuid uuid = const Uuid();
|
|
|
|
|
|
|
|
String msg = message.text;
|
|
|
|
SingleUserChatModel data = SingleUserChatModel(
|
|
|
|
SingleUserChatModel data = SingleUserChatModel(
|
|
|
|
chatEventId: chatEventId,
|
|
|
|
chatEventId: chatEventId,
|
|
|
|
chatSource: 1,
|
|
|
|
chatSource: 1,
|
|
|
|
contant: message.text,
|
|
|
|
contant: msg,
|
|
|
|
contantNo: uuid.v4(),
|
|
|
|
contantNo: uuid.v4(),
|
|
|
|
conversationId: uuid.v4(),
|
|
|
|
conversationId: uuid.v4(),
|
|
|
|
createdDate: DateTime.now(),
|
|
|
|
createdDate: DateTime.now(),
|
|
|
|
@ -412,7 +413,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
|
|
|
|
|
|
|
|
String chatData =
|
|
|
|
String chatData =
|
|
|
|
'{"contant":"${message.text}","contantNo":"${uuid.v4()}","chatEventId":$chatEventId,"fileTypeId": $fileTypeId,"currentUserId":${AppState().chatDetails!.response!.id},"chatSource":1,"userChatHistoryLineRequestList":[{"isSeen":false,"isDelivered":false,"targetUserId":$targetUserId,"targetUserStatus":1}],"chatReplyId":$chatReplyId,"conversationId":"${uuid.v4()}"}';
|
|
|
|
'{"contant":"$msg","contantNo":"${uuid.v4()}","chatEventId":$chatEventId,"fileTypeId": $fileTypeId,"currentUserId":${AppState().chatDetails!.response!.id},"chatSource":1,"userChatHistoryLineRequestList":[{"isSeen":false,"isDelivered":false,"targetUserId":$targetUserId,"targetUserStatus":1}],"chatReplyId":$chatReplyId,"conversationId":"${uuid.v4()}"}';
|
|
|
|
await hubConnection.invoke("AddChatUserAsync", args: <Object>[json.decode(chatData)]);
|
|
|
|
await hubConnection.invoke("AddChatUserAsync", args: <Object>[json.decode(chatData)]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -452,9 +453,10 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isFileSelected && isMsgReply) {
|
|
|
|
if (isFileSelected && isMsgReply) {
|
|
|
|
logger.d("Attachment Message With Reply");
|
|
|
|
logger.d("Attachment Message With Reply");
|
|
|
|
logger.d(repliedMsg.first.userChatHistoryId);
|
|
|
|
Utils.showLoading(context);
|
|
|
|
dynamic value = await uploadAttachments(AppState().chatDetails!.response!.id.toString(), selectedFile);
|
|
|
|
dynamic value = await uploadAttachments(AppState().chatDetails!.response!.id.toString(), selectedFile);
|
|
|
|
String? ext = getFileExtension(selectedFile.path);
|
|
|
|
String? ext = getFileExtension(selectedFile.path);
|
|
|
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
sendChatToServer(
|
|
|
|
sendChatToServer(
|
|
|
|
chatEventId: 2,
|
|
|
|
chatEventId: 2,
|
|
|
|
fileTypeId: getFileType(ext.toString()),
|
|
|
|
fileTypeId: getFileType(ext.toString()),
|
|
|
|
|