Search packages, repositories and app categories

Package detailsv0.5.0

all_sensors

A Flutter plugin to retreive Accelerometer, Gyroscope, Proximity sensor's data.

AndroidiOS
30-day downloads
173
Likes
31
Pub points
140

Install package

flutter pub add all_sensors

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The all_sensors package is a Flutter plugin that enables access to real-time data from accelerometer, gyroscope, and proximity sensors on Android and iOS devices. It provides a simple interface to listen to sensor updates, making it ideal for applications requiring motion detection, device orientation tracking, or proximity-based interactions. The plugin abstracts platform-specific implementations, offering consistent behavior across platforms. It is lightweight and integrates seamlessly with Flutter's event-driven architecture.

Use cases

  • Motion-based app interactions
  • Device orientation tracking
  • Proximity-aware user interfaces
  • Gesture recognition in mobile apps
  • Fitness and activity monitoring

Key features

  • Real-time sensor data streaming
  • Cross-platform support (Android & iOS)
  • Simple event-based API
  • Support for accelerometer, gyroscope, and proximity sensors
  • Lightweight and easy integration

Suitable for

  • Developers building motion-sensitive apps
  • Apps requiring device orientation awareness
  • Interactive UIs using proximity or movement
  • Wearable or fitness applications
  • Prototyping sensor-based features

Considerations

  • Requires appropriate permissions on Android
  • Limited to specific sensor types
  • Background operation may be restricted on iOS
  • Battery usage should be monitored during continuous sensing
  • Not suitable for high-frequency precision measurements

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

All Sensors Flutter Plugin

A Flutter plugin to retreive all of sensor's data. [Accelerometer, Gyroscope, Proximity]

In proximity, screen will be off if the value is true. You must add the WAKE_LOCK permission in the AndroidManifest.xml

<uses-permission android:name="android.permission.WAKE_LOCK" />

Usage

To use this plugin, add all_sensors as a dependency in your pubspec.yaml file.

Example
// Import package
import 'package:all_sensors/all_sensors.dart';

// Instantiate it
List<double> _accelerometerValues;
List<double> _userAccelerometerValues;
List<double> _gyroscopeValues;
bool _proximityValues = false;

// Access sensors value
accelerometerEvents.listen((AccelerometerEvent event) {
  setState(() {
    _accelerometerValues = <double>[event.x, event.y, event.z];
  });
})

gyroscopeEvents.listen((GyroscopeEvent event) {
  setState(() {
    _gyroscopeValues = <double>[event.x, event.y, event.z];
  });
})

proximityEvents.listen((ProximityEvent event) {
  setState(() {
  	// event.getValue return true or false
    _proximityValues = event.getValue();
  });
})

Referenced https://pub.dev/packages/sensors

Categories

Source repository

Projects using this package

No data available yet.