INNER CODE UNIT · Dart

WakelockMacOS

creativecreatorormaybenot/wakelock · wakelock_macos/lib/wakelock_macos.dart:14

class WakelockMacOS extends WakelockPlatformInterface {
  // todo(creativecreatorormaybenot): use default method channel instance.
  static const MethodChannel _channel = MethodChannel('wakelock_macos');

  @override
  Future<void> toggle({required bool enable}) async {
    await _channel.invokeMethod('toggle', <String, dynamic>{
      'enable': enable,
    });
  }

  @override
  Future<bool> get enabled async =>
      await _channel.invokeMethod('enabled') as bool;
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…