import 'package:wakelock_plus/wakelock_plus.dart'; class ScreenManager { static bool _wakeLockEnabled = false; static bool get isWakeLockEnabled => _wakeLockEnabled; static Future enableWakeLock() async { await WakelockPlus.enable(); _wakeLockEnabled = true; } static Future disableWakeLock() async { await WakelockPlus.disable(); _wakeLockEnabled = false; } static Future toggleWakeLock() async { if (_wakeLockEnabled) { await disableWakeLock(); } else { await enableWakeLock(); } } }