Skip to content

[Bug]: location bug #1154

Closed
Closed
@BurkeDeng

Description

@BurkeDeng

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

When I agreed to choose fuzzy positioning in the request location pop-up window, I was directly told that I rejected the positioning.

Expected results

When you agree to select fuzzy positioning, you should be able to obtain location information normally.

Actual results

PermissionStatus.denied

Code sample

Code sample
[Paste your code here]
 requestPermission() async {
    var status = await Permission.location.status;

    if (status.isDenied) {
      //权限未获得
      Log.d(tag, "权限未获得,开始请求权限");

      Map<Permission, PermissionStatus> statuses = await [
        Permission.location,
      ].request();

      if (statuses[Permission.location] == PermissionStatus.granted) {
        //定位权限获取
        Log.d(tag, "定位权限已获取");
      } else if (statuses[Permission.location] == PermissionStatus.denied) {
        //定位权限被拒绝
        Log.d(tag, "定位权限被拒绝");
      }
    } else {
      //权限已获得
      Log.d(tag, "权限已获得");
    }
  }

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

permission_handler: ^11.0.0

Flutter Doctor output

Doctor output
[Paste your output here]
```Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [版本 10.0.22000.739], locale zh-CN)
    • Flutter version 3.0.5 at D:\FlutterSDK\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (1 year, 2 months ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Administrator\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: D:\JavaSDK\jdk-11\bin\java
    • Java version OpenJDK Runtime Environment OpenLogic-OpenJDK (build 11.0.20+8-adhoc..jdk11u)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[!] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    X Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[√] Connected device (3 available)
    • ANP AN00 (mobile) • A94VUT2B21007423 • android-arm64  • Android 12 (API 31)
    • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [版本 10.0.22000.739]
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 116.0.5845.97

[√] HTTP Host Availability
    • All required HTTP hosts are available


</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions