KeepScreenOn class

The KeepScreen class controls the automatic screen off.

Constructors

KeepScreenOn()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

isAllowLockWhileScreenOn Future<bool?>
Returns true if the FLAG_ALLOW_LOCK_WHILE_SCREEN_ON flag is assigned (Android only).
no setter
isOff Future<bool?>
Returns true if automatic screen off is enabled.
no setter
isOn Future<bool?>
Returns true if automatic screen off is disabled.
no setter

Static Methods

addAllowLockWhileScreenOn({bool on = true}) Future<bool>
Assign the FLAG_ALLOW_LOCK_WHILE_SCREEN_ON flag to the window (Android only). If you specify false for on, the opposite operation is performed.
clearAllowLockWhileScreenOn() Future<bool>
Clears the FLAG_ALLOW_LOCK_WHILE_SCREEN_ON flag from the window (Android only).
turnOff({bool withAllowLockWhileScreenOn = false}) Future<bool>
Enables automatic screen off. (Reset to default.) It is recommended to call it with the dispose method of StatefulWidget.
turnOn({bool on = true, bool withAllowLockWhileScreenOn = false}) Future<bool>
Disables automatic screen off. If you specify false for on, the opposite operation is performed.