toggleKeepScreen method
Toggles the keep screen awake mode.
This function prevents the device screen from turning off automatically
based on the provided isKeep
value.
Parameters:
isKeep
(required): Abool
value indicating whether to keep the screen awake (true
) or allow it to turn off (false
).
Returns:
- A Future that completes when the screen state is toggled.
Example Usage:
await toggleKeepScreen(isKeep: true); // Keep screen awake
await toggleKeepScreen(isKeep: false); // Allow screen to turn off
This method should be implemented to provide actual functionality.
Implementation
@override
Future<void> toggleKeepScreen({required bool isKeep}) async {
await ThanPkg.android.app.toggleKeepScreenOn(isKeep: isKeep);
}