Home > front end >  keep screen active with Flutter
keep screen active with Flutter

Time:04-08

There is a part of my app, where the user will go to a text screen, and while the user is on that page, I want the device screen not to turn off, but to keep it on, and if the user leaves this page, this function be deactivated. How can I do this with flutter?

CodePudding user response:

Option A: Use a package

I would use a package for what you are trying to accomplish such as:

Option B: Write platform specific code

If you don't want to use a package, you should investigate how this functionality can be implemented on Android and iOS in native code. Such as:

Then you should refer to the Flutter documentation for writing code towards specific platforms and integrate it into your codebase: https://docs.flutter.dev/development/platform-integration/platform-channels

  • Related