Baseflow / Baseflow/flutter-geolocator
[Android] Upgrade Approximate location to Precise location
- Dominant language
- Dart
- Stars
- 1.3k
- Forks
- 803
- Avg merge
- 8h 16m
- Merged PRs (30d)
- 1
Description
## 🚀 Feature Requests
Relevant for Android 12+.
Add functionality to change an existing approximate location permission to precise, without leaving the app.
### Contextualize the feature
Calling `Geolocator.requestPermission()` will show the left dialog in the below image.
Click 'Approximate' and 'While using' to get a reduced location permission.
Given the reduced permission:
- Calling `Geolocator.requestPermission()` again won't do anything, as it will return `LocationPermission.whileInUse`.
- Using (your own) [permission_handler](https://pub.dev/packages/permission_handler) package, calling `Permission.locationWhenInUse.request()' will show the right dialog.
Can you add this trigger to Geolocator?

### Describe the feature
For a lot of applications approximate location isn't accurate enough, but users on Android 12 or above will get the choice to use it.
Android already has functionality to smoothly change this accuracy, it simply isn't triggered by Geolocator yet.
Given that there already is a `Geolocator.requestTemporaryFullAccuracy()` function for iOS, can't we get something similar for Android?
A separate function might be easier than adding it as implicit requestPermission behaviour, as it won't break any existing code.
### Platforms affected (mark all that apply)
- [ ] :iphone: iOS
- [x] :robot: Android
Contributor guide
Research direction
Start with the Android implementation behind Geolocator.requestPermission() and compare it with the existing iOS Geolocator.requestTemporaryFullAccuracy() entry point. Check the Android 12+ permission behavior described in the issue and define completion as a supported trigger that upgrades an existing approximate permission to precise without leaving the app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100