asdasdasd
This commit is contained in:
@@ -5,6 +5,7 @@ import '../../features/auth/data/repositories/auth_repository_impl.dart';
|
||||
import '../../features/auth/domain/repositories/auth_repository.dart';
|
||||
import '../../features/auth/domain/usecases/login_usecase.dart';
|
||||
import '../../features/auth/presentation/providers/auth_provider.dart';
|
||||
import '../../features/products/data/datasources/products_local_datasource.dart';
|
||||
import '../../features/products/data/datasources/products_remote_datasource.dart';
|
||||
import '../../features/products/data/repositories/products_repository_impl.dart';
|
||||
import '../../features/products/domain/entities/product_stage_entity.dart';
|
||||
@@ -256,6 +257,12 @@ final warehouseErrorProvider = Provider<String?>((ref) {
|
||||
|
||||
// Data Layer
|
||||
|
||||
/// Products local data source provider
|
||||
/// Handles local storage operations for products using Hive
|
||||
final productsLocalDataSourceProvider = Provider<ProductsLocalDataSource>((ref) {
|
||||
return ProductsLocalDataSourceImpl();
|
||||
});
|
||||
|
||||
/// Products remote data source provider
|
||||
/// Handles API calls for products
|
||||
final productsRemoteDataSourceProvider =
|
||||
@@ -266,9 +273,14 @@ final productsRemoteDataSourceProvider =
|
||||
|
||||
/// Products repository provider
|
||||
/// Implements domain repository interface
|
||||
/// Coordinates between local and remote data sources
|
||||
final productsRepositoryProvider = Provider<ProductsRepository>((ref) {
|
||||
final remoteDataSource = ref.watch(productsRemoteDataSourceProvider);
|
||||
return ProductsRepositoryImpl(remoteDataSource);
|
||||
final localDataSource = ref.watch(productsLocalDataSourceProvider);
|
||||
return ProductsRepositoryImpl(
|
||||
remoteDataSource: remoteDataSource,
|
||||
localDataSource: localDataSource,
|
||||
);
|
||||
});
|
||||
|
||||
// Domain Layer
|
||||
|
||||
Reference in New Issue
Block a user