Skip to content

A Flutter plugin for accessing the accelerometer, gyroscope, magnetometer, and orientation sensors on Android and iOS devices.

License

Notifications You must be signed in to change notification settings

sajilopatro/motion_sensor

Repository files navigation

motion_sensor

pub package

A Flutter plugin for accessing the accelerometer, gyroscope, magnetometer, and orientation sensors on Android and iOS devices.

Attention

This package was originally developed by Zesage but has not been updated for over years. To maintain its functionality and improve performance, I have refined the package and released a new version.

Platform Support

Android iOS MacOS Web Linux Windows

Requirements

  • Flutter: >=3.19.0
  • Dart: >=3.3.0 <4.0.0
  • iOS: >=12.0
  • Android: compileSDK 34, Java 17, Android Gradle Plugin >=8.1.0, Gradle wrapper >=8.3

Usage

Add motion_sensor as a dependency in your pubspec.yaml file.

dependencies:
  motion_sensor: ^0.0.1

Example

import 'package:motion_sensor/motion_sensor.dart';

motionSensor.magnetometer.listen((MagnetometerEvent event) {
    print(event);
});

Screenshot


About

A Flutter plugin for accessing the accelerometer, gyroscope, magnetometer, and orientation sensors on Android and iOS devices.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published