24-12/26/1
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user