disable static method

Future<bool> disable()

Disable screen wake lock - allows screen to dim/lock normally

Implementation

static Future<bool> disable() async {
  if (!isSupported) {
    return false;
  }

  try {
    final result =
        await _channel.invokeMethod<Map<dynamic, dynamic>>('disable');
    _isEnabled = !(result?['success'] == true);
    debugPrint(
        'ScreenWakeLock: ${!_isEnabled ? "Disabled" : "Failed to disable"}');
    return !_isEnabled;
  } catch (e) {
    debugPrint('ScreenWakeLock: Error disabling - $e');
    return false;
  }
}