chatwootUserDaoProvider top-level property

ProviderFamily<ChatwootUserDao, ChatwootParameters> chatwootUserDaoProvider
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 user info

Implementation

final chatwootUserDaoProvider =
    Provider.family<ChatwootUserDao, ChatwootParameters>((ref, params) {
  if (!params.isPersistenceEnabled) {
    return NonPersistedChatwootUserDao();
  }
  final userBox = ref.read(userBoxProvider);
  final clientInstanceToUserBoxBox = ref.read(clientInstanceToUserBoxProvider);
  return PersistedChatwootUserDao(
      userBox, clientInstanceToUserBoxBox, params.clientInstanceKey);
});