Flutter device administrator permission

Viewed 1909

I'm trying to build an application that will lock the screen on a timer in Flutter. I'm wondering how to grant android device administrator permissions to an application in flutter. I've found this but it's not really helpful i feel for flutter.

https://developer.android.com/guide/topics/admin/device-admin#java

Does anyone have any suggestions?

1 Answers

There is currently no platform-agnostic Flutter implementation for locking a device screen programmatically. The Android specific page you were looking at is what you need to add admin permissions to the manifest file and implement your screen locking functionality.

You can add Android-specific Java or Kotlin code in a Flutter project as stated here: https://flutter.io/docs/development/platform-integration/platform-channels

Related