refactor: upgrade API endpoints to v3 and refactor navigation and response handling across controllers
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user