Skip to content
pubscout

light_sensor

3.0.2, released 11 months ago by an unverified publisher

Access the device light sensor on Android.

WASM-ready
$ flutter pub add light_sensor
Source repository

What it does

A Flutter plugin for Android allowing access to the device light sensor. It provides methods to check sensor availability and subscribe to a stream of light updates in lux.

AI-written summary of version 3.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to read ambient light sensor data on Android devices.
  • You want to react to lighting changes in real-time using a lux stream.

Skip it when

  • You need support for platforms other than Android.
  • You need cross-platform sensor support like iOS.

Strengths

  • Simple API for checking sensor availability and listening to lux updates.
  • Actively maintained plugin refreshing the older unmaintained 'light' package.

Weaknesses

  • Only supports Android devices.
  • Limited documentation beyond basic usage.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
0

Add the dependency to pubspec.yaml.

final bool hasSensor = await LightSensor.hasSensor();
LightSensor.luxStream().listen((lux) {...});

Alternatives

Packages that do the same job and could replace light_sensor.

  • sensors_plus

    Provides cross-platform sensor support including accelerometer, gyroscope, and magnetometer.