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