getMessagesOfJid static method

Future<String?> getMessagesOfJid({
  1. required String jid,
})

Provides a method to fetch messages for a specific JID.

This static method is used to retrieve messages associated with the provided JID.

Throws an exception if jid is null.

Returns a Future that resolves to a String representing the messages for the specified JID.

Example usage:

Mirrorfly.getMessagesOfJid(profile.jid.checkNull()).then((value) {
  print('Messages: value');
   List<ChatMessageModel> chatMessageModel = chatMessageModelFromJson(value);
}).catchError((e) {
  print('Failed to fetch messages: $e');
});

Implementation

static Future<String?> getMessagesOfJid({required String jid}) {
  return FlyChatFlutterPlatform.instance.getMessagesOfJid(jid);
}