init method

Future<void> init()

Restores the saved preference and applies it to the real platform wakelock. Never throws — a platform with no wakelock support (e.g. some test environments) just leaves the screen's own timeout behavior alone.

Implementation

Future<void> init() async {
  enabled.value = StorageService.to.getBool(
    StorageKeys.wakeLockEnabled,
    def: true,
  );
  await _apply(enabled.value);
}