dooUserDaoProvider top-level property

ProviderFamily<DOOUserDao, DOOParameters> dooUserDaoProvider
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 user info

Implementation

final dooUserDaoProvider =
    Provider.family<DOOUserDao, DOOParameters>((ref, params) {
  if (!params.isPersistenceEnabled) {
    return NonPersistedDOOUserDao();
  }
  final userBox = ref.read(userBoxProvider);
  final clientInstanceToUserBoxBox = ref.read(clientInstanceToUserBoxProvider);
  return PersistedDOOUserDao(
      userBox, clientInstanceToUserBoxBox, params.clientInstanceKey);
});