leanflutter / tray_manager

This plugin allows Flutter desktop apps to defines system tray.
https://pub.dev/packages/tray_manager
MIT License
230 stars 36 forks source link

Is there a way to hide the Tray Icon #29

Closed gaddlord closed 1 year ago

gaddlord commented 1 year ago

I would like to show the Tray Icon only when I minimize the app (I use Window_Manager package to that) and hide the Tray Icon after double-clicking over it.

Can this be ahieved?

lijy91 commented 1 year ago

You just need to call the destroy method.

gaddlord commented 1 year ago

I don't believe this solves my problem. I do call trayManager.destroy() on disposal. But I want to show/hide the tray icon multiple times during the application lifecycle. I believe it will be nice to have isVisible and setVisible which toggle visibility by calling Shell_NotifyIcon():

NIM_ADD = $00000000; NIM_DELETE = $00000002;