From bc92709f9c04b1ccba7df99339544da8d28aaa09 Mon Sep 17 00:00:00 2001 From: Hamza Aleghwairyeen Date: Mon, 8 Apr 2024 20:40:02 +0300 Subject: [PATCH] 4/7/10 --- lib/controller/home/map_passenger_controller.dart | 10 ++++++++-- .../notification/notification_captain_controller.dart | 9 +++++++++ .../home/map_widget.dart/ride_begin_passenger.dart | 6 ------ .../home/map_widget.dart/ride_from_start_app.dart | 2 -- lib/views/home/profile/passenger_profile_page.dart | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/lib/controller/home/map_passenger_controller.dart b/lib/controller/home/map_passenger_controller.dart index cb16910..880c9d8 100644 --- a/lib/controller/home/map_passenger_controller.dart +++ b/lib/controller/home/map_passenger_controller.dart @@ -116,6 +116,7 @@ class MapPassengerController extends GetxController { bool startLocationFromMap4 = false; List startLocationFromMapAll = []; double latePrice = 0; + double fuelPrice = 0; double heavyPrice = 0; double naturePrice = 0; bool heightMenuBool = false; @@ -2438,12 +2439,17 @@ class MapPassengerController extends GetxController { double passengerRate = 5; getKazanPercent() async { - var res = await CRUD().get(link: AppLink.getKazanPercent); + var res = await CRUD().get( + link: AppLink.getKazanPercent, + payload: {'country': box.read(BoxName.countryCode).toString()}, + ); if (res != 'failure') { + // print(jsonDecode(res)); kazan = double.parse(jsonDecode(res)['message'][0]['kazan']); naturePrice = double.parse(jsonDecode(res)['message'][0]['naturePrice']); heavyPrice = double.parse(jsonDecode(res)['message'][0]['heavyPrice']); latePrice = double.parse(jsonDecode(res)['message'][0]['latePrice']); + fuelPrice = double.parse(jsonDecode(res)['message'][0]['fuelPrice']); } } @@ -2452,7 +2458,7 @@ class MapPassengerController extends GetxController { link: AppLink.getPassengerRate, payload: {'passenger_id': box.read(BoxName.passengerID)}); if (res != 'failure') { - passengerRate = jsonDecode(res)['message']['rating']; + passengerRate = jsonDecode(res)['message']['rating'].toDouble(); } } diff --git a/lib/controller/notification/notification_captain_controller.dart b/lib/controller/notification/notification_captain_controller.dart index 07ba1e4..d083d3b 100644 --- a/lib/controller/notification/notification_captain_controller.dart +++ b/lib/controller/notification/notification_captain_controller.dart @@ -47,6 +47,15 @@ class NotificationCaptainController extends GetxController { ); } + addNotificationCaptain(String driverId, title, body, isPin) async { + await CRUD().post(link: AppLink.addNotificationCaptain, payload: { + 'driverID': driverId, + 'title': title, + 'body': body, + 'isPin': isPin + }); + } + @override void onInit() { getNotifications(); diff --git a/lib/views/home/map_widget.dart/ride_begin_passenger.dart b/lib/views/home/map_widget.dart/ride_begin_passenger.dart index 4fb74f7..c34fcd5 100644 --- a/lib/views/home/map_widget.dart/ride_begin_passenger.dart +++ b/lib/views/home/map_widget.dart/ride_begin_passenger.dart @@ -113,8 +113,6 @@ class RideBeginPassenger extends StatelessWidget { CircleAvatar( radius: 30, backgroundImage: NetworkImage( - // '', - // ), 'https://ride.mobile-app.store/portrate_captain_image/${controller.driverId}.jpg'), ), Text( @@ -127,10 +125,6 @@ class RideBeginPassenger extends StatelessWidget { '${controller.driverRate} 📈', style: AppStyle.title, ), - // Text( - // '${controller.rideStatusFromStartApp['data']['carType']}', - // style: AppStyle.title, - // ), ], ), ], diff --git a/lib/views/home/map_widget.dart/ride_from_start_app.dart b/lib/views/home/map_widget.dart/ride_from_start_app.dart index 6ea4c94..e92c80e 100644 --- a/lib/views/home/map_widget.dart/ride_from_start_app.dart +++ b/lib/views/home/map_widget.dart/ride_from_start_app.dart @@ -42,8 +42,6 @@ class RideFromStartApp extends StatelessWidget { style: AppStyle.title, ), Text( - // controller.rideStatusFromStartApp['data'] - // ['endtime'], box.read(BoxName.arrivalTime), style: AppStyle.title, ), diff --git a/lib/views/home/profile/passenger_profile_page.dart b/lib/views/home/profile/passenger_profile_page.dart index f1699ef..8e669e0 100644 --- a/lib/views/home/profile/passenger_profile_page.dart +++ b/lib/views/home/profile/passenger_profile_page.dart @@ -307,7 +307,7 @@ class CountryPicker extends StatelessWidget { final List countryOptions = [ 'Jordan'.tr, 'USA'.tr, - 'Egypt'.tr, + 'Eygpt'.tr, 'Turkey'.tr, 'Saudi Arabia'.tr, 'Qatar'.tr,