Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter device administrator permission

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?

like image 576
Diar Avatar asked Oct 29 '22 01:10

Diar


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

like image 93
Anthony Mansour Avatar answered Nov 02 '22 05:11

Anthony Mansour