This commit is contained in:
Hamza-Ayed
2023-11-13 23:55:51 +03:00
parent 8aab58d4aa
commit b384a491cd
5 changed files with 202 additions and 153 deletions

View File

@@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:ride/constant/info.dart';
import 'package:ride/controller/payment/payment_controller.dart';
import 'package:ride/views/widgets/elevated_btn.dart';
@@ -218,7 +219,7 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
.title,
)
: Text(
'Sefer Wallet',
'${AppInformation.appName} Wallet',
style: AppStyle
.title,
),
@@ -329,147 +330,162 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
],
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () {
Get.defaultDialog(
title: 'How Many Passengers?'.tr,
titleStyle: AppStyle.title,
content: Column(
children: [
Text(
'Allowed up to 4 Passengers.'
.tr,
style: AppStyle.title,
),
SizedBox(
height:
200, // Set the desired height here
child: CupertinoPicker(
itemExtent: 32,
onSelectedItemChanged:
(index) {
controller
.onChangedPassengerCount(
index + 1);
},
children: [
Text('1 Passenger'.tr),
Text('2 Passengers'.tr),
Text('3 Passengers'.tr),
Text('4 Passengers'.tr),
],
SizedBox(
width: Get.width * .95,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () {
Get.defaultDialog(
barrierDismissible: false,
title:
'How Many Passengers?'.tr,
titleStyle: AppStyle.title,
content: Column(
children: [
Text(
'Allowed up to 4 Passengers.'
.tr,
style: AppStyle.title,
),
),
MyElevatedButton(
title: 'Back',
onPressed: () => Get.back(),
)
],
),
);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text('How Many Passengers?'.tr,
style: AppStyle.title),
const SizedBox(
width: 10,
),
Container(
decoration: BoxDecoration(
border: Border.all()),
child: Padding(
padding:
const EdgeInsets.all(3.0),
child: Text(
controller
.selectedPassengerCount
.toString(),
style: AppStyle.title),
SizedBox(
height:
200, // Set the desired height here
child: CupertinoPicker(
itemExtent: 32,
onSelectedItemChanged:
(index) {
controller
.onChangedPassengerCount(
index + 1);
},
children: [
Text(
'1 Passenger'.tr),
Text('2 Passengers'
.tr),
Text('3 Passengers'
.tr),
Text('4 Passengers'
.tr),
],
),
),
MyElevatedButton(
title: 'Back',
onPressed: () =>
Get.back(),
)
],
),
),
],
);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text('How Many Passengers?'.tr,
style: AppStyle.title),
const SizedBox(
width: 10,
),
Container(
decoration: BoxDecoration(
border: Border.all()),
child: Padding(
padding:
const EdgeInsets.all(
3.0),
child: Text(
controller
.selectedPassengerCount
.toString(),
style: AppStyle.title),
),
),
],
),
),
),
MyElevatedButton(
title: 'Confirm Selection'.tr,
onPressed: () {
controller.changeConfirmRide();
// Get.to(() => UsePaypal(
// sandboxMode: true,
// clientId:
// "AXE7bR3WzFEfAInUA2PBDOsW4zolx11Qr3jVOOjjJ7KGDLY3tnMIhZgyFT5Qkvj1NKWPaE8VZbG4UrZs",
// secretKey:
// "EJPW01FKqOm-SKKP16LQ_2cr3b124aZgmE0vi3JfbkWgLffv2xIjT4iCIfQv8RYn3W8h4DzxgZu_UxZC",
// returnURL:
// "https://samplesite.com/return",
// cancelURL:
// "https://samplesite.com/cancel",
// transactions: const [
// {
// "amount": {
// "total": '10.12',
// "currency": "USD",
// "details": {
// "subtotal": '10.12',
// "shipping": '0',
// "shipping_discount": 0
// }
// },
// "description":
// "The payment transaction description.",
// "payment_options": {
// "allowed_payment_method":
// "INSTANT_FUNDING_SOURCE"
// },
// "item_list": {
// "items": [
// {
// "name":
// "A demo product",
// "quantity": 1,
// "price": '10.12',
// "currency": "USD"
// }
// ],
// // shipping address is not required though
// "shipping_address": {
// "recipient_name":
// "Jane Foster",
// "line1": "Travis County",
// "line2": "",
// "city": "Austin",
// "country_code": "US",
// "postal_code": "73301",
// "phone": "+00000000",
// "state": "Texas"
// },
// }
// }
// ],
// note:
// "Contact us for any questions on your order.",
// onSuccess: (Map params) async {
// print("onSuccess: $params");
// },
// onError: (error) {
// print("onError: $error");
// },
// onCancel: (params) {
// print('cancelled: $params');
// },
// )
// );
},
),
],
controller.isCashSelectedBeforeConfirmRide ==
false
? MyElevatedButton(
title: 'Next'.tr,
onPressed: () {
controller
.changeCashConfirmPageShown();
},
)
: controller.isPassengerChosen ==
false
? MyElevatedButton(
title: 'Next'.tr,
onPressed: () {
controller
.onChangedPassengersChoose();
Get.defaultDialog(
barrierDismissible:
false,
title:
'How Many Passengers?'
.tr,
titleStyle:
AppStyle.title,
content: Column(
children: [
Text(
'Allowed up to 4 Passengers.'
.tr,
style: AppStyle
.title,
),
SizedBox(
height:
200, // Set the desired height here
child:
CupertinoPicker(
itemExtent:
32,
onSelectedItemChanged:
(index) {
controller.onChangedPassengerCount(
index +
1);
},
children: [
Text('1 Passenger'
.tr),
Text('2 Passengers'
.tr),
Text('3 Passengers'
.tr),
Text('4 Passengers'
.tr),
],
),
),
MyElevatedButton(
title: 'Back',
onPressed: () =>
Get.back(),
)
],
),
);
},
)
: MyElevatedButton(
title: 'Confirm Selection'
.tr,
onPressed: () {
controller
.changeConfirmRide();
},
),
],
),
)
],
),