refactor: upgrade API endpoints to v3 and refactor navigation and response handling across controllers

This commit is contained in:
Hamza-Ayed
2026-04-28 01:13:15 +03:00
parent 13ef5f21b7
commit 6bfc15abb2
10 changed files with 366 additions and 220 deletions

View File

@@ -638,7 +638,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
children: [
Expanded(
child: TextButton(
onPressed: () => Get.back(),
onPressed: () => Navigator.of(context).pop(),
style: TextButton.styleFrom(
foregroundColor: Colors.grey,
),
@@ -653,7 +653,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
if (controller.promoFormKey.currentState!
.validate()) {
controller.applyPromoCodeToPassenger(context);
Get.back();
Navigator.of(context).pop();
}
},
),
@@ -779,7 +779,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
children: [
Expanded(
child: TextButton(
onPressed: () => Get.back(),
onPressed: () => Navigator.of(context).pop(),
style: TextButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 12),
shape: RoundedRectangleBorder(
@@ -799,7 +799,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
kolor: AppColor.greenColor,
title: 'Select This Ride'.tr,
onPressed: () {
Get.back();
Navigator.of(context).pop();
_handleCarSelection(
context, mapPassengerController, carType);
},
@@ -886,7 +886,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
mapPassengerController.totalPassenger =
_getOriginalPrice(carType, mapPassengerController);
if (carType.carType == 'Mishwar Vip') {
Get.back();
Navigator.of(context).pop();
mapPassengerController.mishwariOption();
} else if (carType.carType == 'Lady') {
if (box.read(BoxName.gender).toString() != '') {
@@ -905,17 +905,17 @@ class CarDetailsTypeToChoose extends StatelessWidget {
title: "Select betweeen types".tr,
content:
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
_buildRayehGaiOption(mapPassengerController, 'Awfar Car',
_buildRayehGaiOption(context, mapPassengerController, 'Awfar Car',
mapPassengerController.totalPassengerRayehGaiBalash),
_buildRayehGaiOption(mapPassengerController, 'Fixed Price',
_buildRayehGaiOption(context, mapPassengerController, 'Fixed Price',
mapPassengerController.totalPassengerRayehGai),
_buildRayehGaiOption(mapPassengerController, 'Comfort',
_buildRayehGaiOption(context, mapPassengerController, 'Comfort',
mapPassengerController.totalPassengerRayehGaiComfort)
]),
cancel: MyElevatedButton(
kolor: AppColor.redColor,
title: 'Cancel'.tr,
onPressed: () => Get.back()),
onPressed: () => Navigator.of(context).pop()),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
title: 'Next'.tr,
@@ -951,11 +951,14 @@ class CarDetailsTypeToChoose extends StatelessWidget {
}
}
Widget _buildRayehGaiOption(MapPassengerController mapPassengerController,
String carTypeName, double price) {
Widget _buildRayehGaiOption(
BuildContext context,
MapPassengerController mapPassengerController,
String carTypeName,
double price) {
return GestureDetector(
onTap: () {
Get.back();
Navigator.of(context).pop();
mapPassengerController.totalPassenger = price;
mapPassengerController.isBottomSheetShown = false;
mapPassengerController.update();

View File

@@ -16,7 +16,7 @@ class NotificationPage extends StatelessWidget {
Get.put(PassengerNotificationController());
return MyScafolld(
isleading: true,
title: 'Notifications',
title: 'Notifications'.tr,
body: [
GetBuilder<PassengerNotificationController>(
builder: (notificationCaptainController) => notificationCaptainController