add favorite
This commit is contained in:
@@ -21,9 +21,9 @@ import 'package:worker/features/products/domain/entities/product.dart';
|
||||
/// Displays product information in a card format with a favorite toggle button.
|
||||
/// Used in the favorites grid view.
|
||||
class FavoriteProductCard extends ConsumerWidget {
|
||||
final Product product;
|
||||
|
||||
const FavoriteProductCard({super.key, required this.product});
|
||||
final Product product;
|
||||
|
||||
String _formatPrice(double price) {
|
||||
final formatter = NumberFormat('#,###', 'vi_VN');
|
||||
@@ -59,7 +59,7 @@ class FavoriteProductCard extends ConsumerWidget {
|
||||
if (confirmed == true && context.mounted) {
|
||||
// Remove from favorites
|
||||
await ref
|
||||
.read(favoritesProvider.notifier)
|
||||
.read(favoriteProductsProvider.notifier)
|
||||
.removeFavorite(product.productId);
|
||||
|
||||
// Show snackbar
|
||||
@@ -94,7 +94,7 @@ class FavoriteProductCard extends ConsumerWidget {
|
||||
top: Radius.circular(ProductCardSpecs.borderRadius),
|
||||
),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: product.imageUrl,
|
||||
imageUrl: product.thumbnail,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
fit: BoxFit.cover,
|
||||
|
||||
Reference in New Issue
Block a user