permission check when trying to open tracking map

This commit is contained in:
Nico
2025-06-02 20:16:14 +02:00
parent 2574752ebb
commit e74cf2b706
2 changed files with 20 additions and 0 deletions

View File

@@ -28,4 +28,15 @@ class GeolocatorService {
return await Geolocator.getCurrentPosition();
}
static Future<bool> alwaysPositionEnabled() async {
LocationPermission permissionGiven = await Geolocator.checkPermission();
bool locationEnabled = await Geolocator.isLocationServiceEnabled();
if (permissionGiven == LocationPermission.always || !locationEnabled) {
return true;
} else {
return false;
}
}
}