I want to have a button that onpress will lock the phone screen just like the power button on phone. It should work as a lock button.
Which function required on Flutter to do this??
I don't know about any plugin that can help for this, but it can be achieved through this,
Platform Channel
invoke particular function written in android from flutter, which will lock your device.See docs here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.