searchConversationLocalMessage method

Future<List<Message>> searchConversationLocalMessage({
  1. required String keywords,
  2. required String conversationId,
  3. ConversationType type = ConversationType.Chat,
  4. int timestamp = -1,
  5. int maxCount = 20,
  6. String? sender,
  7. SearchDirection direction = SearchDirection.Up,
})

Implementation

Future<List<Message>> searchConversationLocalMessage({
  required String keywords,
  required String conversationId,
  ConversationType type = ConversationType.Chat,
  int timestamp = -1,
  int maxCount = 20,
  String? sender,
  SearchDirection direction = SearchDirection.Up,
}) {
  return checkResult(ChatSDKEvent.searchConversationLocalMessage, () async {
    final conversation = await createConversation(
      conversationId: conversationId,
      type: type,
    );
    return await conversation.loadMessagesWithKeyword(
      keywords,
      count: maxCount,
      timestamp: timestamp,
      sender: sender,
      searchScope: MessageSearchScope.Content,
      direction: direction,
    );
  });
}