This commit is contained in:
Hamza Aleghwairyeen
2024-04-02 23:03:14 +03:00
parent e822f8c552
commit 682da605c5
5 changed files with 22 additions and 21 deletions

View File

@@ -104,14 +104,14 @@ class MapDriverController extends GetxController {
myLocation = myLocation; myLocation = myLocation;
mapController = controller; mapController = controller;
controller.getVisibleRegion(); controller.getVisibleRegion();
controller.animateCamera(
CameraUpdate.newLatLng(myLocation),
);
update();
// Set up a timer or interval to trigger the marker update every 3 seconds. // Set up a timer or interval to trigger the marker update every 3 seconds.
timer = Timer.periodic(const Duration(seconds: 1), (_) { timer = Timer.periodic(const Duration(seconds: 1), (_) {
updateMarker(); updateMarker();
controller.animateCamera(
CameraUpdate.newLatLng(myLocation),
);
update();
}); });
} }
@@ -534,7 +534,7 @@ class MapDriverController extends GetxController {
// Get.back(); // Get.back();
} }
void cancelCheckRidefromPassenger() async { void cancelCheckRideFromPassenger() async {
var res = await CRUD().get(link: AppLink.getOrderCancelStatus, payload: { var res = await CRUD().get(link: AppLink.getOrderCancelStatus, payload: {
'order_id': rideId, 'order_id': rideId,
}); //.then((value) { }); //.then((value) {
@@ -626,7 +626,7 @@ class MapDriverController extends GetxController {
markers.add( markers.add(
Marker( Marker(
markerId: MarkerId('MyLocation'.tr), markerId: MarkerId('MyLocation'.tr),
position: locationController.myLocation, position: myLocation,
draggable: true, draggable: true,
icon: carIcon, icon: carIcon,
rotation: locationController.heading, rotation: locationController.heading,
@@ -637,7 +637,7 @@ class MapDriverController extends GetxController {
); );
mapController!.animateCamera( mapController!.animateCamera(
CameraUpdate.newLatLng(locationController.myLocation), CameraUpdate.newLatLng(myLocation),
); );
update(); update();
} }

View File

@@ -627,6 +627,7 @@ class MapPassengerController extends GetxController {
update(); update();
// isCancelRidePageShown = true; // isCancelRidePageShown = true;
rideIsBeginPassengerTimer(); rideIsBeginPassengerTimer();
runWhenRideIsBegin();
// //print('rideTimerBegin: $rideTimerBegin'); // //print('rideTimerBegin: $rideTimerBegin');
} }
} catch (e) { } catch (e) {
@@ -670,7 +671,7 @@ class MapPassengerController extends GetxController {
// isCancelRidePageShown = true; // isCancelRidePageShown = true;
update(); update();
rideIsBeginPassengerTimer(); rideIsBeginPassengerTimer();
runWhenRideIsBegin(); // runWhenRideIsBegin();
} }
void cancelTimerToPassengerFromDriverAfterApplied() { void cancelTimerToPassengerFromDriverAfterApplied() {
@@ -1658,7 +1659,7 @@ class MapPassengerController extends GetxController {
// }); // });
// } // }
Future startMarkerReloading() async { startMarkerReloading() async {
int reloadCount = 0; int reloadCount = 0;
Timer.periodic(const Duration(seconds: 2), (timer) { Timer.periodic(const Duration(seconds: 2), (timer) {
@@ -2344,7 +2345,7 @@ class MapPassengerController extends GetxController {
await getLocation(); await getLocation();
await addToken(); await addToken();
await getKazanPercent(); await getKazanPercent();
await startMarkerReloading(); startMarkerReloading();
// await getCarsLocationByPassenger(); // await getCarsLocationByPassenger();
// await getNearestDriverByPassengerLocation(); // await getNearestDriverByPassengerLocation();
addCustomPicker(); addCustomPicker();

View File

@@ -632,7 +632,8 @@ class MyTranslation extends Translations {
'created time': "وقت الرحله", 'created time': "وقت الرحله",
'Speed Over': 'سرعة عالية', 'Speed Over': 'سرعة عالية',
'I will slow down': 'حاضر هخفف', '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": "If you want to make Google Map App run directly when you apply order":
"إذا كنت تريد أن تفتح تطبيق خرائط جوجل مباشرة عند طلب الخدمة", "إذا كنت تريد أن تفتح تطبيق خرائط جوجل مباشرة عند طلب الخدمة",
"You can change the language of the app": "يمكنك تغيير لغة التطبيق", "You can change the language of the app": "يمكنك تغيير لغة التطبيق",

View File

@@ -65,8 +65,8 @@ GetBuilder<MapDriverController> driverEndRideBar() {
Text(mapDriverController.rideTimerFromBegin Text(mapDriverController.rideTimerFromBegin
.toStringAsFixed(0)), .toStringAsFixed(0)),
const Icon(Icons.location_on), const Icon(Icons.location_on),
Text(mapDriverController.recentDistanceToDash Text(
.toStringAsFixed(0)), '${mapDriverController.recentDistanceToDash.toStringAsFixed(0)} ${'KM'.tr}'),
const Icon(Icons.attach_money), const Icon(Icons.attach_money),
Text(mapDriverController.price.toStringAsFixed(0)), Text(mapDriverController.price.toStringAsFixed(0)),
], ],
@@ -85,8 +85,7 @@ GetBuilder<MapDriverController> driverEndRideBar() {
], ],
) )
: const SizedBox(), : const SizedBox(),
mapDriverController.remainingTimeTimerRideBegin < 60 && mapDriverController.remainingTimeTimerRideBegin < 60
mapDriverController.carType != 'Free Ride'
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [

View File

@@ -42,8 +42,8 @@ class SosConnect extends StatelessWidget {
child: MyTextForm( child: MyTextForm(
controller: mapDriverController controller: mapDriverController
.sosEmergincyNumberCotroller, .sosEmergincyNumberCotroller,
label: 'Insert Emergincy Number'.tr, label: 'Insert Emergency Number'.tr,
hint: 'Insert Emergincy Number'.tr, hint: 'Insert Emergency Number'.tr,
type: TextInputType.phone), type: TextInputType.phone),
), ),
confirm: MyElevatedButton( confirm: MyElevatedButton(
@@ -73,14 +73,14 @@ class SosConnect extends StatelessWidget {
onTap: () { onTap: () {
if (box.read(BoxName.sosPhoneDriver) == null) { if (box.read(BoxName.sosPhoneDriver) == null) {
Get.defaultDialog( Get.defaultDialog(
title: 'Insert Emergincy Number'.tr, title: 'Insert Emergency Number'.tr,
content: Form( content: Form(
key: mapDriverController.formKey1, key: mapDriverController.formKey1,
child: MyTextForm( child: MyTextForm(
controller: mapDriverController controller: mapDriverController
.sosEmergincyNumberCotroller, .sosEmergincyNumberCotroller,
label: 'Insert Emergincy Number'.tr, label: 'Insert Emergency Number'.tr,
hint: 'Insert Emergincy Number'.tr, hint: 'Insert Emergency Number'.tr,
type: TextInputType.phone), type: TextInputType.phone),
), ),
confirm: MyElevatedButton( confirm: MyElevatedButton(
@@ -99,7 +99,7 @@ class SosConnect extends StatelessWidget {
} else { } else {
launchCommunication( launchCommunication(
'whatsapp', '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<LocationController>().myLocation.latitude},${Get.find<LocationController>().myLocation.longitude}${" \nand I have a trip on".tr} ${AppInformation.appName} ${"App \nwith Passenger ".tr}${mapDriverController.passengerName}"); "${"Hello this is Driver".tr} ${box.read(BoxName.nameDriver)}.${" My current location is:".tr} https://www.google.com/maps/place/${Get.find<LocationController>().myLocation.latitude},${Get.find<LocationController>().myLocation.longitude}${" \nand I have a trip on".tr} ${AppInformation.appName} ${"App \nwith Passenger ".tr}${mapDriverController.passengerName}");
} }
}, },