loadAllConversations method

Future<List<ChatConversation>> loadAllConversations()

Gets all conversations from the local database.

Conversations will be first loaded from the cache. If no conversation is found, the SDK loads from the local database.

Return All the conversations from the cache or local database.

Throws A description of the exception. See ChatError.


Future<List<ChatConversation>> loadAllConversations() async {
  Map result =
      await ChatChannel.invokeMethod(ChatMethodKeys.loadAllConversations);
  try {
    List<ChatConversation> conversationList = [];
    result[ChatMethodKeys.loadAllConversations]?.forEach((element) {
    return conversationList;
  } on ChatError catch (e) {
    throw e;