dchs_motion_sensors
3.0.0, released 7 weeks ago by dariocavada.com
Flutter plugin for accessing Android and iOS accelerometer, gyroscope, magnetometer, and orientation.
What it does
Provides access to device motion sensors such as accelerometer, gyroscope, magnetometer, and orientation on Android and iOS platforms. Exposes sensor event data via streams.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to read motion sensor data like accelerometer or gyroscope in your app.
- You are building apps that respond to device orientation or physical movement.
Skip it when
- Your minimum supported Flutter version is older than 3.47.0.
- Your target platform does not have motion sensors (e.g., standard servers/desktops).
Strengths
- Supports both Android and iOS platforms.
- Provides streaming event APIs for multiple sensor types.
Weaknesses
- Requires recent Flutter and Dart SDK versions (Flutter >=3.47.0, Dart >=3.13.0).
- Kotlin 1.8 hosts are no longer supported on Android.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add the dependency to pubspec.yaml. For iOS host apps created from older templates, regeneration using flutter create may be needed for Swift Package Manager support.
import 'package:dchs_motion_sensors/dchs_motion_sensors.dart';
motionSensors.magnetometer.listen((MagnetometerEvent event) {
print(event);
});Alternatives
Packages that do the same job and could replace dchs_motion_sensors.
- sensors_plus
Flutter plugin to access accelerometer, gyroscope, magnetometer, and barometer sensors.
96Compare - motion_sensors
Access Android and iOS accelerometer, gyroscope, magnetometer, and orientation sensors.
49Compare - native_device_orientation
A Flutter plugin for reading native device orientation from UI or sensors.
79Compare - flutter_rotation_sensor
Provides a stream of device orientation data including rotation matrix, quaternion, and Euler angles.
79Compare
Works with
Packages commonly used together with dchs_motion_sensors: ones it builds on, ones built on it, and its own family.
- vector_mathdchs_motion_sensors depends on itVector math library for 2D/3D/4D vectors, matrices, quaternions, and geometry.
- dchs_flutter_beaconSame familyFlutter plugin for scanning and transmitting iBeacons on Android and iOS
- panorama_viewerBuilt on dchs_motion_sensors360-degree panorama viewer widget for Flutter.