environment_sensors 0.0.1 copy "environment_sensors: ^0.0.1" to clipboard
environment_sensors: ^0.0.1 copied to clipboard

outdated

A Flutter plugin for reading ambient temperature,relative humidity, light, and pressure

Environment Sensors #

A plugin for checking the availability of and reading values of device ambient temperature, relative humidity, light, and pressure sensors. Currently only Android is supported.

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) {
    print(pressure.toString());
  });
26
likes
0
pub points
79%
popularity

Publisher

unverified uploader

A Flutter plugin for reading ambient temperature,relative humidity, light, and pressure

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on environment_sensors