android_environment_sensors 0.0.1+2.1
android_environment_sensors: ^0.0.1+2.1 copied to clipboard

support for android environmnetal sensors

AndroidEnvironmentSensorsPlugin #

Environmental sensor plugin for flutter
Android only

<br/>supported sensor<br/>

  • TYPE_AMBIENT_TEMPERATURE
  • TYPE_LIGHT
  • TYPE_PRESSURE
  • TYPE_RELATIVE_HUMIDITY
  • TYPE_TEMPERATURE <br/>for more information on environment sensors<br/>

<br/>Usage
Check if sensor is available or not

 AndroidEnvironmentSensors androidEnvironmentSensors =AndroidEnvironmentSensors();
 final exist = await androidEnvironmentSensors.isExist(AndroidEnvironmentSensors.TYPE_LIGHT);

if sensor exist then listen to it

 StreamSubscription  lightSubscription = androidEnvironmentSensors.lightStream.listen((event) {
      print(event);
    });
 

Remember to cancel subscription when done

lightSubscription.cancel();

check Example

2
likes
70
pub points
0%
popularity

support for android environmnetal sensors

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL 2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on android_environment_sensors