简体   繁体   English

从 Flutter App 按下锁定(电源)按钮

[英]Press Lock (power) button from Flutter App

I want to have a button that onpress will lock the phone screen just like the power button on phone.我想要一个按钮,onpress 将锁定手机屏幕,就像手机上的电源按钮一样。 It should work as a lock button.它应该用作锁定按钮。

Which function required on Flutter to do this?? Flutter 需要哪个 function 来执行此操作?

I don't know about any plugin that can help for this, but it can be achieved through this,我不知道有什么插件可以帮助解决这个问题,但可以通过这个来实现,

  • Write a function (Platform Specific Code), and through Platform Channel invoke particular function written in android from flutter, which will lock your device.编写一个 function(平台特定代码),并通过Platform Channel调用 android 中的 function 编写的特定 function 从 Z0ACEBC4CB4CB710DDACBB07 中写入,这将锁定您的 B76A 设备。

See docs here .请参阅此处的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM