4/1/1
This commit is contained in:
@@ -270,34 +270,6 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: RichText(
|
||||
// text: TextSpan(
|
||||
// text: 'Duration To Passenger is '.tr,
|
||||
// style: AppStyle.title,
|
||||
// children: [
|
||||
// TextSpan(
|
||||
// text: myList[11].toString(),
|
||||
// style: AppStyle.headTitle2),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: RichText(
|
||||
// text: TextSpan(
|
||||
// text: 'Distance To Passenger is '.tr,
|
||||
// style: AppStyle.title,
|
||||
// children: [
|
||||
// TextSpan(
|
||||
// text: myList[12].toString(),
|
||||
// style: AppStyle.headTitle2),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Container(
|
||||
@@ -315,36 +287,6 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: RichText(
|
||||
// text: TextSpan(
|
||||
// text: 'Distance from Passenger to destination is '.tr,
|
||||
// style: AppStyle.title,
|
||||
// children: [
|
||||
// TextSpan(
|
||||
// text: myList[5].toString(),
|
||||
// style: AppStyle.headTitle2),
|
||||
// TextSpan(text: ' KM'.tr, style: AppStyle.title),
|
||||
// ]),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: RichText(
|
||||
// text: TextSpan(
|
||||
// text: 'Duration of Trip is '.tr,
|
||||
// style: AppStyle.title,
|
||||
// children: [
|
||||
// TextSpan(
|
||||
// text: hours > 1
|
||||
// ? '${'Your Ride Duration is '.tr}$hours${' H and'.tr} $minutes m'
|
||||
// : '${'Your Ride Duration is '.tr} $minutes m',
|
||||
// style: AppStyle.title),
|
||||
// TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
||||
// ]),
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
@@ -356,8 +298,6 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
onPressed: () async {
|
||||
box.write(BoxName.statusDriverLocation, 'on');
|
||||
|
||||
// orderRequestController.changeApplied();
|
||||
|
||||
var res = await CRUD()
|
||||
.post(link: AppLink.updateStausFromSpeed, payload: {
|
||||
'id': myList[16],
|
||||
@@ -378,8 +318,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
middleTextStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr, onPressed: () => Get.back()));
|
||||
} else if (json['message'] ==
|
||||
"Ride data updated successfully") {
|
||||
} else if (json['status'] == "success") {
|
||||
List<String> bodyToPassenger = [
|
||||
box.read(BoxName.driverID).toString(),
|
||||
box.read(BoxName.nameDriver).toString(),
|
||||
|
||||
@@ -44,7 +44,7 @@ class MapPagePassenger extends StatelessWidget {
|
||||
const MapMenuWidget(),
|
||||
const MenuIconMapPageWidget(),
|
||||
buttomSheetMapPage(),
|
||||
const CarDetailsTypeToChoose(),
|
||||
CarDetailsTypeToChoose(),
|
||||
const ApplyOrderWidget(),
|
||||
// hexagonClipper(),
|
||||
const CancelRidePageShow(),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
|
||||
class CarType {
|
||||
@@ -31,11 +32,15 @@ List<CarType> carTypes = [
|
||||
carType: 'Delivery'.tr,
|
||||
carDetail: 'Delivery service'.tr,
|
||||
image: 'assets/images/moto.png'),
|
||||
CarType(
|
||||
carType: 'Free Ride'.tr,
|
||||
carDetail: 'free ride without end point'.tr,
|
||||
image: 'assets/images/freeRide.png'),
|
||||
];
|
||||
|
||||
class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
const CarDetailsTypeToChoose({super.key});
|
||||
|
||||
CarDetailsTypeToChoose({super.key});
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
@@ -59,7 +64,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Get.height * .3,
|
||||
height: Get.height * .4,
|
||||
child: ListView.builder(
|
||||
itemCount: carTypes.length,
|
||||
itemBuilder: (context, index) {
|
||||
@@ -117,9 +122,11 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
? mapPassengerController
|
||||
.totalPassenger
|
||||
.toStringAsFixed(2)
|
||||
: mapPassengerController
|
||||
.totalPassengerMotoDelivery
|
||||
.toStringAsFixed(2),
|
||||
: carType.carType == 'Delivery'
|
||||
? mapPassengerController
|
||||
.totalPassengerMotoDelivery
|
||||
.toStringAsFixed(2)
|
||||
: '50',
|
||||
style: AppStyle.title
|
||||
.copyWith(fontSize: 20),
|
||||
),
|
||||
@@ -177,40 +184,184 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
|
||||
onTap: () {
|
||||
mapPassengerController.selectCarFromList(index);
|
||||
|
||||
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;
|
||||
Get.defaultDialog(
|
||||
title: 'Comfort',
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
textToSpeechController,
|
||||
image: 'assets/images/blob.png',
|
||||
text:
|
||||
'Best choice for comfort car and flexible route and stops point'
|
||||
.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 if (mapPassengerController
|
||||
.selectedIndex ==
|
||||
1) {
|
||||
box.write(BoxName.carType, 'Speed');
|
||||
mapPassengerController.totalPassenger =
|
||||
mapPassengerController.totalPassenger;
|
||||
Get.defaultDialog(
|
||||
title: 'Speed',
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
textToSpeechController,
|
||||
image: 'assets/images/carspeed.png',
|
||||
text:
|
||||
'This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route'
|
||||
.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 if (mapPassengerController
|
||||
.selectedIndex ==
|
||||
2) {
|
||||
box.write(BoxName.carType, 'Delivery');
|
||||
mapPassengerController.totalPassenger =
|
||||
mapPassengerController
|
||||
.totalPassengerMotoDelivery;
|
||||
Get.defaultDialog(
|
||||
title: 'Delivery',
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
textToSpeechController,
|
||||
image: 'assets/images/moto.png',
|
||||
text:
|
||||
'This is for delivery or a motorcycle.'
|
||||
.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 if (mapPassengerController
|
||||
.selectedIndex ==
|
||||
3) {
|
||||
box.write(BoxName.carType, 'FreeRide');
|
||||
mapPassengerController.totalPassenger = 50;
|
||||
Get.defaultDialog(
|
||||
title: 'FreeRide',
|
||||
titleStyle: AppStyle.title,
|
||||
content: CarDialogue(
|
||||
textToSpeechController:
|
||||
textToSpeechController,
|
||||
image: 'assets/images/freeRide.png',
|
||||
text:
|
||||
'Perfect for adventure seekers who want to experience something new and exciting'
|
||||
.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);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
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;
|
||||
}
|
||||
mapPassengerController.isBottomSheetShown = false;
|
||||
mapPassengerController.update();
|
||||
mapPassengerController.changeCashConfirmPageShown();
|
||||
// mapPassengerController.confirmRideForFirstDriver();
|
||||
} 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);
|
||||
// }
|
||||
// })
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -220,3 +371,44 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class CarDialogue extends StatelessWidget {
|
||||
const CarDialogue({
|
||||
super.key,
|
||||
required this.textToSpeechController,
|
||||
required this.image,
|
||||
required this.text,
|
||||
});
|
||||
|
||||
final TextToSpeechController textToSpeechController;
|
||||
final String image, text;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
image,
|
||||
width: 50,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
textToSpeechController.speakText(
|
||||
text,
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.headphones)),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
text.tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user