Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Selecting one-time permission results in denied #1566

Open
3 of 8 tasks
rawthriver opened this issue Aug 28, 2024 · 1 comment
Open
3 of 8 tasks

[Bug]: Selecting one-time permission results in denied #1566

rawthriver opened this issue Aug 28, 2024 · 1 comment

Comments

@rawthriver
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

Just call to Geolocator.requestPermission()

Expected results

Expected allowed state. It seems that "one-time" option has to be added to LocationPermission enum

Actual results

LocationPermission.denied

Code sample

Code sample
var permission = await Geolocator.checkPermission();
if (permission == LocationPermission.deniedForever) {
  // denied
}

if (permission == LocationPermission.denied) {
  permission = await Geolocator.requestPermission();
  if (permission != LocationPermission.whileInUse && permission != LocationPermission.always) {
    // got here if one-time was selected
  }
}

// ok, granted

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

13.0.1

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.3, on Microsoft Windows [Version 10.0.22000.2538], locale ru-RU)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.26)
    X The current Visual Studio installation is incomplete.
      Please use Visual Studio Installer to complete the installation or reinstall Visual Studio.
[√] Android Studio (version 2023.3)
[√] VS Code (version 1.92.2)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.
@jsonsuxing
Copy link

me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants