This commit is contained in:
Hamza-Ayed
2024-11-09 10:49:04 +02:00
parent fc81405b7a
commit 213c2724aa
44 changed files with 3009 additions and 1130 deletions

View File

@@ -3,11 +3,11 @@ import 'package:get/get.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/home/map_passenger_controller.dart';
import '../../widgets/elevated_btn.dart';
GetBuilder<MapPassengerController> cancelRidePage() {
Get.put(MapPassengerController());
final List<String> reasons = [
"I don't need a ride anymore".tr,
"I was just trying the application".tr,
@@ -16,80 +16,74 @@ GetBuilder<MapPassengerController> cancelRidePage() {
"I don't have a reason".tr,
"Other".tr,
];
return GetBuilder<MapPassengerController>(
builder: (controller) => controller.isCancelRidePageShown
? Positioned(
left: Get.width * .1,
top: Get.width * .2,
right: Get.width * .1,
bottom: Get.width * .15,
left: 20,
top: Get.height * 0.15,
right: 20,
bottom: Get.height * 0.15,
child: Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: AppColor.secondaryColor,
color: Colors.white,
boxShadow: [
const BoxShadow(
color: AppColor.accentColor,
offset: Offset(2, 2),
blurRadius: 5),
BoxShadow(
color: AppColor.accentColor.withOpacity(.4),
offset: const Offset(-2, -2),
blurRadius: 5)
color: Colors.black.withOpacity(0.2),
offset: const Offset(0, 8),
blurRadius: 16,
),
],
borderRadius: const BorderRadius.all(Radius.circular(15)),
borderRadius: BorderRadius.circular(20),
),
height: Get.height * .7,
width: Get.width * .7,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
'Can we know why you want to cancel Ride ?'.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
Text(
'Can we know why you want to cancel Ride ?'.tr,
style: AppStyle.title
.copyWith(fontSize: 18, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
SizedBox(
height: 380,
width: 300,
child: ListView.builder(
const SizedBox(height: 20),
Expanded(
child: ListView.separated(
itemCount: reasons.length,
separatorBuilder: (context, index) => const Divider(),
itemBuilder: (context, index) {
return ListTile(
title: InkWell(
onTap: () {
controller.selectReason(
index,
reasons[index].toString(),
);
},
child: Text(
reasons[index],
style: AppStyle.title,
)),
title: Text(
reasons[index],
style: AppStyle.title.copyWith(fontSize: 16),
),
leading: Radio(
value: index,
groupValue: controller.selectedReason,
onChanged: (int? value) {
controller.selectReason(
value!,
reasons[index].toString(),
);
controller.selectReason(value!, reasons[index]);
},
activeColor: AppColor.primaryColor,
),
onTap: () {
controller.selectReason(index, reasons[index]);
},
);
},
),
),
const SizedBox(height: 20),
MyElevatedButton(
title: 'Cancel Ride'.tr,
onPressed: () {
if (controller.selectedReason == -1) {
Get.snackbar('You Should be select reason.'.tr, '',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: AppColor.redColor);
Get.snackbar(
'You Should be select reason.'.tr,
'',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: AppColor.redColor,
colorText: Colors.white,
);
} else {
controller.cancelRide();
}