sensors_plus_watchos 0.1.0
sensors_plus_watchos: ^0.1.0 copied to clipboard
watchOS implementation of the sensors_plus plugin, streaming accelerometer, user-accelerometer, gyroscope, and magnetometer data from CoreMotion via dart:ffi.
0.1.0 #
First release beyond the generated scaffold.
Breaking
- Minimum Dart SDK is now 3.1.0, where
NativeCallable.listenerlanded. - Behaviour change: a stream now emits exactly one event per CoreMotion sample. It previously emitted one per Dart timer tick, on a clock independent of CoreMotion's — so at the same nominal rate it would re-emit a sample it had already delivered, or skip one entirely. Code that counted events, or relied on that aliasing, will see different results. Timestamps are unaffected.
Changed
- All four streams — accelerometer, user accelerometer, gyroscope, magnetometer — are pushed from the CoreMotion handler rather than polled. No timer runs. The four share one native callback and fan out on a sensor kind, because the native side holds a single callback pointer.
Fixed
- Two subscriptions to the same sensor now both work. Fanning out on the
sensor kind was not enough: only one emitter was kept per kind, so a second
listenon, say,accelerometerEventsreplaced the first subscription's emitter and silenced it, and whichever subscription cancelled first stopped the sensor for the other. Each subscription is now its own entry, and a sensor stops only when its last listener cancels.
0.0.1 #
- Initial watchOS FFI scaffold generated by
flutter-watchos plugin portfromsensors_plus.