Baseflow / Baseflow/flutter-geolocator
[Bug]: AndroidSettings intervalDuration sometimes does not accept values less than 5 seconds
- Dominant language
- Dart
- Stars
- 1.3k
- Forks
- 803
- Avg merge
- 8h 16m
- Merged PRs (30d)
- 1
Description
### Please check the following before submitting a new issue.
- [X] I have searched the [existing issues](https://github.com/baseflow/flutter-geolocator/issues).
- [X] I have carefully [read the documentation](https://github.com/Baseflow/flutter-geolocator/blob/main/geolocator/README.md) and verified I have added the required platform specific configuration.
### Please select affected platform(s)
- [X] Android
- [ ] iOS
- [ ] Linux
- [ ] macOS
- [ ] Web
- [ ] Windows
### Steps to reproduce
Set the position retrieval interval to 1 second in the location settings (see example code)
### Expected results
Getting "position update" every second
### Actual results
Getting "position update" every 5 second
### Code sample
Code sample
```dart
final locationSettings = AndroidSettings(
accuracy: LocationAccuracy.best,
intervalDuration: const Duration(seconds: 1),
);
Geolocator.getPositionStream(locationSettings: locationSettings)
.listen(value => print('Position update ' + value.timestamp!.toString()));
```
### Screenshots or video
Screenshots or video demonstration
[Upload media here]
### Version
13.0.1
### Flutter Doctor output
Doctor output
```console
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.5073], locale ru-RU)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.5)
[√] Android Studio (version 2024.2)
[√] IntelliJ IDEA Community Edition (version 2024.2)
[√] VS Code (version 1.95.1)
[√] Connected device (4 available)
[√] Network resources
```
Contributor guide
Research direction
Start by reproducing the Android behavior with the provided AndroidSettings and getPositionStream example, using a one-second interval. Then trace how intervalDuration is handled for Android and verify that position updates can occur every second rather than every five seconds. Done means the reported behavior is corrected and the example no longer produces five-second intervals.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100