flutter-geolocator
flutter-geolocator copied to clipboard
[Bug]: AndroidSettings intervalDuration sometimes does not accept values less than 5 seconds
Please check the following before submitting a new issue.
- [X] I have searched the existing issues.
- [X] I have carefully read the documentation 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
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
[√] 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