flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

[Bug]: ServiceStatus.disabled, but Geolocator.isLocationServiceEnabled will return true

Open Evoswork opened this issue 2 years ago • 3 comments

Please check the following before submitting a new issue.

Please select affected platform(s)

  • [X] Android
  • [ ] iOS
  • [ ] Linux
  • [ ] macOS
  • [ ] Web
  • [ ] Windows

Steps to reproduce

Start the application ServiceStatus.enabled and LocationPermission.whileInUse. Subscribe to Geolocator.getServiceStatusStream(). Disable service, the stream will return ServiceStatus.disabled, but Geolocator.isLocationServiceEnabled will return true

Expected results

return false

Actual results

return true

Code sample

/*/

Screenshots or video

No response

Version

geolocator: ^10.0.0

Flutter Doctor output

[✓] Flutter (Channel stable, 3.13.2, on macOS 13.5.1 22G90 darwin-x64, locale ru-RU) • Flutter version 3.13.2 on channel stable at /Users/xxx/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ff5b5b5fa6 (10 days ago), 2023-08-24 08:12:28 -0500 • Engine revision b20183e040 • Dart version 3.1.0 • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) • Android SDK at /Users/xxx/Library/Android/sdk • Platform android-33, build-tools 33.0.2 • ANDROID_HOME = /Users/xxx/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E300c • CocoaPods version 1.12.1

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3) • Android Studio at /Applications/Android Studio.app/Contents • 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 • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

Evoswork avatar Sep 03 '23 19:09 Evoswork

but if you wait 100 milliseconds before calling it, it will return false

Evoswork avatar Sep 03 '23 19:09 Evoswork

I also have it on but it returns false. I think it's MIUI related.

bugrevealingbme avatar Feb 08 '24 12:02 bugrevealingbme

I think there's a problem with the order of calls in the plugin.

Evoswork avatar Feb 08 '24 12:02 Evoswork