environment_sensors 0.2.0
environment_sensors: ^0.2.0 copied to clipboard

A Flutter plugin for reading ambient temperature,relative humidity, ambient light, and barometric pressure from a device.

Environment Sensors #

Flutter plugin for accessing ambient temperature, relative humidity, ambient light, and barometric pressure sensors of a device.

Install #

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

Usage #

Check for availability of sensors

final environmentSensors = EnvironmentSensors();   

    var tempAvailable = await environmentSensors.getSensorAvailable(SensorType.AmbientTemperature);
    var humidityAvailable = await environmentSensors.getSensorAvailable(SensorType.Humidity);
    var lightAvailable = await environmentSensors.getSensorAvailable(SensorType.Light);
    var pressureAvailable = await environmentSensors.getSensorAvailable(SensorType.Pressure);

Get sensor stream

final environmentSensors = EnvironmentSensors();

  environmentSensors.pressure.listen((pressure) {
    //Pressure in Millibars
    print(pressure.toString());
  });
3
likes
120
pub points
35%
popularity

A Flutter plugin for reading ambient temperature,relative humidity, ambient light, and barometric pressure from a device.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

andrew.julowcomputing@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on environment_sensors