Skip to content
pubscout

motion_sensors

0.1.0, released 6 years ago by final.dev

Access Android and iOS accelerometer, gyroscope, magnetometer, and orientation sensors.

WASM-ready
$ flutter pub add motion_sensors
Source repository

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.

Works with

Packages commonly used together with motion_sensors: ones it builds on, ones built on it, and its own family.