Lucas Goldner
Lucas Goldner

Reputation: 730

Flutter: Get which type of location permission is currently enabled

Hey I am using the permission handler package in order to request and get the current status of my permissions. I have the following three permissions

[Permission.location, Permission.locationWhenInUse, Permission.locationAlways]

Now I want to know which of those is currently the one in use. I tried doing something like this

    List<PermissionStatus> status = await Future.wait(permissionTypes.map(
      (permission) async => await permission.request(),
    ));

For some reason I receive

[PermissionStatus.granted, PermissionStatus.granted, PermissionStatus.granted]

My goal is to know if the permission is denied, onlyWhenInUse or always.

Any ideas on how to achieve this ?

Upvotes: 0

Views: 405

Answers (0)

Related Questions