Skip to content
pubscout

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.

WASM-ready
$ flutter pub add dchs_motion_sensors
Source repository

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.

Works with

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