@@ -340,19 +340,23 @@ class ItemDetails extends StatelessWidget {
340
340
child: customButton (
341
341
title: "Add to cart" ,
342
342
onPressed: () {
343
- controller.addToCart (
344
- color: data['p_colors' ][controller.colorIndex.value],
345
- image: data['p_images' ][0 ],
346
- quantity: controller.quantity.value,
347
- sellerName: data['p_seller' ],
348
- title: data['p_name' ],
349
- totalPrice: controller.totalPrice.value,
350
- vendorId: data['vendor_id' ],
351
- context: context,
352
- );
353
- VxToast .show (context, msg: "Added to Cart" );
354
- controller.resetValues ();
355
- Get .back ();
343
+ if (controller.quantity.value > 0 ) {
344
+ controller.addToCart (
345
+ color: data['p_colors' ][controller.colorIndex.value],
346
+ image: data['p_images' ][0 ],
347
+ quantity: controller.quantity.value,
348
+ sellerName: data['p_seller' ],
349
+ title: data['p_name' ],
350
+ totalPrice: controller.totalPrice.value,
351
+ vendorId: data['vendor_id' ],
352
+ context: context,
353
+ );
354
+ VxToast .show (context, msg: "Added to Cart" );
355
+ controller.resetValues ();
356
+ Get .back ();
357
+ } else {
358
+ VxToast .show (context, msg: "Please select Quantity" );
359
+ }
356
360
},
357
361
color: redColor,
358
362
textColor: whiteColor,
0 commit comments