Skip to content

[Bug]:Lock the screen when the address permission is enabled,PlatformException(ERROR_ALREADY_REQUESTING_PERMISSIONS, A request for permissions is already running, please wait for it to finish before doing another request (note that you can request multiple permissions at the same time)., null, null) #1261

@yuqing374

Description

@yuqing374

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

1、Request address permission
2、Lock screen
3、Request address permission

Expected results

The address permission dialog box is displayed

Actual results

PlatformException(ERROR_ALREADY_REQUESTING_PERMISSIONS, A request for permissions is already running, please wait for it to finish before doing another request (note that you can request multiple permissions at the same time)., null, null)

Code sample

Code sample
static openStore(
    BuildContext context,
  ) async {
    Permission.location.status.then((value) {
      if (value == PermissionStatus.granted) {
        openStorePage(context, 0);
      } else if (value == PermissionStatus.denied) {
        Permission.location.request().then((value) {
          if (value == PermissionStatus.granted) {
            openStorePage(context, 0);
          } else {
            openStorePage(context, 2);
          }
        });
        AndroidUtil.clearFlagSecure();
      } else if (value == PermissionStatus.permanentlyDenied || value == PermissionStatus.restricted) {
        openStorePage(context, 1);
      } else {
        if (Platform.isAndroid) {
          Permission.location.request().then((value) {
            if (value == PermissionStatus.granted) {
              openStorePage(context, 0);
            } else {
              openStorePage(context, 1);
            }
          });
          AndroidUtil.clearFlagSecure();
        }
      }
    });
  }

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

11.0.1

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.6, on macOS 14.0 23A344 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.10.6 on channel stable at /Applications/flutter3.10.6
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (6 months ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work list.platform: iosIssue is related to the iOS platformrefactorIssues marked with refactor should be considered when refactoring the plugin.type: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions