From 2cf5ce7ae83ced09fd249f598a144772ea3c47b8 Mon Sep 17 00:00:00 2001 From: efrilm Date: Thu, 7 Aug 2025 10:56:08 +0700 Subject: [PATCH] feat: product is active --- .../home/widgets/product_card.dart | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/presentation/home/widgets/product_card.dart b/lib/presentation/home/widgets/product_card.dart index 2327a34..c3239e2 100644 --- a/lib/presentation/home/widgets/product_card.dart +++ b/lib/presentation/home/widgets/product_card.dart @@ -23,15 +23,17 @@ class ProductCard extends StatelessWidget { Widget build(BuildContext context) { return GestureDetector( onTap: () { - if (data.variants!.isEmpty) { - context.read().add( - CheckoutEvent.addItem(data, null), - ); - } else { - showDialog( - context: context, - builder: (context) => VariantDialog(product: data), - ); + if (data.isActive == true) { + if (data.variants!.isEmpty) { + context.read().add( + CheckoutEvent.addItem(data, null), + ); + } else { + showDialog( + context: context, + builder: (context) => VariantDialog(product: data), + ); + } } }, child: Container( @@ -161,6 +163,14 @@ class ProductCard extends StatelessWidget { ); }, ), + if (data.isActive == false) + Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(8.0)), + color: AppColors.grey.withOpacity(0.5), + ), + ), ], ), ),