fixed issue add to cart

This commit is contained in:
2025-02-22 18:59:37 +05:30
parent 2c3e7e2992
commit 27c3a14646
17 changed files with 412 additions and 279 deletions

View File

@@ -1,11 +1,13 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/common_widget/network_image.dart';
import 'package:grocery_app/src/core/routes/routes.dart';
import 'package:grocery_app/src/logic/provider/home_provider.dart';
import 'package:grocery_app/src/ui/data_notfound.dart';
import 'package:grocery_app/utils/constants/assets_constant.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
import 'package:grocery_app/utils/constants/shared_pref_utils.dart';
@@ -121,8 +123,13 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
);
} else if (provider.products.isEmpty) {
return Padding(
padding: const EdgeInsets.only(left: 80),
child: Center(child: Text('No products available')),
padding: const EdgeInsets.only(left: 40),
child: DataNotFound(
imagePath: 'assets/images/cart.jpg',
message: "Product not abailable ",
width: 200.w,
height: 250.h,
),
);
} else {
return Expanded(
@@ -173,7 +180,15 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
return InkWell(
onTap: () {
context.push(MyRoutes.PRODUCTDETAILS,
extra: product.id);
// extra: product.id
extra: {
"id": product.id,
"quantity": 0,
"price": "0",
},
);
},
child: Container(
height: itemHeight,