4/21/2
This commit is contained in:
@@ -18,10 +18,10 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<PaymentController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: Get.height * .2,
|
||||
top: Get.height * .1,
|
||||
right: Get.width * .15,
|
||||
left: Get.width * .15,
|
||||
bottom: Get.height * .2,
|
||||
bottom: Get.height * .1,
|
||||
child: controller.isPromoSheetDialogue
|
||||
? Container(
|
||||
decoration: const BoxDecoration(
|
||||
@@ -161,28 +161,72 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
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);
|
||||
}
|
||||
})
|
||||
? Column(
|
||||
children: [
|
||||
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 need to choose an amount!'.tr,
|
||||
AppColor.redColor,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
// Add some spacing between buttons
|
||||
MyElevatedButton(
|
||||
kolor: AppColor.yellowColor,
|
||||
title: '💰 Pay with Wallet'.tr,
|
||||
onPressed: () {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.payWithPayMobWallet(
|
||||
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 need to choose an amount!'.tr,
|
||||
AppColor.redColor,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
: MyElevatedButton(
|
||||
title: 'Pay with Credit Card'.tr,
|
||||
onPressed: () {
|
||||
@@ -191,8 +235,8 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
controller.selectedAmount!
|
||||
.toDouble(), // Convert int to double
|
||||
box.read(BoxName.countryCode) != 'Egypt'
|
||||
? 'EGP'
|
||||
: 'USD', () {
|
||||
? 'usd'
|
||||
: 'jod', () {
|
||||
controller.addPassengerWallet();
|
||||
controller.changePromoSheetDialogue();
|
||||
controller.getPassengerWallet();
|
||||
|
||||
Reference in New Issue
Block a user