light 0.0.7 copy "light: ^0.0.7" to clipboard
light: ^0.0.7 copied to clipboard

outdated

A Flutter plugin for probing data from the light sensor using a platform channel. Works for Android only, since the light sensor API is not available on iOS.

light #

A light sensor plugin for Flutter, reads the intensity of light in lux, and reports this number back. The API for getting the current light exposure is only available on Android devices, and the plugin will therefore not work for iOS devices.

Install #

Add light as a dependency in pubspec.yaml. For help on adding as a dependency, view the documentation.

Usage #

Al incoming data points are streamed with a StreamSubscription which is set up by calling the listen() method on a Light object.

Given a method _onData(int lux) the subscription can be set up as follows:

Light _light = new Light();
_light.listen(_onData);

The stream can also be cancelled again by calling the cancel() method:

_light.cancel();
22
likes
0
pub points
86%
popularity

Publisher

verified publishercachet.dk

A Flutter plugin for probing data from the light sensor using a platform channel. Works for Android only, since the light sensor API is not available on iOS.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on light