0

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 ?

Lucas Goldner
  • 617
  • 9
  • 29
  • Where does `Permission` come from? I don't believe it is in the Flutter SDK (after a search). – Apealed Jun 15 '22 at 16:00
  • This is returning the permission status of all the permission types. It is doing exactly what you want, because in the app you are using, the permissions were granted. If it had been denied for any of them, it would show as denied. – Huthaifa Muayyad Jun 15 '22 at 16:01

0 Answers0