getConversationsFromServer method

  1. @Deprecated('Use [fetchConversationsByOptions] instead')
Future<List<ChatConversation>> getConversationsFromServer()

Gets the conversation list from the server.

Return The conversation list of the current user.

Throws A description of the exception. See ChatError.

Implementation

@Deprecated('Use [fetchConversationsByOptions] instead')

///
/// Gets the conversation list from the server.
///
/// **Return** The conversation list of the current user.
///
/// **Throws** A description of the exception. See [ChatError].
///
///
///
Future<List<ChatConversation>> getConversationsFromServer() async {
  try {
    Map result = await platform_interface.Client.instance.chatManager
        .callNativeMethod(ChatMethodKeys.getConversationsFromServer);
    ChatError.hasErrorFromResult(result);
    List<ChatConversation> conversationList = [];
    result[ChatMethodKeys.getConversationsFromServer]?.forEach((element) {
      conversationList.add(ChatConversation.fromJson(element));
    });
    return conversationList;
  } catch (e) {
    rethrow;
  }
}