How to deactivate screen timeout in Flutter?
You can do it using this Flutter package : https://pub.dartlang.org/packages/screen
On Android you will have to add a new permission on your AndroidManifest.xml
file
<uses-permission android:name="android.permission.WAKE_LOCK" />
Install de plugin
Add this dependency in your pubspec.yaml
file
screen: ^0.0.3
And use it in your dart files:
import 'package:screen/screen.dart';
// Prevent screen from going into sleep mode:
Screen.keepOn(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With