cartui fixed
This commit is contained in:
@@ -992,7 +992,7 @@
|
|||||||
"languageVersion": "3.4"
|
"languageVersion": "3.4"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"generated": "2025-02-13T05:46:18.147720Z",
|
"generated": "2025-02-13T11:54:46.039722Z",
|
||||||
"generator": "pub",
|
"generator": "pub",
|
||||||
"generatorVersion": "3.4.4",
|
"generatorVersion": "3.4.4",
|
||||||
"flutterRoot": "file:///Users/rajeevsingh/Documents/allSoftwares/flutter",
|
"flutterRoot": "file:///Users/rajeevsingh/Documents/allSoftwares/flutter",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -56,14 +56,14 @@ class AddtocartProvider extends ChangeNotifier {
|
|||||||
// Now check if this pin code is deliverable
|
// Now check if this pin code is deliverable
|
||||||
await checkPin(context, _pinCode);
|
await checkPin(context, _pinCode);
|
||||||
} else {
|
} else {
|
||||||
_pinCode = "unable to current pi code";
|
_pinCode = "";
|
||||||
print("Error: No placemarks found.");
|
print("Error: No placemarks found.");
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_pinCode = "unable to current pi code";
|
_pinCode = "";
|
||||||
print("Error: ${e.toString()}");
|
print("Error: ${e.toString()}");
|
||||||
}
|
}
|
||||||
_pinCode = "unable to current pi code";
|
_pinCode = "";
|
||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ class _BestDealScreenState extends State<BestDealScreen> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"\$${bestdealproduct.discountPrice ?? ""} ",
|
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -302,7 +302,7 @@ class _BestDealScreenState extends State<BestDealScreen> {
|
|||||||
context.customSemiBold(Colors.black, 12),
|
context.customSemiBold(Colors.black, 12),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"\$${bestdealproduct.basePrice ?? ""}",
|
"₹${bestdealproduct.basePrice ?? ""}",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class _MycartState extends State<Mycart> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Center(
|
title: Center(
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Cart 🛒',
|
'My Cart 🛒',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
@@ -84,7 +84,6 @@ class _MycartState extends State<Mycart> {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
Divider(),
|
|
||||||
cartPlace(),
|
cartPlace(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -95,210 +94,206 @@ class _MycartState extends State<Mycart> {
|
|||||||
|
|
||||||
Widget relatedProduct() {
|
Widget relatedProduct() {
|
||||||
return Consumer<ProductProvider>(builder: (context, provider, child) {
|
return Consumer<ProductProvider>(builder: (context, provider, child) {
|
||||||
|
|
||||||
if (provider.isBestdealingloading) {
|
if (provider.isBestdealingloading) {
|
||||||
return Center(child: CircularProgressIndicator());
|
return Center(child: CircularProgressIndicator());
|
||||||
} else if (provider.bestdeal.isEmpty) {
|
} else if (provider.bestdeal.isEmpty) {
|
||||||
return Center(child: Text('No products available'));
|
return Center(child: Text('No products available'));
|
||||||
} else {
|
} else {
|
||||||
return GridView.builder(
|
return SizedBox(
|
||||||
itemCount:
|
height: MediaQuery.of(context).size.height * 0.28,
|
||||||
provider.bestdeal.length < 8 ? provider.bestdeal.length : 6,
|
child: ListView.builder(
|
||||||
physics: NeverScrollableScrollPhysics(),
|
scrollDirection: Axis.horizontal,
|
||||||
shrinkWrap: true,
|
itemCount: provider.bestdeal.length,
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
itemBuilder: (context, index) {
|
||||||
crossAxisCount: 2,
|
var bestdealproduct = provider.bestdeal[index];
|
||||||
crossAxisSpacing: 5,
|
double cardWidth =
|
||||||
mainAxisSpacing: 5,
|
MediaQuery.of(context).size.width * 0.4; // Dynamic width
|
||||||
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 InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.push(MyRoutes.PRODUCTDETAILS,
|
context.push(MyRoutes.PRODUCTDETAILS,
|
||||||
extra: bestdealproduct.id);
|
extra: bestdealproduct.id);
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(right: 10, bottom: 5, top: 5),
|
padding: const EdgeInsets.only(right: 5, bottom: 5, top: 5),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: cardWidth,
|
width: cardWidth,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(15),
|
borderRadius: BorderRadius.circular(15),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.grey.withOpacity(0.1),
|
color: Colors.grey.withOpacity(0.1),
|
||||||
blurRadius: 1,
|
blurRadius: 1,
|
||||||
offset: const Offset(5, 5),
|
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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
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,
|
shrinkWrap: true,
|
||||||
physics: NeverScrollableScrollPhysics(),
|
physics: NeverScrollableScrollPhysics(),
|
||||||
separatorBuilder: (_, index) => Padding(
|
separatorBuilder: (_, index) => Padding(
|
||||||
padding: EdgeInsets.only(top: 12.h, bottom: 24.h),
|
padding: EdgeInsets.only(top: 8.h, bottom: 8.h),
|
||||||
child: const Divider(thickness: 1),
|
// child: const Divider(thickness: 1),
|
||||||
),
|
),
|
||||||
itemCount: provider.allitem.items!.length,
|
itemCount: provider.allitem.items!.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
@@ -470,7 +465,7 @@ class _MycartState extends State<Mycart> {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
||||||
),
|
),
|
||||||
5.verticalSpace,
|
2.verticalSpace,
|
||||||
Text(
|
Text(
|
||||||
items.product!.unit ?? "",
|
items.product!.unit ?? "",
|
||||||
style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
style: context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
||||||
@@ -478,14 +473,14 @@ class _MycartState extends State<Mycart> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"\$${items.product!.discountPrice ?? ""} ",
|
"₹${items.product!.discountPrice ?? ""} ",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: context.customSemiBold(Colors.black, 12),
|
style: context.customSemiBold(Colors.black, 12),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"\$${items.product!.basePrice ?? ""}",
|
"₹${items.product!.basePrice ?? ""}",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -528,79 +523,103 @@ class _MycartState extends State<Mycart> {
|
|||||||
const Spacer(),
|
const Spacer(),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Container(
|
||||||
children: [
|
height: 25,
|
||||||
CustomIconButton(
|
width: 70,
|
||||||
width: 14.w,
|
decoration: BoxDecoration(
|
||||||
height: 14.h,
|
borderRadius: BorderRadius.all(Radius.circular(7)),
|
||||||
onPressed: () async {
|
shape: BoxShape.rectangle,
|
||||||
if (items.quantity! > 1) {
|
border: Border.all(
|
||||||
await provider.decreaseCartQuantity(
|
color: APPCOLOR.lightGreen,
|
||||||
context,
|
width: 1,
|
||||||
items.id!,
|
|
||||||
int.parse(items.quantity.toString()) - 1);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icon: SvgPicture.asset(
|
|
||||||
APPASSETS.removeIcon,
|
|
||||||
fit: BoxFit.none,
|
|
||||||
),
|
|
||||||
backgroundColor: APPCOLOR.appGreen,
|
|
||||||
),
|
),
|
||||||
5.horizontalSpace,
|
),
|
||||||
Text(
|
child: Center(
|
||||||
items.quantity.toString(),
|
child: Row(
|
||||||
style:
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
context.customMedium(APPCOLOR.balck1A1A1A, 14),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
),
|
children: [
|
||||||
5.horizontalSpace,
|
InkWell(
|
||||||
CustomIconButton(
|
onTap: () async {
|
||||||
width: 14.w,
|
if (items.quantity! > 1) {
|
||||||
height: 14.h,
|
await provider.decreaseCartQuantity(
|
||||||
onPressed: () async {
|
context,
|
||||||
await provider.addToCart(
|
items.id!,
|
||||||
context, items.productId!, 1);
|
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);
|
// // await provider.getItemCards(context);
|
||||||
},
|
// },
|
||||||
icon: SvgPicture.asset(
|
// icon: Icon(Icons.add),
|
||||||
APPASSETS.addIcon,
|
// iconSize: 10,
|
||||||
fit: BoxFit.none,
|
// ),
|
||||||
),
|
],
|
||||||
backgroundColor: APPCOLOR.appGreen,
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
Gap(20),
|
Gap(20),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
provider.deleteItem(context, items.id);
|
provider.deleteItem(context, items.id);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: provider.isRemoveItem[items.id] ?? false
|
||||||
height: 25,
|
? Center(
|
||||||
width: 70,
|
child: Padding(
|
||||||
decoration: BoxDecoration(
|
padding: const EdgeInsets.all(8.0),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
child: Container(
|
||||||
shape: BoxShape.rectangle,
|
height: 5,
|
||||||
border: Border.all(
|
width: 5,
|
||||||
color: Colors.blue,
|
child: CircularProgressIndicator(
|
||||||
width: 2,
|
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: [
|
children: [
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: Icon(Icons.local_offer, color: Colors.green),
|
leading: Icon(Icons.local_offer, color: Colors.green),
|
||||||
title: Text('APPLY COUPON',
|
title: Text('APPLY COUPON', style: TextStyle(fontSize: 15)),
|
||||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
trailing: Icon(
|
||||||
trailing: Icon(Icons.arrow_forward_ios),
|
Icons.arrow_forward_ios,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (provider.couponDataModel.data!.isNotEmpty) {
|
if (provider.couponDataModel.data!.isNotEmpty) {
|
||||||
context.push(MyRoutes.COUPONSSCREEN,
|
context.push(MyRoutes.COUPONSSCREEN,
|
||||||
@@ -753,52 +774,113 @@ class _MycartState extends State<Mycart> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 0.2,
|
||||||
|
),
|
||||||
SummaryRow(
|
SummaryRow(
|
||||||
label: 'Item Total Price', value: '\$${provider.totalPrice}'),
|
label: 'Item Total Price', value: '₹${provider.totalPrice}'),
|
||||||
SummaryRow(label: 'Discount', value: "${provider.discount}"),
|
SummaryRow(label: 'Discount Price', value: "${provider.discount}"),
|
||||||
SummaryRow(label: 'Delivery Free', value: 'Free', isGreen: true),
|
SummaryRow(label: 'Delivery Free', value: 'Free', isGreen: true),
|
||||||
Divider(),
|
Divider(
|
||||||
|
thickness: 0.2,
|
||||||
|
),
|
||||||
SummaryRow(
|
SummaryRow(
|
||||||
label: 'Grand Total',
|
label: 'Grand Total',
|
||||||
value: '\$${provider.grandPrice}',
|
value: '₹${provider.grandPrice}',
|
||||||
isBold: true),
|
isBold: true),
|
||||||
ListTile(
|
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
|
title: provider.isDeliverable
|
||||||
? Text('Delivering to : ${provider.pinCode}')
|
? Text('Delivering to : ${provider.pinCode}')
|
||||||
: Text(
|
: Text(
|
||||||
'Out Of Stock : ${provider.pinCode}',
|
'Out Of Stock ${provider.pinCode}',
|
||||||
style: TextStyle(color: Colors.red),
|
style: TextStyle(color: Colors.red),
|
||||||
),
|
),
|
||||||
trailing: Text('Change', style: TextStyle(color: Colors.blue)),
|
trailing: Text('Change', style: TextStyle(color: Colors.green)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_showBottomSheet(context);
|
_showBottomSheet(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
ElevatedButton(
|
Padding(
|
||||||
style: ElevatedButton.styleFrom(
|
padding: EdgeInsets.only(left: 20, right: 20),
|
||||||
backgroundColor: APPCOLOR.lightGreen),
|
child: Container(
|
||||||
onPressed: () {
|
height: 40,
|
||||||
if (provider.isDeliverable) {
|
decoration: BoxDecoration(
|
||||||
_showAddressBottomSheet(context);
|
color: APPCOLOR.lightGreen,
|
||||||
} else {
|
borderRadius: BorderRadius.circular(5),
|
||||||
Fluttertoast.showToast(
|
),
|
||||||
msg:
|
child: Row(
|
||||||
"Delivery is not available for this pincode. Please try another pincode!",
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
toastLength: Toast.LENGTH_SHORT,
|
children: [
|
||||||
gravity: ToastGravity.BOTTOM,
|
Text("₹${provider.grandPrice}",
|
||||||
backgroundColor: Colors.red,
|
style: TextStyle(fontSize: 16, color: Colors.white)),
|
||||||
textColor: Colors.white,
|
Container(
|
||||||
fontSize: 14.0,
|
width: 1, height: 30, color: APPCOLOR.whiteFBFEFB),
|
||||||
);
|
InkWell(
|
||||||
}
|
onTap: () {
|
||||||
},
|
if (provider.isDeliverable) {
|
||||||
child: Row(
|
_showAddressBottomSheet(context);
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
} else {
|
||||||
children: [Text('Place Order', style: TextStyle(fontSize: 16))],
|
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: [
|
children: [
|
||||||
Text(label,
|
Text(label,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 14,
|
||||||
fontWeight: isBold ? FontWeight.bold : FontWeight.normal)),
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal)),
|
||||||
Text(value,
|
Text(value,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 14,
|
||||||
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
|
||||||
color: isGreen ? Colors.green : Colors.black)),
|
color: isGreen ? Colors.green : Colors.black)),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -220,13 +220,13 @@ class _FavouriteScreenState extends State<FavouriteScreen>
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"\$${product.discountPrice}",
|
"₹${product.discountPrice}",
|
||||||
style: context.customSemiBold(
|
style: context.customSemiBold(
|
||||||
Colors.black, 14),
|
Colors.black, 14),
|
||||||
),
|
),
|
||||||
SizedBox(width: 5),
|
SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"\$${product.basePrice ?? ""}",
|
"₹${product.basePrice ?? ""}",
|
||||||
style: context
|
style: context
|
||||||
.customMedium(
|
.customMedium(
|
||||||
Colors.grey.withOpacity(0.8), 12)
|
Colors.grey.withOpacity(0.8), 12)
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
|
|||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"\$${product.discountPrice ?? " "}",
|
"₹${product.discountPrice ?? " "}",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -288,7 +288,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
Text(
|
Text(
|
||||||
"\$${product.basePrice ?? " "}",
|
"₹${product.basePrice ?? " "}",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"\$${bestdealproduct.discountPrice ?? ""} ",
|
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -395,7 +395,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
Colors.black, 11),
|
Colors.black, 11),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"\$${bestdealproduct.basePrice ?? ""}",
|
"₹${bestdealproduct.basePrice ?? ""}",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
|
|||||||
),
|
),
|
||||||
title: Text(orderitem.productName ?? ""),
|
title: Text(orderitem.productName ?? ""),
|
||||||
subtitle: Text("Qty: ${orderitem.quantity.toString()}"),
|
subtitle: Text("Qty: ${orderitem.quantity.toString()}"),
|
||||||
trailing: Text("\$${orderitem.totalOrderItemPrice ?? ""}",
|
trailing: Text("₹${orderitem.totalOrderItemPrice ?? ""}",
|
||||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"\$${provider.productDetails.data!.discountPrice}",
|
"₹${provider.productDetails.data!.discountPrice}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -248,7 +248,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
|||||||
),
|
),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"\$${provider.productDetails.data!.basePrice}",
|
"₹${provider.productDetails.data!.basePrice}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -1058,7 +1058,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"\$${bestdealproduct.discountPrice ?? ""} ",
|
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -1066,7 +1066,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
|||||||
Colors.black, 12),
|
Colors.black, 12),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"\$${bestdealproduct.basePrice ?? ""}",
|
"₹${bestdealproduct.basePrice ?? ""}",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -1254,7 +1254,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
|||||||
width: 2, height: 50, color: APPCOLOR.whiteFBFEFB),
|
width: 2, height: 50, color: APPCOLOR.whiteFBFEFB),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"\$${cartProvider.totalPrice}",
|
"₹${cartProvider.totalPrice}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
|||||||
Reference in New Issue
Block a user