This commit is contained in:
Hamza-Ayed
2024-01-15 12:40:19 +03:00
parent dfbe9ba1b6
commit 474b523d3c
7 changed files with 61 additions and 30 deletions

View File

@@ -152,7 +152,7 @@ class GoogleMapPassengerWidget extends StatelessWidget {
markerId: MarkerId('MyLocation'.tr),
position: controller.newStartPointLocation,
draggable: true,
icon: controller.tripIcon,
icon: controller.startIcon,
infoWindow: const InfoWindow(
title: 'Time',
// snippet: controller.durationFromDriverToPassenger
@@ -167,12 +167,14 @@ class GoogleMapPassengerWidget extends StatelessWidget {
markerId: MarkerId('Destination'.tr),
position: controller.newMyLocation,
draggable: true,
icon: controller.tripIcon,
infoWindow: const InfoWindow(
title: 'Time',
// snippet: controller.durationFromDriverToPassenger
// .toString(),
),
icon: controller.endIcon,
infoWindow: InfoWindow(
anchor: const Offset(0.5, 0),
title: 'Time',
snippet: controller.durationByPassenger.toString()
// snippet: controller.durationFromDriverToPassenger
// .toString(),
),
onDragEnd: (value) {
print(value);
},
@@ -295,6 +297,13 @@ class GoogleMapPassengerWidget extends StatelessWidget {
buildingsEnabled: true,
mapToolbarEnabled: true,
onCameraMove: (position) {
int waypointsLength =
Get.find<WayPointController>().wayPoints.length;
int index = controller.wayPointIndex;
if (waypointsLength > 0) {
controller.placesCoordinate[index] =
'${position.target.latitude.toString()},${position.target.longitude}';
}
if (controller.startLocationFromMap == true) {
controller.newStartPointLocation = position.target;
}