sendFileMessage method
Implementation
Future<void> sendFileMessage(
{required String id,
required String message,
required String channelName,
required String messageType}) async {
final request = SendMessageRequest(
messageType: messageType,
message: message,
conversationId: id,
);
final response = channelName.toLowerCase() == 'twitter'
? await _conversationRepository.sendTwitterMessage(request)
: channelName.toLowerCase() == 'facebook'
? await _conversationRepository.sendFacebookMessage(request)
: channelName.toLowerCase() == 'instagram'
? await _conversationRepository.sendInstagramMessage(request)
: const ConversationModel();
textMessageController.clear();
if (response.status == 'success') {
_conversationsService.conversation.value = response;
await getSingleConversation(
id,
);
getAllConversations();
} else {
_loadingService.showError(
'unable to send message...',
);
getAllConversations();
}
}