work from bae

This commit is contained in:
2025-07-09 11:12:24 +02:00
parent 0c98ad90a6
commit d34878fc5e
7 changed files with 204 additions and 8 deletions

View File

@@ -39,9 +39,13 @@ class MIHLocationAPI {
}
}
double getDistanceInMeaters(Position startPosition, Position endPosition) {
return Geolocator.distanceBetween(startPosition.latitude,
startPosition.longitude, endPosition.latitude, endPosition.longitude);
double getDistanceInMeaters(String startPosition, String endPosition) {
double startLatitude = double.parse(startPosition.split(", ")[0]);
double startLogitude = double.parse(startPosition.split(", ")[1]);
double endLatitude = double.parse(endPosition.split(", ")[0]);
double endLogitude = double.parse(endPosition.split(", ")[1]);
return Geolocator.distanceBetween(
startLatitude, startLogitude, endLatitude, endLogitude);
}
void showPermissionError(BuildContext context) {