chatwootConversationDaoProvider top-level property

ProviderFamily<ChatwootConversationDao, ChatwootParameters> chatwootConversationDaoProvider
final

Provides an instance of chatwoot user dao

Creates an in memory storage if persistence isn't enabled in params else hive boxes are create to store chatwoot client's conversation

Implementation

final chatwootConversationDaoProvider =
    Provider.family<ChatwootConversationDao, ChatwootParameters>((ref, params) {
  if (!params.isPersistenceEnabled) {
    return NonPersistedChatwootConversationDao();
  }
  final conversationBox = ref.read(conversationBoxProvider);
  final clientInstanceToConversationBox =
      ref.read(clientInstanceToConversationBoxProvider);
  return PersistedChatwootConversationDao(conversationBox,
      clientInstanceToConversationBox, params.clientInstanceKey);
});