setPreventsDisplaySleepDuringVideoPlayback method
Future<void>
setPreventsDisplaySleepDuringVideoPlayback(
- bool preventsDisplaySleepDuringVideoPlayback
Sets whether the screen is prevented from sleeping during video playback.
See also VideoPlayerValue.preventsDisplaySleepDuringVideoPlayback.
Implementation
Future<void> setPreventsDisplaySleepDuringVideoPlayback(
bool preventsDisplaySleepDuringVideoPlayback,
) async {
value = value.copyWith(
preventsDisplaySleepDuringVideoPlayback: preventsDisplaySleepDuringVideoPlayback,
);
await _applyPreventsDisplaySleepDuringVideoPlayback();
}