update
This commit is contained in:
@@ -43,22 +43,24 @@ class MapServices {
|
|||||||
List<LatLng> polylineCoordinates = [];
|
List<LatLng> polylineCoordinates = [];
|
||||||
PolylinePoints polylinePoints = PolylinePoints();
|
PolylinePoints polylinePoints = PolylinePoints();
|
||||||
|
|
||||||
// PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
|
PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
|
||||||
// ApplicationConstants.MAP_KEY,
|
googleApiKey: ApplicationConstants.MAP_KEY,
|
||||||
// PointLatLng(origin.latitude, origin.longitude),
|
request: PolylineRequest(
|
||||||
// PointLatLng(destination.latitude, destination.longitude),
|
origin: PointLatLng(origin.latitude, origin.longitude),
|
||||||
// travelMode: TravelMode.driving,
|
destination: PointLatLng(destination.latitude, destination.longitude),
|
||||||
// optimizeWaypoints: true);
|
mode: TravelMode.driving,
|
||||||
// if (result.points.isNotEmpty) {
|
optimizeWaypoints: true
|
||||||
// for (var point in result.points) {
|
)
|
||||||
// polylineCoordinates.add(LatLng(point.latitude, point.longitude));
|
);
|
||||||
// }
|
if (result.points.isNotEmpty) {
|
||||||
// return polylineCoordinates;
|
for (var point in result.points) {
|
||||||
// } else {
|
polylineCoordinates.add(LatLng(point.latitude, point.longitude));
|
||||||
// log("Lỗi khi tìm đường");
|
}
|
||||||
// return [];
|
return polylineCoordinates;
|
||||||
// }
|
} else {
|
||||||
return [];
|
log("Lỗi khi tìm đường");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ description: Smart Fire Monitoring
|
|||||||
|
|
||||||
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
version: 1.0.5+5
|
version: 1.0.6+6
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.0.1 <4.0.0"
|
sdk: ">=3.0.1 <4.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user