aves/lib/services/window_service.dart
2021-02-15 16:58:49 +09:00

16 lines
496 B
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
class WindowService {
static const platform = MethodChannel('deckers.thibault/aves/window');
static Future<void> keepScreenOn(bool on) async {
try {
await platform.invokeMethod('keepScreenOn', <String, dynamic>{
'on': on,
});
} on PlatformException catch (e) {
debugPrint('keepScreenOn failed with code=${e.code}, exception=${e.message}, details=${e.details}');
}
}
}