开机自动启动 #97
Replies: 12 comments
-
目前大概可行的办法: dependencies:
flutter:
sdk: flutter
flutter_windowmanager: ^0.1.4 在代码中可以这样实现: void main() {
runApp(NyaLCF());
// 注册开机自启动
registerStartup();
}
void registerStartup() async {
try {
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE);
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_KEEP_SCREEN_ON);
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SHOW_WALLPAPER);
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_TURN_SCREEN_ON);
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON);
} catch (e) {
print("Error registering startup: $e");
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
草你妈我上一个月发的玩意你现在才看到是吧( |
Beta Was this translation helpful? Give feedback.
-
@ltzXiaoYanMo 你不看我代码写的啥( |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
https://github.com/Muska-Ami/NyaLCF/blob/main/lib/utils/frpc/startup_loader.dart |
Beta Was this translation helpful? Give feedback.
-
允许开机自动启动并设置自启动隧道
Beta Was this translation helpful? Give feedback.
All reactions