add auth, format
This commit is contained in:
@@ -22,10 +22,7 @@ import 'package:worker/features/products/domain/entities/product.dart';
|
||||
class FavoriteProductCard extends ConsumerWidget {
|
||||
final Product product;
|
||||
|
||||
const FavoriteProductCard({
|
||||
super.key,
|
||||
required this.product,
|
||||
});
|
||||
const FavoriteProductCard({super.key, required this.product});
|
||||
|
||||
String _formatPrice(double price) {
|
||||
final formatter = NumberFormat('#,###', 'vi_VN');
|
||||
@@ -60,7 +57,9 @@ class FavoriteProductCard extends ConsumerWidget {
|
||||
|
||||
if (confirmed == true && context.mounted) {
|
||||
// Remove from favorites
|
||||
await ref.read(favoritesProvider.notifier).removeFavorite(product.productId);
|
||||
await ref
|
||||
.read(favoritesProvider.notifier)
|
||||
.removeFavorite(product.productId);
|
||||
|
||||
// Show snackbar
|
||||
if (context.mounted) {
|
||||
@@ -103,9 +102,7 @@ class FavoriteProductCard extends ConsumerWidget {
|
||||
placeholder: (context, url) => Shimmer.fromColors(
|
||||
baseColor: AppColors.grey100,
|
||||
highlightColor: AppColors.grey50,
|
||||
child: Container(
|
||||
color: AppColors.grey100,
|
||||
),
|
||||
child: Container(color: AppColors.grey100),
|
||||
),
|
||||
errorWidget: (context, url, error) => Container(
|
||||
color: AppColors.grey100,
|
||||
|
||||
Reference in New Issue
Block a user