mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-26 09:20:45 +00:00
15 lines
460 B
Dart
15 lines
460 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<bool> keepScreenOn(bool keep) async {
|
|
return _methodChannel.invokeMethod<bool>("setKeepScreenOn", keep).then((value) => value!);
|
|
}
|
|
}
|