This commit is contained in:
2025-10-16 17:22:27 +07:00
parent 3b1f198f2a
commit 7dc66d80fc
17 changed files with 222 additions and 217 deletions

View File

@@ -15,7 +15,7 @@ class FilteredProducts extends _$FilteredProducts {
// Watch products state
final productsAsync = ref.watch(productsProvider);
final products = productsAsync.when(
data: (data) => data.products,
data: (data) => data,
loading: () => <Product>[],
error: (_, __) => <Product>[],
);

View File

@@ -50,7 +50,7 @@ final class FilteredProductsProvider
}
}
String _$filteredProductsHash() => r'd8ca6d80a71bf354e3afe6c38335996a8bfc74b7';
String _$filteredProductsHash() => r'97fb09ade4bc65f92f3d4844b059bb2b0660d3df';
/// Filtered products provider
/// Combines products, search query, and category filter to provide filtered results

View File

@@ -5,12 +5,12 @@ import '../../../../core/providers/providers.dart';
part 'products_provider.g.dart';
/// Provider for products list with API-first approach
/// Provider for products list with online-first approach
@riverpod
class Products extends _$Products {
@override
Future<List<Product>> build() async {
// API-first: Try to load from API first
// Online-first: Try to load from API first
final repository = ref.watch(productRepositoryProvider);
final networkInfo = ref.watch(networkInfoProvider);