dooConversationDaoProvider top-level property

ProviderFamily<DOOConversationDao, DOOParameters> dooConversationDaoProvider
final

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 conversation

Implementation

final dooConversationDaoProvider =
    Provider.family<DOOConversationDao, DOOParameters>((ref, params) {
  if (!params.isPersistenceEnabled) {
    return NonPersistedDOOConversationDao();
  }
  final conversationBox = ref.read(conversationBoxProvider);
  final clientInstanceToConversationBox =
      ref.read(clientInstanceToConversationBoxProvider);
  return PersistedDOOConversationDao(conversationBox,
      clientInstanceToConversationBox, params.clientInstanceKey);
});