How to keep application awake in flutter?

As support for the screen plugin that @Tree mentioned has been discontinued and there are some issues with it now, you can use wakelock.
Full disclosure: I am the author of this plugin, however, it is basically a port of the wakelock functionality from the screen plugin, with the issues fixed:

import 'package:wakelock/wakelock.dart';

// To keep the screen on:
Wakelock.enable(); // or Wakelock.toggle(on: true);

// To let the screen turn off again:
Wakelock.disable(); // or Wakelock.toggle(on: false);

Learn more.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)