5/15/1
This commit is contained in:
@@ -21,13 +21,14 @@ class LocationBackgroundController extends GetxController {
|
||||
var status = await Permission.locationAlways.status;
|
||||
print('Initial status: $status');
|
||||
|
||||
if (status.isDenied || status.isRestricted) {
|
||||
if (status == PermissionStatus.denied ||
|
||||
status == PermissionStatus.restricted) {
|
||||
// Request permission
|
||||
status = await Permission.locationAlways.request();
|
||||
print('Requested status: $status');
|
||||
}
|
||||
|
||||
if (status.isPermanentlyDenied) {
|
||||
status = await Permission.locationAlways.status;
|
||||
if (!status.isGranted) {
|
||||
// Open app settings if permission is permanently denied
|
||||
openAppSettings();
|
||||
box.write(BoxName.locationPermission, 'true');
|
||||
|
||||
Reference in New Issue
Block a user