repository<D extends EntityModel, R extends EntitySearchModel> method

DataRepository<D, R> repository<D extends EntityModel, R extends EntitySearchModel>(
  1. BuildContext context
)

Implementation

DataRepository<D, R>
    repository<D extends EntityModel, R extends EntitySearchModel>(
  BuildContext context,
) {
  switch (ClosedHouseholdSingleton().persistenceConfiguration) {
    case PersistenceConfiguration.offlineFirst:
      return context.read<LocalRepository<D, R>>();
    case PersistenceConfiguration.onlineOnly:
      return context.read<RemoteRepository<D, R>>();
    default:
      return context.read<RemoteRepository<D, R>>();
  }
}