feat(client): 系统托盘常驻 + 关闭窗口隐藏到托盘(桌面端)
- system_tray.dart:TrayService 用 tray_manager + window_manager。setPreventClose 拦截关闭 → 隐藏到托盘(常驻保持隧道);托盘图标点击/「显示主界面」重新显示, 「退出」真正退出。 - main() 改 async:桌面端 runApp 前 init 托盘;移动端/web 跳过(isDesktop 守卫)。 - 托盘图标复用 app_icon_32.png → assets/tray_icon.png。 - 新依赖:tray_manager / window_manager。 flutter analyze 0 error;114 tests passed。托盘为运行时/原生功能,需 release .app 验证。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,8 @@ dependencies:
|
||||
shared_preferences: ^2.5.5
|
||||
package_info_plus: ^9.0.1
|
||||
launch_at_startup: ^0.5.1
|
||||
tray_manager: ^0.5.3
|
||||
window_manager: ^0.5.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@@ -42,6 +44,7 @@ flutter:
|
||||
- assets/logo-mark-white.svg
|
||||
- assets/logo-wordmark.svg
|
||||
- assets/app-icon.svg
|
||||
- assets/tray_icon.png
|
||||
|
||||
# ── 字体(由 google_fonts 运行时加载,无需本地 ttf)──
|
||||
# 若需离线/打包字体,下载 ttf 放 fonts/,并按 pubspec 模板恢复 fonts: 段。
|
||||
|
||||
Reference in New Issue
Block a user