motion_sensors
0.1.0, released 6 years ago by final.dev
Access Android and iOS accelerometer, gyroscope, magnetometer, and orientation sensors.
What it does
The motion_sensors package provides a Flutter plugin for accessing device motion sensors including the accelerometer, gyroscope, magnetometer, and orientation. It allows applications to listen to sensor event streams such as magnetometer readings.
AI-written summary of version 0.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to access device accelerometer, gyroscope, or magnetometer data in a Flutter app.
- You are building apps that rely on device orientation and motion tracking.
Skip it when
- You require packages from the alternative catalog that provide motion or animation features.
- You are not targeting Android or iOS platforms.
Strengths
- Provides access to multiple core hardware sensors in a single plugin.
- Supports null safety.
Weaknesses
- Limited documentation beyond basic setup and a single magnetometer listener example.
- Only explicitly lists Android and iOS platforms.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add the dependency to pubspec.yaml and import the package in your Dart code.
import 'package:motion_sensors/motion_sensors.dart';
motionSensors.magnetometer.listen((MagnetometerEvent event) {
print(event);
});Alternatives
Packages that do the same job and could replace motion_sensors.
- sensors_plus
Flutter plugin to access accelerometer, gyroscope, magnetometer, and barometer sensors.
96Compare - dchs_motion_sensors
Flutter plugin for accessing Android and iOS accelerometer, gyroscope, magnetometer, and orientation.
75Compare - 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 motion_sensors: ones it builds on, ones built on it, and its own family.