cartui fixed
This commit is contained in:
@@ -56,14 +56,14 @@ class AddtocartProvider extends ChangeNotifier {
|
||||
// Now check if this pin code is deliverable
|
||||
await checkPin(context, _pinCode);
|
||||
} else {
|
||||
_pinCode = "unable to current pi code";
|
||||
_pinCode = "";
|
||||
print("Error: No placemarks found.");
|
||||
}
|
||||
} catch (e) {
|
||||
_pinCode = "unable to current pi code";
|
||||
_pinCode = "";
|
||||
print("Error: ${e.toString()}");
|
||||
}
|
||||
_pinCode = "unable to current pi code";
|
||||
_pinCode = "";
|
||||
_isLoading = false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ class _BestDealScreenState extends State<BestDealScreen> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"\$${bestdealproduct.discountPrice ?? ""} ",
|
||||
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -302,7 +302,7 @@ class _BestDealScreenState extends State<BestDealScreen> {
|
||||
context.customSemiBold(Colors.black, 12),
|
||||
),
|
||||
Text(
|
||||
"\$${bestdealproduct.basePrice ?? ""}",
|
||||
"₹${bestdealproduct.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
@@ -57,7 +57,7 @@ class _MycartState extends State<Mycart> {
|
||||
centerTitle: true,
|
||||
title: Center(
|
||||
child: const Text(
|
||||
'Cart 🛒',
|
||||
'My Cart 🛒',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -84,7 +84,6 @@ class _MycartState extends State<Mycart> {
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Divider(),
|
||||
cartPlace(),
|
||||
],
|
||||
),
|
||||
@@ -95,210 +94,206 @@ class _MycartState extends State<Mycart> {
|
||||
|
||||
Widget relatedProduct() {
|
||||
return Consumer<ProductProvider>(builder: (context, provider, child) {
|
||||
|
||||
if (provider.isBestdealingloading) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
} else if (provider.bestdeal.isEmpty) {
|
||||
return Center(child: Text('No products available'));
|
||||
} else {
|
||||
return GridView.builder(
|
||||
itemCount:
|
||||
provider.bestdeal.length < 8 ? provider.bestdeal.length : 6,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 5,
|
||||
mainAxisSpacing: 5,
|
||||
childAspectRatio: MediaQuery.of(context).size.width /
|
||||
(MediaQuery.of(context).size.height / 1.8),
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
var bestdealproduct = provider.bestdeal[index];
|
||||
double cardWidth =
|
||||
MediaQuery.of(context).size.width * 0.4; // Dynamic width
|
||||
return SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.28,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: provider.bestdeal.length,
|
||||
itemBuilder: (context, index) {
|
||||
var bestdealproduct = provider.bestdeal[index];
|
||||
double cardWidth =
|
||||
MediaQuery.of(context).size.width * 0.4; // Dynamic width
|
||||
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
context.push(MyRoutes.PRODUCTDETAILS,
|
||||
extra: bestdealproduct.id);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 10, bottom: 5, top: 5),
|
||||
child: Container(
|
||||
width: cardWidth,
|
||||
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: [
|
||||
Center(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.12,
|
||||
width: cardWidth * 0.9,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.bgGrey,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.08,
|
||||
width: cardWidth * 0.7,
|
||||
imageUrl: bestdealproduct
|
||||
.productImages?.first?.url ??
|
||||
"",
|
||||
backGroundColor: Colors.transparent,
|
||||
),
|
||||
Positioned(
|
||||
right: 1,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 6, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"${calculateDiscountPercentage(double.parse(bestdealproduct!.basePrice), double.parse(bestdealproduct!.discountPrice))}% OFF",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.01,
|
||||
),
|
||||
Text(
|
||||
bestdealproduct.name ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.005,
|
||||
),
|
||||
Text(
|
||||
bestdealproduct.unit ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
12,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.005,
|
||||
),
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"\$${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style:
|
||||
context.customSemiBold(Colors.black, 12),
|
||||
),
|
||||
Text(
|
||||
"\$${bestdealproduct.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context
|
||||
.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
12,
|
||||
)
|
||||
.copyWith(
|
||||
decoration: TextDecoration.lineThrough,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
if (await SharedPrefUtils.getToken() !=
|
||||
null) {
|
||||
await provider.addToCart(
|
||||
context, bestdealproduct.id!, 1);
|
||||
|
||||
context
|
||||
.read<AddtocartProvider>()
|
||||
.getItemCards(context);
|
||||
} else {
|
||||
context.push(MyRoutes.SIGNUP);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.035,
|
||||
width:
|
||||
MediaQuery.of(context).size.width * 0.1,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.lightGreen,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: provider.isLoading[
|
||||
bestdealproduct.id] ??
|
||||
false
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 10,
|
||||
width: 10,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Add',
|
||||
style: context.customRegular(
|
||||
Colors.white, 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
context.push(MyRoutes.PRODUCTDETAILS,
|
||||
extra: bestdealproduct.id);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 5, bottom: 5, top: 5),
|
||||
child: Container(
|
||||
width: cardWidth,
|
||||
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: [
|
||||
Center(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.12,
|
||||
width: cardWidth * 0.9,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.bgGrey,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.08,
|
||||
width: cardWidth * 0.7,
|
||||
imageUrl: bestdealproduct
|
||||
.productImages?.first?.url ??
|
||||
"",
|
||||
backGroundColor: Colors.transparent,
|
||||
),
|
||||
Positioned(
|
||||
right: 1,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 6, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"${calculateDiscountPercentage(double.parse(bestdealproduct!.basePrice), double.parse(bestdealproduct!.discountPrice))}% OFF",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.01,
|
||||
),
|
||||
Text(
|
||||
bestdealproduct.name ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style:
|
||||
context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.005,
|
||||
),
|
||||
Text(
|
||||
bestdealproduct.unit ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
12,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.005,
|
||||
),
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customSemiBold(
|
||||
Colors.black, 12),
|
||||
),
|
||||
Text(
|
||||
"₹${bestdealproduct.basePrice ?? ""}",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context
|
||||
.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
12,
|
||||
)
|
||||
.copyWith(
|
||||
decoration:
|
||||
TextDecoration.lineThrough,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
if (await SharedPrefUtils.getToken() !=
|
||||
null) {
|
||||
await provider.addToCart(
|
||||
context, bestdealproduct.id!, 1);
|
||||
|
||||
context
|
||||
.read<AddtocartProvider>()
|
||||
.getItemCards(context);
|
||||
} else {
|
||||
context.push(MyRoutes.SIGNUP);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.028,
|
||||
// width:
|
||||
// MediaQuery.of(context).size.width * 0.1,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.lightGreen,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: provider.isLoading[
|
||||
bestdealproduct.id] ??
|
||||
false
|
||||
? Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 10,
|
||||
width: 10,
|
||||
child:
|
||||
CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
' Add ',
|
||||
style: context.customRegular(
|
||||
Colors.white, 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -433,8 +428,8 @@ class _MycartState extends State<Mycart> {
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
separatorBuilder: (_, index) => Padding(
|
||||
padding: EdgeInsets.only(top: 12.h, bottom: 24.h),
|
||||
child: const Divider(thickness: 1),
|
||||
padding: EdgeInsets.only(top: 8.h, bottom: 8.h),
|
||||
// child: const Divider(thickness: 1),
|
||||
),
|
||||
itemCount: provider.allitem.items!.length,
|
||||
itemBuilder: (context, index) {
|
||||
@@ -470,7 +465,7 @@ class _MycartState extends State<Mycart> {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
||||
),
|
||||
5.verticalSpace,
|
||||
2.verticalSpace,
|
||||
Text(
|
||||
items.product!.unit ?? "",
|
||||
style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
||||
@@ -478,14 +473,14 @@ class _MycartState extends State<Mycart> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"\$${items.product!.discountPrice ?? ""} ",
|
||||
"₹${items.product!.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customSemiBold(Colors.black, 12),
|
||||
),
|
||||
Text(
|
||||
"\$${items.product!.basePrice ?? ""}",
|
||||
"₹${items.product!.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -528,79 +523,103 @@ class _MycartState extends State<Mycart> {
|
||||
const Spacer(),
|
||||
Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
CustomIconButton(
|
||||
width: 14.w,
|
||||
height: 14.h,
|
||||
onPressed: () async {
|
||||
if (items.quantity! > 1) {
|
||||
await provider.decreaseCartQuantity(
|
||||
context,
|
||||
items.id!,
|
||||
int.parse(items.quantity.toString()) - 1);
|
||||
}
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
APPASSETS.removeIcon,
|
||||
fit: BoxFit.none,
|
||||
),
|
||||
backgroundColor: APPCOLOR.appGreen,
|
||||
Container(
|
||||
height: 25,
|
||||
width: 70,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(7)),
|
||||
shape: BoxShape.rectangle,
|
||||
border: Border.all(
|
||||
color: APPCOLOR.lightGreen,
|
||||
width: 1,
|
||||
),
|
||||
5.horizontalSpace,
|
||||
Text(
|
||||
items.quantity.toString(),
|
||||
style:
|
||||
context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
||||
),
|
||||
5.horizontalSpace,
|
||||
CustomIconButton(
|
||||
width: 14.w,
|
||||
height: 14.h,
|
||||
onPressed: () async {
|
||||
await provider.addToCart(
|
||||
context, items.productId!, 1);
|
||||
),
|
||||
child: Center(
|
||||
child: Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
if (items.quantity! > 1) {
|
||||
await provider.decreaseCartQuantity(
|
||||
context,
|
||||
items.id!,
|
||||
int.parse(items.quantity.toString()) -
|
||||
1);
|
||||
}
|
||||
},
|
||||
child: Icon(
|
||||
Icons.remove,
|
||||
size: 15,
|
||||
color: APPCOLOR.lightGreen,
|
||||
),
|
||||
),
|
||||
// IconButton(
|
||||
// // width: 14.w,
|
||||
// // height: 14.h,
|
||||
// onPressed: () async {
|
||||
// if (items.quantity! > 1) {
|
||||
// await provider.decreaseCartQuantity(
|
||||
// context,
|
||||
// items.id!,
|
||||
// int.parse(items.quantity.toString()) -
|
||||
// 1);
|
||||
// }
|
||||
// },
|
||||
// icon: Icon(Icons.minimize_rounded),
|
||||
// iconSize: 10,
|
||||
// ),
|
||||
Gap(10),
|
||||
Text(
|
||||
items.quantity.toString(),
|
||||
style: context.customMedium(
|
||||
APPCOLOR.balck1A1A1A, 14),
|
||||
),
|
||||
Gap(10),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
await provider.addToCart(
|
||||
context, items.productId!, 1);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
size: 15,
|
||||
color: APPCOLOR.lightGreen,
|
||||
),
|
||||
),
|
||||
// IconButton(
|
||||
// onPressed: () async {
|
||||
// await provider.addToCart(
|
||||
// context, items.productId!, 1);
|
||||
|
||||
// await provider.getItemCards(context);
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
APPASSETS.addIcon,
|
||||
fit: BoxFit.none,
|
||||
),
|
||||
backgroundColor: APPCOLOR.appGreen,
|
||||
// // await provider.getItemCards(context);
|
||||
// },
|
||||
// icon: Icon(Icons.add),
|
||||
// iconSize: 10,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Gap(20),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
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,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
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),
|
||||
),
|
||||
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")),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Center(child: Text("Delete")),
|
||||
)
|
||||
],
|
||||
)
|
||||
@@ -734,9 +753,11 @@ class _MycartState extends State<Mycart> {
|
||||
children: [
|
||||
ListTile(
|
||||
leading: Icon(Icons.local_offer, color: Colors.green),
|
||||
title: Text('APPLY COUPON',
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
trailing: Icon(Icons.arrow_forward_ios),
|
||||
title: Text('APPLY COUPON', style: TextStyle(fontSize: 15)),
|
||||
trailing: Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 15,
|
||||
),
|
||||
onTap: () {
|
||||
if (provider.couponDataModel.data!.isNotEmpty) {
|
||||
context.push(MyRoutes.COUPONSSCREEN,
|
||||
@@ -753,52 +774,113 @@ class _MycartState extends State<Mycart> {
|
||||
}
|
||||
},
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.2,
|
||||
),
|
||||
SummaryRow(
|
||||
label: 'Item Total Price', value: '\$${provider.totalPrice}'),
|
||||
SummaryRow(label: 'Discount', value: "${provider.discount}"),
|
||||
label: 'Item Total Price', value: '₹${provider.totalPrice}'),
|
||||
SummaryRow(label: 'Discount Price', value: "${provider.discount}"),
|
||||
SummaryRow(label: 'Delivery Free', value: 'Free', isGreen: true),
|
||||
Divider(),
|
||||
Divider(
|
||||
thickness: 0.2,
|
||||
),
|
||||
SummaryRow(
|
||||
label: 'Grand Total',
|
||||
value: '\$${provider.grandPrice}',
|
||||
value: '₹${provider.grandPrice}',
|
||||
isBold: true),
|
||||
ListTile(
|
||||
leading: Icon(Icons.home, color: Colors.green),
|
||||
leading: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.lightGreen.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.all(Radius.circular(8))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Icon(Icons.home_outlined,
|
||||
size: 15, color: Colors.green),
|
||||
)),
|
||||
title: provider.isDeliverable
|
||||
? Text('Delivering to : ${provider.pinCode}')
|
||||
: Text(
|
||||
'Out Of Stock : ${provider.pinCode}',
|
||||
'Out Of Stock ${provider.pinCode}',
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
trailing: Text('Change', style: TextStyle(color: Colors.blue)),
|
||||
trailing: Text('Change', style: TextStyle(color: Colors.green)),
|
||||
onTap: () {
|
||||
_showBottomSheet(context);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: APPCOLOR.lightGreen),
|
||||
onPressed: () {
|
||||
if (provider.isDeliverable) {
|
||||
_showAddressBottomSheet(context);
|
||||
} else {
|
||||
Fluttertoast.showToast(
|
||||
msg:
|
||||
"Delivery is not available for this pincode. Please try another pincode!",
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
textColor: Colors.white,
|
||||
fontSize: 14.0,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [Text('Place Order', style: TextStyle(fontSize: 16))],
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 20, right: 20),
|
||||
child: Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.lightGreen,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text("₹${provider.grandPrice}",
|
||||
style: TextStyle(fontSize: 16, color: Colors.white)),
|
||||
Container(
|
||||
width: 1, height: 30, color: APPCOLOR.whiteFBFEFB),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (provider.isDeliverable) {
|
||||
_showAddressBottomSheet(context);
|
||||
} else {
|
||||
Fluttertoast.showToast(
|
||||
msg:
|
||||
"Delivery is not available for this pincode. Please try another pincode!",
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
textColor: Colors.white,
|
||||
fontSize: 14.0,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Place Order ',
|
||||
style:
|
||||
TextStyle(fontSize: 16, color: Colors.white)),
|
||||
Icon(
|
||||
Icons.arrow_forward,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// ElevatedButton(
|
||||
// style: ElevatedButton.styleFrom(
|
||||
// backgroundColor: APPCOLOR.lightGreen),
|
||||
// onPressed: () {
|
||||
// if (provider.isDeliverable) {
|
||||
// _showAddressBottomSheet(context);
|
||||
// } else {
|
||||
// Fluttertoast.showToast(
|
||||
// msg:
|
||||
// "Delivery is not available for this pincode. Please try another pincode!",
|
||||
// toastLength: Toast.LENGTH_SHORT,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.red,
|
||||
// textColor: Colors.white,
|
||||
// fontSize: 14.0,
|
||||
// );
|
||||
// }
|
||||
// },
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [Text('Place Order', style: TextStyle(fontSize: 16))],
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -1172,11 +1254,11 @@ class SummaryRow extends StatelessWidget {
|
||||
children: [
|
||||
Text(label,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontSize: 14,
|
||||
fontWeight: isBold ? FontWeight.bold : FontWeight.normal)),
|
||||
Text(value,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontSize: 14,
|
||||
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
|
||||
color: isGreen ? Colors.green : Colors.black)),
|
||||
],
|
||||
|
||||
@@ -220,13 +220,13 @@ class _FavouriteScreenState extends State<FavouriteScreen>
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"\$${product.discountPrice}",
|
||||
"₹${product.discountPrice}",
|
||||
style: context.customSemiBold(
|
||||
Colors.black, 14),
|
||||
),
|
||||
SizedBox(width: 5),
|
||||
Text(
|
||||
"\$${product.basePrice ?? ""}",
|
||||
"₹${product.basePrice ?? ""}",
|
||||
style: context
|
||||
.customMedium(
|
||||
Colors.grey.withOpacity(0.8), 12)
|
||||
|
||||
@@ -279,7 +279,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"\$${product.discountPrice ?? " "}",
|
||||
"₹${product.discountPrice ?? " "}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -288,7 +288,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"\$${product.basePrice ?? " "}",
|
||||
"₹${product.basePrice ?? " "}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
@@ -387,7 +387,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"\$${bestdealproduct.discountPrice ?? ""} ",
|
||||
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -395,7 +395,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
Colors.black, 11),
|
||||
),
|
||||
Text(
|
||||
"\$${bestdealproduct.basePrice ?? ""}",
|
||||
"₹${bestdealproduct.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
@@ -179,7 +179,7 @@ class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
|
||||
),
|
||||
title: Text(orderitem.productName ?? ""),
|
||||
subtitle: Text("Qty: ${orderitem.quantity.toString()}"),
|
||||
trailing: Text("\$${orderitem.totalOrderItemPrice ?? ""}",
|
||||
trailing: Text("₹${orderitem.totalOrderItemPrice ?? ""}",
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -240,7 +240,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"\$${provider.productDetails.data!.discountPrice}",
|
||||
"₹${provider.productDetails.data!.discountPrice}",
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -248,7 +248,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
"\$${provider.productDetails.data!.basePrice}",
|
||||
"₹${provider.productDetails.data!.basePrice}",
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -1058,7 +1058,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"\$${bestdealproduct.discountPrice ?? ""} ",
|
||||
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -1066,7 +1066,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
||||
Colors.black, 12),
|
||||
),
|
||||
Text(
|
||||
"\$${bestdealproduct.basePrice ?? ""}",
|
||||
"₹${bestdealproduct.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -1254,7 +1254,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
||||
width: 2, height: 50, color: APPCOLOR.whiteFBFEFB),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
"\$${cartProvider.totalPrice}",
|
||||
"₹${cartProvider.totalPrice}",
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
Reference in New Issue
Block a user