permission check when trying to open tracking map
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user