This commit is contained in:
Hamza Aleghwairyeen
2024-04-17 00:54:01 +03:00
parent 24b3804045
commit d450ad0f93
7 changed files with 236 additions and 78 deletions

View File

@@ -53,14 +53,18 @@ class PassengerWalletDialoge extends StatelessWidget {
child: Row(
children: [
Radio(
value: 10,
value: box.read(BoxName.countryCode) == 'Egypt'
? 100
: 10,
groupValue: controller.selectedAmount,
onChanged: (value) {
controller.updateSelectedAmount(value as int);
},
),
Text(
'10\$ and get 3% discount'.tr,
box.read(BoxName.countryCode) == 'Egypt'
? '100 ${'LE'.tr}'.tr
: '10\$ and get 3% discount',
style: AppStyle.title,
),
],
@@ -73,7 +77,10 @@ class PassengerWalletDialoge extends StatelessWidget {
child: Row(
children: [
Radio(
value: 20,
value:
box.read(BoxName.countryCode) == 'Egypt'
? 200
: 20,
groupValue: controller.selectedAmount,
onChanged: (value) {
controller
@@ -81,7 +88,9 @@ class PassengerWalletDialoge extends StatelessWidget {
},
),
Text(
'20\$ and get 4% discount'.tr,
box.read(BoxName.countryCode) == 'Egypt'
? '200 ${'LE'.tr} '.tr
: '20 ${'JOD'.tr}'.tr,
style: AppStyle.title,
),
],
@@ -93,7 +102,10 @@ class PassengerWalletDialoge extends StatelessWidget {
child: Row(
children: [
Radio(
value: 40,
value:
box.read(BoxName.countryCode) == 'Egypt'
? 400
: 40,
groupValue: controller.selectedAmount,
onChanged: (value) {
controller
@@ -101,7 +113,9 @@ class PassengerWalletDialoge extends StatelessWidget {
},
),
Text(
'40\$ and get 6% discount'.tr,
box.read(BoxName.countryCode) == 'Egypt'
? '400 ${'LE'.tr} '.tr
: '40 ${'JOD'.tr}'.tr,
style: AppStyle.title,
),
],
@@ -113,7 +127,10 @@ class PassengerWalletDialoge extends StatelessWidget {
child: Row(
children: [
Radio(
value: 100,
value:
box.read(BoxName.countryCode) == 'Egypt'
? 1000
: 50,
groupValue: controller.selectedAmount,
onChanged: (value) {
controller
@@ -121,7 +138,9 @@ class PassengerWalletDialoge extends StatelessWidget {
},
),
Text(
'100\$ and get 9% discount'.tr,
box.read(BoxName.countryCode) == 'Egypt'
? '1000 ${'LE'.tr} '.tr
: '50 ${'JOD'.tr}'.tr,
style: AppStyle.title,
),
],
@@ -141,27 +160,50 @@ class PassengerWalletDialoge extends StatelessWidget {
}
},
),
MyElevatedButton(
title: 'Pay with Credit Card'.tr,
onPressed: () {
if (controller.selectedAmount != 0) {
controller.makePaymentStripe(
controller.selectedAmount!
.toDouble(), // Convert int to double
box.read(BoxName.countryCode) != 'Egypt'.tr
? 'EGP'
: 'USD', () {
controller.addPassengerWallet();
controller.changePromoSheetDialogue();
controller.getPassengerWallet();
});
} else {
Toast.show(
context,
'You will choose one of above !'.tr,
AppColor.redColor);
}
}),
box.read(BoxName.countryCode) == 'Egypt'
? MyElevatedButton(
title: 'Pay with Credit Card'.tr,
onPressed: () {
if (controller.selectedAmount != 0) {
controller.payWithPayMob(
context,
controller.selectedAmount
.toString(), // Convert int to double
box.read(BoxName.countryCode) == 'Egypt'
? 'EGP'
: 'JOD', () async {
await controller.addPassengerWallet();
controller.changePromoSheetDialogue();
await controller.getPassengerWallet();
});
} else {
Toast.show(
context,
'You will choose one of above !'.tr,
AppColor.redColor);
}
})
: MyElevatedButton(
title: 'Pay with Credit Card'.tr,
onPressed: () {
if (controller.selectedAmount != 0) {
controller.makePaymentStripe(
controller.selectedAmount!
.toDouble(), // Convert int to double
box.read(BoxName.countryCode) != 'Egypt'
? 'EGP'
: 'USD', () {
controller.addPassengerWallet();
controller.changePromoSheetDialogue();
controller.getPassengerWallet();
});
} else {
Toast.show(
context,
'You will choose one of above !'.tr,
AppColor.redColor);
}
}),
MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,