getMessagesService function
Implementation
Future<List<Message>?> getMessagesService({
required String threadhash,
required int limit,
}) async {
log('getMessagesService: threadhash= $threadhash');
final path = '/v1/chat/conversationhash/$threadhash?fetchLimit=$limit';
final result = await http.get(path: path);
if (result == null) {
return null;
}
if (result is List) {
return result.map((e) => Message.fromJson(e)).toList();
}
return null;
}