loadPinnedMessages method
Gets the pinned messages in a local conversation.
Throws A description of the exception. See ChatError.
Implementation
Future<List<ChatMessage>> loadPinnedMessages() async {
try {
Map req = _toJson();
Map result = await platform_interface.Client.instance.conversationManager
.callNativeMethod(ChatMethodKeys.pinnedMessages, req);
ChatError.hasErrorFromResult(result);
List<ChatMessage> msgList = [];
result[ChatMethodKeys.pinnedMessages]?.forEach((element) {
msgList.add(ChatMessage.fromJson(element));
});
return msgList;
} catch (e) {
rethrow;
}
}