v0.3.0
environment_sensors
A Flutter plugin for reading ambient temperature,relative humidity, ambient light, and barometric pressure from a device.
27Likes 14030-day downloads140Pub points
AndroidiOS
Flutter Plugin for reading environment sensors
English project snapshot. Visit GitHub for the latest content.
Flutter plugin for accessing ambient temperature, relative humidity, ambient light, and barometric pressure sensors of a device.
Add environment_sensors as a dependency in pubspec.yaml.
For help on adding as a dependency, view the documentation.
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());
});
Dependency list 2 items
{"sdk":"flutter"}{"sdk":"flutter"}Start with your use case, compare repository activity, and check the original project before adopting it.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗