fetchConversationsByOptions method
- required ConversationFetchOptions options,
Gets conversations from the server by conversation filter options.
Param options The conversation filter options. See ConversationFetchOptions.
Returns The list of retrieved conversations.
Throws A description of the exception. See ChatError.
Implementation
Future<ChatCursorResult<ChatConversation>> fetchConversationsByOptions({
required ConversationFetchOptions options,
}) async {
try {
Map req = options.toJson();
Map result = await platform_interface.Client.instance.chatManager
.callNativeMethod(ChatMethodKeys.fetchConversationsByOptions, req);
ChatError.hasErrorFromResult(result);
return ChatCursorResult<ChatConversation>.fromJson(
result[ChatMethodKeys.fetchConversationsByOptions],
dataItemCallback: (value) {
return ChatConversation.fromJson(value);
});
} catch (e) {
rethrow;
}
}