mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 15:30:59 +00:00
5602b1ed80
* updated pub version * added lint * --code=always_use_package_imports * dart fixes * format * other lints
15 lines
435 B
Dart
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);
|
|
}
|
|
}
|