blockConversation method

Future<void> blockConversation(
  1. String id
)

Implementation

Future<void> blockConversation(String id) async {
  _loadingService.show();
  try {
    final response = await _conversationRepository
        .blockConversation(BlockAndUnblockContactRequest(contactUid: id));
    if (response.status == 'success') {
      getSingleConversation(currentConversationId.value);
      _loadingService.showSuccess('conversation blocked');

      update();
    }
  } catch (e) {
    if (e is DioError) {
      _loadingService.showError(
        'unable to block conversation...',
      );
    } else {
      _loadingService.showError(
        'unable to block conversation...',
      );
      //log(e.toString());
    }
  }
}