24-12/26/1

This commit is contained in:
Hamza-Ayed
2024-12-26 00:58:41 +03:00
parent 970e444f4a
commit 186cd3aa54
14 changed files with 2912 additions and 3466 deletions

View File

@@ -1,4 +1,3 @@
import 'package:SEFER/controller/home/map_passenger_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/style.dart';
@@ -84,16 +83,54 @@ class OrderHistory extends StatelessWidget {
),
zoom: 12,
),
// bounds: LatLngBounds(
// northeast: LatLng(
// double.parse(rides['end_location'].toString().split(',')[0]),
// double.parse(rides['end_location'].toString().split(',')[1]),
// ),
// southwest: LatLng(
// double.parse(rides['start_location'].toString().split(',')[0]),
// double.parse(rides['start_location'].toString().split(',')[1]),
// ),
// ),
// Dynamically calculate the correct LatLngBounds
onMapCreated:
(GoogleMapController controller) {
final LatLng startLocation = LatLng(
double.parse(rides['start_location']
.toString()
.split(',')[0]),
double.parse(rides['start_location']
.toString()
.split(',')[1]),
);
final LatLng endLocation = LatLng(
double.parse(rides['end_location']
.toString()
.split(',')[0]),
double.parse(rides['end_location']
.toString()
.split(',')[1]),
);
final LatLngBounds bounds =
LatLngBounds(
northeast: LatLng(
startLocation.latitude >
endLocation.latitude
? startLocation.latitude
: endLocation.latitude,
startLocation.longitude >
endLocation.longitude
? startLocation.longitude
: endLocation.longitude,
),
southwest: LatLng(
startLocation.latitude <
endLocation.latitude
? startLocation.latitude
: endLocation.latitude,
startLocation.longitude <
endLocation.longitude
? startLocation.longitude
: endLocation.longitude,
),
);
controller.animateCamera(
CameraUpdate.newLatLngBounds(
bounds, 50));
},
zoomControlsEnabled: true,
polylines: {
Polyline(