turnOn static method

Future<bool> turnOn({
  1. bool on = true,
  2. bool withAllowLockWhileScreenOn = false,
})

Disables automatic screen off. If you specify false for on, the opposite operation is performed.

If withAllowLockWhileScreenOn is set to true, the FLAG_ALLOW_LOCK_WHILE_SCREEN_ON flag will also be assigned at the same time (Android only).

Implementation

static Future<bool> turnOn({ bool on = true, bool withAllowLockWhileScreenOn = false }) {
  return KeepScreenOnPlatform.instance.turnOn(
    on: on,
    withAllowLockWhileScreenOn: withAllowLockWhileScreenOn,
  );
}