all_device_sensors 1.0.1
all_device_sensors: ^1.0.1 copied to clipboard
A Flutter plugin to access all device sensors — accelerometer, gyroscope, magnetometer, linear acceleration, gravity, barometer, proximity, light and step counter. By Bharathwaj.
Changelog #
All notable changes to this project will be documented in this file.
1.0.1 - 2025-07-14 #
Fixed #
- Android critical bug —
onAttachedToEnginewas registering all 9 sensor EventChannels twice (first block was orphaned), causing double sensor listeners and unpredictable data. Each channel is now registered exactly once. - Step counter (Android) — replaced
TYPE_STEP_COUNTER(cumulative since reboot, rarely fires) withTYPE_STEP_DETECTORfor live per-step events that fire on every step. - SDK constraint — changed
^3.10.4to'>=3.0.0 <4.0.0'for compatibility with all Dart 3.x versions.
Improved #
isSensorAvailable()documentation clarified — type codes are Android-based; iOS uses manually mapped values.
1.0.0 - 2025-07-14 #
Added #
- Initial release of all_device_sensors plugin
- Real-time streaming for accelerometer, gyroscope, magnetometer, linear acceleration, gravity
- Single-value streaming for barometer, proximity, light, step counter
getSensors()— returns all available sensors with detailed info (name, vendor, type, power, resolution, maxRange)isSensorAvailable(int type)— check sensor availability by Android type code- Configurable update rates via
SensorInterval(normal / ui / game / fastest) - Typed models:
SensorData,SingleSensorData,SensorInfo,RotationData - Cross-platform support: Android API 21+ and iOS 13.0+
- Example app with 4-tab UI (Motion, Environment, Activity, All Sensors)
Platform Support #
- Android: API 21+ (Android 5.0+)
- iOS: 13.0+