geolocator_watchos 0.1.0
geolocator_watchos: ^0.1.0 copied to clipboard
watchOS implementation of the geolocator plugin, providing position and permission handling from CoreLocation (CLLocationManager) via dart:ffi.
0.1.0 #
First release beyond the generated scaffold.
Breaking
pollIntervalis gone, replaced bypermissionTimeout(default 2 minutes), which bounds the wait for the system permission prompt rather than setting a polling rate.- Minimum Dart SDK is now 3.1.0, where
NativeCallable.listenerlanded.
Changed
getPositionStream,getCurrentPositionandrequestPermissionare all pushed from CoreLocation delegate callbacks. No polling remains.- Added a
locationManagerDidChangeAuthorization:delegate method: the answer to a permission prompt arrives there and nowhere else, so waiting on it is the only way to observe it without polling. didFailWithErrornow wakes a waiter, which re-checks rather than sitting until its deadline.
Fixed
- The three callers that can wait concurrently — a position stream, a pending
getCurrentPosition, a pendingrequestPermission— now share one native callback. The native side holds a single callback pointer, so registering per caller let whichever finished first silence the others. - The shared
NativeCallableis now reused across listen/cancel cycles instead of being discarded when the last waiter left. ANativeCallableis only reclaimed byclose(), which is exactly what cannot be called while native might be between reading the pointer and calling it — so the old code leaked one trampoline per cycle for the life of the app. Only the pointer is unregistered now.
0.0.1 #
- Initial watchOS FFI scaffold generated by
flutter-watchos plugin portfromgeolocator_apple.