m3_lightmeter/lib/data/caffeine_service.dart
Vadim 5602b1ed80
ML-70 Migrate to Dart 3 + stricter lints (#71)
* updated pub version

* added lint

* --code=always_use_package_imports

* dart fixes

* format

* other lints
2023-05-11 15:30:18 +02:00

15 lines
435 B
Dart

import 'package:flutter/services.dart';
class CaffeineService {
static const _methodChannel = MethodChannel("com.vodemn.lightmeter/keepScreenOn");
const CaffeineService();
Future<bool> isKeepScreenOn() async {
return _methodChannel.invokeMethod<bool>("isKeepScreenOn").then((value) => value!);
}
Future<void> keepScreenOn(bool keep) async {
await _methodChannel.invokeMethod<bool>("setKeepScreenOn", keep);
}
}