loadLocalMessages method

Future<List<Message>> loadLocalMessages({
  1. required String conversationId,
  2. required ConversationType type,
  3. SearchDirection direction = SearchDirection.Up,
  4. String? startId,
  5. int count = 30,
})

Implementation

Future<List<Message>> loadLocalMessages({
  required String conversationId,
  required ConversationType type,
  SearchDirection direction = SearchDirection.Up,
  String? startId,
  int count = 30,
}) {
  return checkResult(ChatSDKEvent.getMessages, () async {
    final conversation = await createConversation(
      conversationId: conversationId,
      type: type,
    );
    return conversation.loadMessages(
      startMsgId: startId ?? '',
      loadCount: count,
      direction: direction,
    );
  });
}