device_geolocation 2.1.0
device_geolocation: ^2.1.0 copied to clipboard
Cross-platform Flutter geolocation plugin (Android, iOS, macOS, Web, Windows, Linux).
Changelog #
All notable changes to this project are documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
2.1.0 2026 #
Added #
GeospatialAlgorithmenum to choose betweenhaversineandvincentydistance formulas.DeviceGeolocation.distanceBetweenIsolate()andDeviceGeolocation.bearingBetweenIsolate()to run calculations in a separate isolate on native platforms. On the web they fall back to the synchronous calculation.
Changed #
DeviceGeolocation.distanceBetween()now uses the more accurate Vincenty formula by default and accepts an optionalalgorithmparameter.- Distance calculations now normalize longitude deltas to the shortest arc, improving accuracy across the antimeridian.
2.0.0 2026 #
Added #
DeviceGeolocation.configure(DeviceLocationSettings)to set default location settings for all subsequentgetCurrentPosition()andgetPositionStream()calls. ExplicitdeviceLocationSettingsstill override the configured values.DeviceGeolocation.getPermissionStream()emits permission status changes. The web implementation uses the Permissions API natively; iOS and macOS use a nativepermissionUpdatesevent channel; Android and Linux fall back to polling.DeviceGeolocation.openAppSettings()andopenLocationSettings()now accept an optionalDeviceGeolocationSettingsCallbackthat is invoked when the user returns to the app with the current service status and permission.DeviceGeolocation.settingsOpenedStreamemitstruewhen a settings panel is opened andfalsewhen the app returns to the foreground.- Native checks on Android, iOS and macOS that detect missing location
permission declarations (
AndroidManifest.xml/Info.plist) and throwPermissionDefinitionsNotFoundExceptionwith detailed English instructions.
Changed #
- Breaking: renamed public types to use the
Deviceprefix:LocationPermission→DeviceLocationPermissionLocationAccuracy→DeviceLocationAccuracyLocationAccuracyStatus→DeviceLocationAccuracyStatusServiceStatus→DeviceLocationServiceStatusLocationSettings→DeviceLocationSettingsPosition→DevicePosition
getCurrentPosition()andgetPositionStream()now takeDeviceLocationSettings? deviceLocationSettingsinstead oflocationSettings.
Removed #
- Breaking: removed
DeviceGeolocation.getLastKnownPosition()and theforceAndroidLocationManagerparameter from the public API.
1.1.0 2026 #
Added #
- Android:
ForegroundNotificationConfig(withAndroidResource) and the newAndroidSettings.foregroundNotificationConfigfield. When supplied toDeviceGeolocation.getPositionStream, the plugin runs aFOREGROUND_SERVICE_TYPE_LOCATIONservice so location updates keep flowing while the app is backgrounded. - Android: bundled
DeviceGeolocationForegroundService(declared in the plugin'sAndroidManifest.xml) with optionalWAKE_LOCK/ high-performanceWifiLockretention, customizable notification (title, text, channel name, icon, color, ongoing flag), multi-engine support (service is shared across Flutter engines and stops only when the last subscription ends), and runtime detection of the host app'sFOREGROUND_SERVICE_LOCATIONpermission on Android 14+. - The foreground service reuses the existing GMS/non-GMS detection
(
FusedLocationProviderClientwhen Google Play services are available, fallback toLocationManagerotherwise) and honoursAndroidSettings.forceLocationManager. - Testing:
DeviceGeolocationMock.lastForegroundNotificationConfiggetter to assert the configuration carried by the last stream subscription.
1.0.2 2026 #
Fixed #
- Windows: apply
cxx_std_20,/awaitand theWindowsApplink to the${TEST_RUNNER}target inwindows/CMakeLists.txt. The unit-test executable recompiles the plugin sources (which useco_await/ WinRT C++/coroutines) and was inheriting C++17 from Flutter's default settings, breaking the example's Windows build on CI.
1.0.1 2026 #
Changed #
- CI/CD: aligned the
publish.yamlworkflow with the shared team template (OIDC trusted publishing viaid-token: write, version-vs-tag verification step,flutter pub get+flutter testgate before publishing).
1.0.0 2025 #
Added #
- Linux support via the GeoClue2 D-Bus service (Dart-only implementation,
registered through
dartPluginClass). - iOS 17+ and macOS 14+ streaming via
CLLocationUpdate.liveUpdateswith a delegate-based fallback for older OS versions. - Two-stage Android runtime permission flow:
requestPermission()accepts arequestBackgroundflag and, when granted while-in-use first, chains the background permission request on Android 10+ (Q). - Privacy manifests (
PrivacyInfo.xcprivacy) are now bundled on iOS and macOS. topics,homepage,repositoryandissue_trackerinpubspec.yaml.
Changed #
- Bumped plugin to 1.0.0 and re-namespaced the Android implementation to
com.arcas0803.device_geolocation. - iOS minimum deployment target raised to 14.0; macOS to 11.0; Swift language version raised to 5.9.
- Android minimum SDK is 24 (Android 7.0);
compileSdk36, AGP 9.0.1, Kotlin 2.3.20, Play Services Location 21.3.0. - Windows plugin compiles with C++20 and uses WinRT C++/coroutines
(
co_await,winrt::fire_and_forget); event-sink callbacks are now marshalled onto the platform thread viaDispatcherQueue. - Web implementation migrated to
package:web+dart:js_interopand now validates the page is served from a secure context before requesting a position. - Replaced deprecated
CLLocationManager.authorizationStatus()with the instance property and adoptedlocationManagerDidChangeAuthorization(_:). - macOS settings deep-link now targets the macOS 13+
com.apple.settings.PrivacySecurity.extensionpanel with a fallback for older versions.
Removed #
- Default
flutter createscaffolding (boilerplate counter app,TODOREADME, empty CHANGELOG, placeholder LICENSE, placeholder podspec/Package.swift metadata). getPlatformVersionmethod and its tests on every platform.