diff --git a/lib/controller/home/captin/map_driver_controller.dart b/lib/controller/home/captin/map_driver_controller.dart index aea2700..cd4df9a 100644 --- a/lib/controller/home/captin/map_driver_controller.dart +++ b/lib/controller/home/captin/map_driver_controller.dart @@ -104,14 +104,14 @@ class MapDriverController extends GetxController { myLocation = myLocation; mapController = controller; controller.getVisibleRegion(); - controller.animateCamera( - CameraUpdate.newLatLng(myLocation), - ); - update(); // Set up a timer or interval to trigger the marker update every 3 seconds. timer = Timer.periodic(const Duration(seconds: 1), (_) { updateMarker(); + controller.animateCamera( + CameraUpdate.newLatLng(myLocation), + ); + update(); }); } @@ -534,7 +534,7 @@ class MapDriverController extends GetxController { // Get.back(); } - void cancelCheckRidefromPassenger() async { + void cancelCheckRideFromPassenger() async { var res = await CRUD().get(link: AppLink.getOrderCancelStatus, payload: { 'order_id': rideId, }); //.then((value) { @@ -626,7 +626,7 @@ class MapDriverController extends GetxController { markers.add( Marker( markerId: MarkerId('MyLocation'.tr), - position: locationController.myLocation, + position: myLocation, draggable: true, icon: carIcon, rotation: locationController.heading, @@ -637,7 +637,7 @@ class MapDriverController extends GetxController { ); mapController!.animateCamera( - CameraUpdate.newLatLng(locationController.myLocation), + CameraUpdate.newLatLng(myLocation), ); update(); } diff --git a/lib/controller/home/map_passenger_controller.dart b/lib/controller/home/map_passenger_controller.dart index c81eda4..32ffa0d 100644 --- a/lib/controller/home/map_passenger_controller.dart +++ b/lib/controller/home/map_passenger_controller.dart @@ -627,6 +627,7 @@ class MapPassengerController extends GetxController { update(); // isCancelRidePageShown = true; rideIsBeginPassengerTimer(); + runWhenRideIsBegin(); // //print('rideTimerBegin: $rideTimerBegin'); } } catch (e) { @@ -670,7 +671,7 @@ class MapPassengerController extends GetxController { // isCancelRidePageShown = true; update(); rideIsBeginPassengerTimer(); - runWhenRideIsBegin(); + // runWhenRideIsBegin(); } void cancelTimerToPassengerFromDriverAfterApplied() { @@ -1658,7 +1659,7 @@ class MapPassengerController extends GetxController { // }); // } - Future startMarkerReloading() async { + startMarkerReloading() async { int reloadCount = 0; Timer.periodic(const Duration(seconds: 2), (timer) { @@ -2344,7 +2345,7 @@ class MapPassengerController extends GetxController { await getLocation(); await addToken(); await getKazanPercent(); - await startMarkerReloading(); + startMarkerReloading(); // await getCarsLocationByPassenger(); // await getNearestDriverByPassengerLocation(); addCustomPicker(); diff --git a/lib/controller/local/translations.dart b/lib/controller/local/translations.dart index 23bccc2..c8925a4 100644 --- a/lib/controller/local/translations.dart +++ b/lib/controller/local/translations.dart @@ -632,7 +632,8 @@ class MyTranslation extends Translations { 'created time': "وقت الرحله", 'Speed Over': 'سرعة عالية', 'I will slow down': 'حاضر هخفف', - 'Map Passenger': 'خارطه الراكب',"Be Slowly": "خفف شوية من السرعة", + 'Map Passenger': 'خارطه الراكب', + "Be Slowly": "خفف شوية من السرعة", "If you want to make Google Map App run directly when you apply order": "إذا كنت تريد أن تفتح تطبيق خرائط جوجل مباشرة عند طلب الخدمة", "You can change the language of the app": "يمكنك تغيير لغة التطبيق", diff --git a/lib/views/home/Captin/mapDriverWidgets/driver_end_ride_bar.dart b/lib/views/home/Captin/mapDriverWidgets/driver_end_ride_bar.dart index bb370c2..4d114fb 100644 --- a/lib/views/home/Captin/mapDriverWidgets/driver_end_ride_bar.dart +++ b/lib/views/home/Captin/mapDriverWidgets/driver_end_ride_bar.dart @@ -65,8 +65,8 @@ GetBuilder driverEndRideBar() { Text(mapDriverController.rideTimerFromBegin .toStringAsFixed(0)), const Icon(Icons.location_on), - Text(mapDriverController.recentDistanceToDash - .toStringAsFixed(0)), + Text( + '${mapDriverController.recentDistanceToDash.toStringAsFixed(0)} ${'KM'.tr}'), const Icon(Icons.attach_money), Text(mapDriverController.price.toStringAsFixed(0)), ], @@ -85,8 +85,7 @@ GetBuilder driverEndRideBar() { ], ) : const SizedBox(), - mapDriverController.remainingTimeTimerRideBegin < 60 && - mapDriverController.carType != 'Free Ride' + mapDriverController.remainingTimeTimerRideBegin < 60 ? Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/views/home/Captin/mapDriverWidgets/sos_connect.dart b/lib/views/home/Captin/mapDriverWidgets/sos_connect.dart index 9a5f6c6..c89177d 100644 --- a/lib/views/home/Captin/mapDriverWidgets/sos_connect.dart +++ b/lib/views/home/Captin/mapDriverWidgets/sos_connect.dart @@ -42,8 +42,8 @@ class SosConnect extends StatelessWidget { child: MyTextForm( controller: mapDriverController .sosEmergincyNumberCotroller, - label: 'Insert Emergincy Number'.tr, - hint: 'Insert Emergincy Number'.tr, + label: 'Insert Emergency Number'.tr, + hint: 'Insert Emergency Number'.tr, type: TextInputType.phone), ), confirm: MyElevatedButton( @@ -73,14 +73,14 @@ class SosConnect extends StatelessWidget { onTap: () { if (box.read(BoxName.sosPhoneDriver) == null) { Get.defaultDialog( - title: 'Insert Emergincy Number'.tr, + title: 'Insert Emergency Number'.tr, content: Form( key: mapDriverController.formKey1, child: MyTextForm( controller: mapDriverController .sosEmergincyNumberCotroller, - label: 'Insert Emergincy Number'.tr, - hint: 'Insert Emergincy Number'.tr, + label: 'Insert Emergency Number'.tr, + hint: 'Insert Emergency Number'.tr, type: TextInputType.phone), ), confirm: MyElevatedButton( @@ -99,7 +99,7 @@ class SosConnect extends StatelessWidget { } else { launchCommunication( 'whatsapp', - '+962${box.read(BoxName.sosPhoneDriver)}', //todo add number from driver + '+02${box.read(BoxName.sosPhoneDriver)}', //todo add number from driver "${"Hello this is Driver".tr} ${box.read(BoxName.nameDriver)}.${" My current location is:".tr} https://www.google.com/maps/place/${Get.find().myLocation.latitude},${Get.find().myLocation.longitude}${" \nand I have a trip on".tr} ${AppInformation.appName} ${"App \nwith Passenger ".tr}${mapDriverController.passengerName}"); } },