resendItem method
- ChatItem item
Resends the specified ChatItem.
Implementation
Future<void> resendItem(ChatItem item) async {
if (item.status.value == SendingStatus.error) {
await _chatService
.resendChatItem(item)
.then(
(_) => AudioUtils.once(AudioSource.asset('audio/message_sent.mp3')),
)
.onError<PostChatMessageException>(
(_, __) => _showBlockedPopup(),
test: (e) => e.code == PostChatMessageErrorCode.blocked,
)
.onError<UploadAttachmentException>((e, _) => MessagePopup.error(e))
.onError<ConnectionException>((_, __) {});
}
}