mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-27 01:40:40 +00:00
15 lines
315 B
Dart
15 lines
315 B
Dart
import 'package:light_sensor/light_sensor.dart';
|
|
|
|
class LightSensorService {
|
|
const LightSensorService();
|
|
|
|
Future<bool> hasSensor() async {
|
|
try {
|
|
return await LightSensor.hasSensor ?? false;
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
Stream<int> luxStream() => LightSensor.lightSensorStream;
|
|
}
|