getMessages method
Fetches persisted messages.
Calls ChatwootCallbacks.onMessagesRetrieved when ChatwootClientService.getAllMessages is successful Calls ChatwootCallbacks.onError when ChatwootClientService.getAllMessages fails
Implementation
@override
Future<void> getMessages() async {
try {
final messages = await clientService.getAllMessages();
await localStorage.messagesDao.saveAllMessages(messages);
callbacks.onMessagesRetrieved?.call(messages);
} on ChatwootClientException catch (e) {
callbacks.onError?.call(e);
}
}