Skip to content

Location permission dialog appear after being denied but not for notification permission #353

@newbieflutter

Description

@newbieflutter

Hi,
I have the following codes as below. This code works perfectly fine for location. So I go to my settings and I close the permission for location and it keep asking for permission. I just replace it with await Permission.notification.status and replace everything with notification it does not work the same after its denied. Why its behaving differently for notification permission?

var status = await Permission.location.status;
    print("location STATUS is" + status.toString());
    if (status.isRestricted) {
      // We didn't ask for permission yet.
      print("RESTRICTED IN THE IF NOW");
      Map<Permission, PermissionStatus> statuses = await [
        Permission.location,
      ].request();
      print("ÄFTER GET " + statuses[Permission.location].toString());
    }
    if (status.isUndetermined) {
      // We didn't ask for permission yet.
      print("UN DETERMINED IN THE IF NOW");
      Map<Permission, PermissionStatus> statuses = await [
        Permission.location,
      ].request();
      print("ÄFTER GET " + statuses[Permission.location].toString());
    }
    if (status.isDenied) {
      // We didn't ask for permission yet.
      print("DENIED IN THE IF NOW");
      Map<Permission, PermissionStatus> statuses = await [
        Permission.location,
      ].request();
      print("ÄFTER GET " + statuses[Permission.location].toString());
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: androidIssue is related to the Android platform.status: triageIndicates that this issue needs to be analyzed and decorated with the appropriate labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions