This commit is contained in:
Hamza-Ayed
2024-05-10 14:53:16 +03:00
parent c5ac5c2b22
commit 4192c1e471
9 changed files with 166 additions and 77 deletions

View File

@@ -60,7 +60,7 @@ class HomePage extends StatelessWidget {
ListTile(
leading: const Icon(Icons.question_answer),
title: Text(
'Frequently questions'.tr,
'Frequently Questions'.tr,
style: AppStyle.headTitle2,
),
subtitle:

View File

@@ -29,6 +29,10 @@ List<CarType> carTypes = [
carType: 'Speed',
carDetail: 'Closest & Cheapest'.tr,
image: 'assets/images/carspeed.png'),
CarType(
carType: 'Lady',
carDetail: 'Lady Captain for girls'.tr,
image: 'assets/images/blob.png'),
CarType(
carType: 'Delivery',
carDetail: 'Delivery service'.tr,
@@ -91,7 +95,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
height: 50,
),
SizedBox(
width: Get.width * .4,
width: Get.width * .25,
child: Column(
children: [
Text(
@@ -100,32 +104,36 @@ class CarDetailsTypeToChoose extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 20),
),
Text(
carType.carDetail,
style: AppStyle.subtitle,
),
// Text(
// carType.carDetail,
// style: AppStyle.subtitle,
// ),
],
),
),
Column(
children: [
Text(
carType.carType == 'Comfort'
Text(
carType.carType == 'Comfort'
? mapPassengerController
.totalPassengerComfort
.toStringAsFixed(2)
: carType.carType == 'Speed'
? mapPassengerController
.totalPassengerComfort
.totalPassengerSpeed
.toStringAsFixed(2)
: carType.carType == 'Speed'
: carType.carType == 'Delivery'
? mapPassengerController
.totalPassengerSpeed
.totalPassengerMotoDelivery
.toStringAsFixed(2)
: carType.carType == 'Delivery'
: carType.carType == 'Lady'
? mapPassengerController
.totalPassengerMotoDelivery
.totalPassengerLady
.toStringAsFixed(2)
: '50',
style: AppStyle.title
.copyWith(fontSize: 20),
),
style:
AppStyle.title.copyWith(fontSize: 20),
),
Row(
children: [
carType.carType == 'Comfort' &&
(mapPassengerController
.totalPassengerSpeed >
@@ -192,9 +200,45 @@ class CarDetailsTypeToChoose extends StatelessWidget {
)
],
)
: const SizedBox(
width: 3,
),
: carType.carType == 'Lady' &&
(mapPassengerController
.totalPassengerLady >
20)
? Row(
children: [
Container(
decoration: AppStyle
.boxDecoration1,
child: Text(
'-10%',
style: AppStyle
.subtitle
.copyWith(
color: AppColor
.greenColor),
)),
const SizedBox(
width: 10,
),
Text(
mapPassengerController
.totalPassengerLadyDiscount
.toStringAsFixed(
2),
style: AppStyle.title
.copyWith(
color: AppColor
.redColor,
decoration:
TextDecoration
.lineThrough, // Strikethrough line
),
)
],
)
: const SizedBox(
width: 3,
),
],
),
const SizedBox(
@@ -283,7 +327,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
}));
} else if (mapPassengerController
.selectedIndex ==
2) {
3) {
box.write(BoxName.carType, 'Delivery');
mapPassengerController.totalPassenger =
mapPassengerController
@@ -317,7 +361,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
}));
} else if (mapPassengerController
.selectedIndex ==
3) {
4) {
box.write(BoxName.carType, 'Mashwari');
mapPassengerController.totalPassenger = 50;
Get.defaultDialog(
@@ -347,49 +391,49 @@ class CarDetailsTypeToChoose extends StatelessWidget {
onPressed: () {
Get.back();
}));
} else if (mapPassengerController
.selectedIndex ==
2) {
box.write(BoxName.carType, 'Lady');
mapPassengerController.totalPassenger =
mapPassengerController
.totalPassengerSpeed;
Get.defaultDialog(
title: 'Lady',
titleStyle: AppStyle.title,
content: CarDialogue(
textToSpeechController:
textToSpeechController,
image: 'assets/images/blob.png',
text: 'This trip just for girls only'
.tr),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
title: 'Next'.tr,
onPressed: () {
Get.back();
mapPassengerController
.isBottomSheetShown = false;
mapPassengerController.update();
mapPassengerController
.changeCashConfirmPageShown();
}),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
Get.back();
}));
} else {
Get.snackbar('You should select one'.tr, '',
backgroundColor: AppColor.redColor);
}
} else {
Get.snackbar('You should select one'.tr, '',
backgroundColor: AppColor.redColor);
}
},
);
},
),
),
// MyElevatedButton(
// title: 'Next'.tr,
// onPressed: () {
// if (mapPassengerController.selectedIndex != -1) {
// // Get.snackbar('You should select one'.tr, '',
// // backgroundColor: AppColor.greenColor);
// if (mapPassengerController.selectedIndex == 0) {
// box.write(BoxName.carType, 'Comfort');
// mapPassengerController.totalPassenger =
// mapPassengerController.totalPassengerComfort;
// } else if (mapPassengerController.selectedIndex ==
// 1) {
// box.write(BoxName.carType, 'Speed');
// } else if (mapPassengerController.selectedIndex ==
// 2) {
// box.write(BoxName.carType, 'Delivery');
// mapPassengerController.totalPassenger =
// mapPassengerController
// .totalPassengerMotoDelivery;
// } else if (mapPassengerController.selectedIndex ==
// 3) {
// box.write(BoxName.carType, 'FreeRide');
// mapPassengerController.totalPassenger = 50;
// }
// mapPassengerController.isBottomSheetShown = false;
// mapPassengerController.update();
// mapPassengerController.changeCashConfirmPageShown();
// // mapPassengerController.confirmRideForFirstDriver();
// } else {
// Get.snackbar('You should select one'.tr, '',
// backgroundColor: AppColor.redColor);
// }
// })
],
),
),

View File

@@ -29,7 +29,9 @@ class CashConfirmPageShown extends StatelessWidget {
? controller.cashConfirmPageShown
: 0,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
color: box.read(BoxName.carType) == 'Lady'
? Colors.pink.shade100
: AppColor.secondaryColor,
borderRadius: BorderRadius.circular(15)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
@@ -70,7 +72,7 @@ class CashConfirmPageShown extends StatelessWidget {
),
Text(
// '${'Your Wallet balance is '.tr}JD ',
'${'Your Wallet balance is '.tr} ${box.read(BoxName.passengerWalletTotal).toString()}${' \$'.tr}',
'${'Your Wallet balance is '.tr} ${box.read(BoxName.passengerWalletTotal).toString()} ${box.read(BoxName.countryCode) == 'Egypt' ? 'LE'.tr : 'JOD'.tr}',
style: AppStyle.subtitle,
),
],
@@ -159,7 +161,7 @@ class CashConfirmPageShown extends StatelessWidget {
),
MyElevatedButton(
kolor: AppColor.greenColor,
title: 'Next as Cash \$\$!'.tr,
title: '\$ Next as Cash \$!'.tr,
onPressed: () {
paymentController.isCashChecked = true;
paymentController.isWalletChecked = false;

View File

@@ -288,7 +288,7 @@ class MainBottomMenuMap extends StatelessWidget {
children: [
IconButton(
onPressed: () {
controller.changeMainBottomMenuMap();
// controller.changeMainBottomMenuMap();
},
icon: controller.isMainBottomMenuMap
? const Icon(