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