offer update

This commit is contained in:
2025-02-09 02:13:44 +05:30
parent c6a6ded51d
commit 630a918307
22 changed files with 1027 additions and 986 deletions

View File

@@ -153,6 +153,25 @@ class _MycartState extends State<Mycart> {
"",
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(provider.productDetails.data!.basePrice), double.parse(provider.productDetails.data!.discountPrice))}% OFF",
style: TextStyle(
color: Colors.white,
fontSize: 12)),
),
),
)
// Positioned(
// right: 5,
// top: 5,
@@ -713,7 +732,8 @@ class _MycartState extends State<Mycart> {
);
} else if (provider.allitem == null) {
return Center(child: Text('🛒 Your Front Shop Cart is empty'));
} else if (provider.allitem.items!.isEmpty) {
} else if (provider.allitem.items == null ||
provider.allitem.items!.isEmpty) {
return Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(backgroundColor: Colors.green),
@@ -729,7 +749,7 @@ class _MycartState extends State<Mycart> {
),
));
} else {
print("kldjhgjkhfgjkh ${provider.allitem.items}");
print("kldjhgjkhfgjkh ");
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -977,21 +997,24 @@ class _AddressBottomSheetState extends State<AddressBottomSheet> {
onPressed: () {
Navigator.pop(context);
Navigator.of(context).push(MaterialPageRoute(
builder: (context)
{
builder: (context) {
return CardCheckoutScreen(
amount: double.parse(
paymentProvider.allitem.subtotal.toString()),
currency: "INR",
originalAmount: double.parse(
paymentProvider.allitem.subtotal.toString()),
name: paymentProvider.selecteUserName,
phone: paymentProvider.selecteUserPhone,
email: paymentProvider.selecteEmail,
userId: paymentProvider.allitem.userId!,
cartId: paymentProvider.allitem.id!,
addressId: paymentProvider.selectedAddress,
remarks: paymentProvider.selecteUserName);
amount: double.parse(
paymentProvider.allitem.subtotal.toString()),
currency: "INR",
originalAmount: double.parse(
paymentProvider.allitem.subtotal.toString()),
name: paymentProvider.selecteUserName,
phone: paymentProvider.selecteUserPhone,
email: paymentProvider.selecteEmail,
userId: paymentProvider.allitem.userId!,
cartId: paymentProvider.allitem.id!,
addressId: paymentProvider.selectedAddress,
remarks: paymentProvider.selecteUserName,
deliverCharge: 0,
discountPrice: 0,
couponId: '',
);
},
));
},