addProductInformation

This commit is contained in:
2025-02-05 19:03:07 +05:30
parent f92e0300a4
commit 96e4c10656
14 changed files with 1399 additions and 1109 deletions

View File

@@ -514,6 +514,15 @@ class _MycartState extends State<Mycart> {
),
],
),
Gap(5),
InkWell(
onTap: () {
showReturnPolicyBottomSheet(context);
},
child: Text("3 days Return & Exchange ",
style:
TextStyle(color: Colors.green, fontSize: 1)),
),
],
),
),
@@ -605,307 +614,93 @@ class _MycartState extends State<Mycart> {
});
}
// Widget relatedProduct() {
// return SizedBox(
// height: 222,
// child: ListView.builder(
// itemCount: 5,
// scrollDirection: Axis.horizontal,
// itemBuilder: (context, index) {
// return Padding(
// padding: const EdgeInsets.only(right: 10, bottom: 5, top: 5),
// child: Container(
// height: 215,
// width: 150,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(15),
// boxShadow: [
// BoxShadow(
// color: Colors.grey.withOpacity(0.1),
// blurRadius: 1,
// offset: const Offset(5, 5),
// ),
// ]),
// child: Padding(
// padding: const EdgeInsets.all(5),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// height: 100,
// width: 150,
// decoration: BoxDecoration(
// color: APPCOLOR.bgGrey,
// borderRadius: BorderRadius.circular(15)),
// child: const Stack(
// alignment: Alignment.center,
// children: [
// AppNetworkImage(
// height: 70,
// width: 70,
// imageUrl:
// "https://5.imimg.com/data5/SELLER/Default/2024/2/385126988/OL/DA/VW/8627346/1l-fortune-sunflower-oil.jpg",
// backGroundColor: Colors.transparent),
// Positioned(
// right: 5,
// top: 5,
// child: Icon(Icons.favorite_border))
// ],
// ),
// ),
// Text(
// "Fortune Arhar Dal (Toor Dal)",
// textAlign: TextAlign.left,
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
// ),
// const SizedBox(
// height: 5,
// ),
// Text(
// "500 ML",
// textAlign: TextAlign.left,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: context.customMedium(
// Colors.grey.withOpacity(0.8), 12),
// ),
// const SizedBox(
// height: 3,
// ),
// Row(
// children: [
// Expanded(
// child: Row(
// children: [
// Text(
// "\$12",
// textAlign: TextAlign.left,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: context.customSemiBold(Colors.black, 12),
// ),
// const SizedBox(
// width: 5,
// ),
// Text(
// "\$14",
// textAlign: TextAlign.left,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: context
// .customMedium(
// Colors.grey.withOpacity(0.8), 12)
// .copyWith(
// decoration: TextDecoration.lineThrough,
// ),
// ),
// ],
// )),
// Expanded(
// child: Align(
// alignment: Alignment.centerRight,
// child: Container(
// height: 30,
// width: 50,
// decoration: BoxDecoration(
// color: APPCOLOR.lightGreen,
// borderRadius: BorderRadius.circular(5),
// ),
// child: Center(
// child: Text(
// 'Add',
// style: context.customRegular(Colors.white, 12),
// )),
// ),
// ),
// )
// ],
// ),
// ],
// ),
// ),
// ),
// );
// },
// ),
// );
// }
void showReturnPolicyBottomSheet(BuildContext context) {
showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
backgroundColor: Colors.white,
builder: (context) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Close Button
Align(
alignment: Alignment.topRight,
child: IconButton(
icon: Icon(Icons.close),
onPressed: () => Navigator.pop(context),
),
),
// Widget cartItems() {
// return Consumer<AddtocartProvider>(builder: (context, provider, child) {
// if (provider.isLoaddcartItem) {
// return Center(
// child: CircularProgressIndicator(
// color: Colors.green,
// ),
// );
// } else if (provider.allitem == null) {
// return Center(child: Text('🛒 Your Front Shop Cart is empty'));
// } else if (provider.allitem.items == null ||
// provider.allitem.items!.isEmpty) {
// return Center(child: Text('🛒 Your Front Shop Cart is empty'));
// } else {
// return ListView.separated(
// shrinkWrap: true, // Prevents internal scrolling
// physics: NeverScrollableScrollPhysics(), // Disables inner scroll
// separatorBuilder: (_, index) => Padding(
// padding: EdgeInsets.only(top: 12.h, bottom: 24.h),
// child: const Divider(thickness: 1),
// ),
// itemCount: provider.allitem.items!.length,
// itemBuilder: (context, index) {
// var items = provider.allitem.items![index];
// Title
Text(
"3 days Return & Exchange",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
SizedBox(height: 10),
// return Padding(
// padding: EdgeInsets.symmetric(horizontal: 10.w),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// decoration: BoxDecoration(
// color: Colors.greenAccent.withOpacity(0.1),
// borderRadius: BorderRadius.circular(5),
// ),
// child: AppNetworkImage(
// width: 60.w,
// height: 70.h,
// imageUrl: items.product!.productImages!.first.url ?? " ",
// backGroundColor: APPCOLOR.bgGrey,
// radius: 10,
// ),
// ),
// // Image.asset(product.image, width: 50.w, height: 40.h),
// Table Headers
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text("Return Reason",
style: TextStyle(fontWeight: FontWeight.bold))),
Expanded(
child: Text("Return Period",
style: TextStyle(fontWeight: FontWeight.bold))),
Expanded(
child: Text("Return Policy",
style: TextStyle(fontWeight: FontWeight.bold))),
],
),
Divider(),
// 16.horizontalSpace,
// Container(
// width: 150.w,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text(
// items.product!.name ?? "",
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
// ),
// 5.verticalSpace,
// Text(
// items.product!.unit ?? "",
// style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
// ),
// Row(
// children: [
// Text(
// "\$${items.product!.discountPrice ?? ""} ",
// textAlign: TextAlign.left,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: context.customSemiBold(Colors.black, 12),
// ),
// Text(
// "\$${items.product!.basePrice ?? ""}",
// textAlign: TextAlign.left,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: context
// .customMedium(
// Colors.grey.withOpacity(0.8),
// 12,
// )
// .copyWith(
// decoration: TextDecoration.lineThrough,
// ),
// ),
// ],
// ),
// ],
// ),
// ),
// const Spacer(),
// First Row
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Text("Size too small, Size too large")),
Expanded(child: Text("3 days from delivery")),
Expanded(
child: Text("Exchange with a different size or colour")),
],
),
SizedBox(height: 10),
// Column(
// children: [
// Row(
// children: [
// CustomIconButton(
// width: 14.w,
// height: 14.h,
// onPressed: () {
// // provider.decreaseQuantity(items);
// },
// icon: SvgPicture.asset(
// APPASSETS.removeIcon,
// fit: BoxFit.none,
// ),
// backgroundColor: APPCOLOR.appGreen,
// ),
// 5.horizontalSpace,
// Text(
// items.quantity.toString(),
// style:
// context.customMedium(APPCOLOR.balck1A1A1A, 14),
// ),
// 5.horizontalSpace,
// CustomIconButton(
// width: 14.w,
// height: 14.h,
// onPressed: () {
// // provider..increaseQuantity(items);
// },
// icon: SvgPicture.asset(
// APPASSETS.addIcon,
// fit: BoxFit.none,
// ),
// backgroundColor: APPCOLOR.appGreen,
// ),
// ],
// ),
// Gap(20),
// InkWell(
// onTap: () {
// provider.deleteItem(context, items.id);
// },
// child: Container(
// height: 25,
// width: 70,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(Radius.circular(10)),
// shape: BoxShape.rectangle,
// border: Border.all(
// color: Colors
// .blue, // Replace with your desired border color
// width: 2, // Border width
// ),
// ),
// child: provider.isRemoveItem[items.id] ?? false
// ? Center(
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// height: 5,
// width: 5,
// child: CircularProgressIndicator(
// color: Colors.green, strokeWidth: 1),
// ),
// ),
// )
// : Center(child: Text("Delete")),
// ),
// )
// ],
// )
// ],
// ),
// );
// },
// );
// }
// });
// }
// Second Row
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Text("Any other reason")),
Expanded(child: Text("10 days from delivery")),
Expanded(child: Text("Full refund")),
],
),
SizedBox(height: 20),
// Know More Link
InkWell(
onTap: () {
// Handle navigation to more details
},
child: Text(
"Know More",
style: TextStyle(
color: Colors.blue, fontWeight: FontWeight.bold),
),
),
],
),
);
},
);
}
Widget cartPlace() {
return Consumer<AddtocartProvider>(builder: (context, provider, child) {