dooMessagesDaoProvider top-level property
Provides an instance of DOO user dao
Creates an in memory storage if persistence isn't enabled in params else hive boxes are create to store DOO client's messages
Implementation
final dooMessagesDaoProvider =
Provider.family<DOOMessagesDao, DOOParameters>((ref, params) {
if (!params.isPersistenceEnabled) {
return NonPersistedDOOMessagesDao();
}
final messagesBox = ref.read(messagesBoxProvider);
final messageToClientInstanceBox =
ref.read(messageToClientInstanceBoxProvider);
return PersistedDOOMessagesDao(
messagesBox, messageToClientInstanceBox, params.clientInstanceKey);
});