{"id":13785135,"url":"https://github.com/antler119/system_tray","last_synced_at":"2026-02-23T06:39:22.192Z","repository":{"id":37980985,"uuid":"386530130","full_name":"antler119/system_tray","owner":"antler119","description":"A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.","archived":false,"fork":false,"pushed_at":"2024-07-19T10:45:19.000Z","size":1985,"stargazers_count":224,"open_issues_count":25,"forks_count":64,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-23T05:48:45.235Z","etag":null,"topics":["flutter","linux","macos","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antler119.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-16T06:13:34.000Z","updated_at":"2025-10-04T13:58:53.000Z","dependencies_parsed_at":"2024-08-03T19:04:16.071Z","dependency_job_id":"f68da8f5-bcac-491e-8134-c97741e7bcbf","html_url":"https://github.com/antler119/system_tray","commit_stats":{"total_commits":48,"total_committers":8,"mean_commits":6.0,"dds":"0.33333333333333337","last_synced_commit":"5ae3d5988c493803ba31b267d8ffad9c3b0c4c18"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/antler119/system_tray","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antler119%2Fsystem_tray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antler119%2Fsystem_tray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antler119%2Fsystem_tray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antler119%2Fsystem_tray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antler119","download_url":"https://codeload.github.com/antler119/system_tray/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antler119%2Fsystem_tray/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29739024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T04:51:08.365Z","status":"ssl_error","status_checked_at":"2026-02-23T04:49:15.865Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","linux","macos","windows"],"created_at":"2024-08-03T19:00:57.311Z","updated_at":"2026-02-23T06:39:22.030Z","avatar_url":"https://github.com/antler119.png","language":"C++","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"# system_tray\n\n[![Pub](https://img.shields.io/pub/v/system_tray.svg)](https://pub.dartlang.org/packages/system_tray)\n\n\nA [Flutter package](https://github.com/antler119/system_tray.git) that enables support for system tray menu for desktop flutter apps. **on Windows, macOS, and Linux**.\n\n## Install\n\nIn the pubspec.yaml of your flutter project, add the following dependency:\n\n```yaml\ndependencies:\n  ...\n  system_tray: ^2.0.3\n```\n\nIn your library add the following import:\n\n```dart\nimport 'package:system_tray/system_tray.dart';\n```\n\n## Prerequisite\n\n### Linux\n\n```bash\nsudo apt-get install appindicator3-0.1 libappindicator3-dev\n```\nor\n\n```bash\n// For Ubuntu 22.04 or greater\nsudo apt-get install libayatana-appindicator3-dev\n```\n\n## Example App\n\n### Windows\n\n\u003cimg src=\"https://raw.githubusercontent.com/antler119/system_tray/master/resources/screenshot_windows.png\"\u003e\n\n### macOS\n\n\u003cimg src=\"https://raw.githubusercontent.com/antler119/system_tray/master/resources/screenshot_macos.png\"\u003e\n\n### Linux\n\n\u003cimg src=\"https://raw.githubusercontent.com/antler119/system_tray/master/resources/screenshot_ubuntu.png\"\u003e\n\n## API\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eMethod\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n        \u003cth\u003eWindows\u003c/th\u003e\n        \u003cth\u003emacOS\u003c/th\u003e\n        \u003cth\u003eLinux\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003einitSystemTray\u003c/td\u003e\n        \u003ctd\u003eInitialize system tray\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetSystemTrayInfo\u003c/td\u003e\n        \u003ctd\u003eModify the tray info\u003c/td\u003e\n        \u003ctd\u003e\n          \u003cul\u003e\n            \u003cli\u003eicon\u003c/li\u003e\n            \u003cli\u003etoolTip\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n          \u003cul\u003e\n            \u003cli\u003etitle\u003c/li\u003e\n            \u003cli\u003eicon\u003c/li\u003e\n            \u003cli\u003etoolTip\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/td\u003e\n       \u003ctd\u003e\n          \u003cul\u003e\n            \u003cli\u003eicon\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetImage\u003c/td\u003e\n        \u003ctd\u003eModify the tray image\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetTooltip\u003c/td\u003e\n        \u003ctd\u003eModify the tray tooltip\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e➖\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetTitle / getTitle\u003c/td\u003e\n        \u003ctd\u003eSet / Get the tray title\u003c/td\u003e\n        \u003ctd\u003e➖\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e➖\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetContextMenu\u003c/td\u003e\n        \u003ctd\u003eSet the tray context menu\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n    \u003c/tr\u003e\n       \u003ctr\u003e\n        \u003ctd\u003epopUpContextMenu\u003c/td\u003e\n        \u003ctd\u003ePopup the tray context menu\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e➖\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c/tr\u003e\n       \u003ctr\u003e\n        \u003ctd\u003edestroy\u003c/td\u003e\n        \u003ctd\u003eDestroy the tray\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eregisterSystemTrayEventHandler\u003c/td\u003e\n        \u003ctd\u003eRegister system tray event\u003c/td\u003e\n        \u003ctd\u003e\n          \u003cul\u003e\n            \u003cli\u003eclick\u003c/li\u003e\n            \u003cli\u003eright-click\u003c/li\u003e\n            \u003cli\u003edouble-click\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e         \n          \u003cul\u003e\n            \u003cli\u003eclick\u003c/li\u003e\n            \u003cli\u003eright-click\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e➖\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Menu\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eType\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n        \u003cth\u003eWindows\u003c/th\u003e\n        \u003cth\u003emacOS\u003c/th\u003e\n        \u003cth\u003eLinux\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eMenuItemLabel\u003c/td\u003e\n        \u003ctd\u003e\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eMenuItemCheckbox\u003c/td\u003e\n        \u003ctd\u003e\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eSubMenu\u003c/td\u003e\n        \u003ctd\u003e\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eMenuSeparator\u003c/td\u003e\n        \u003ctd\u003e\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n        \u003ctd\u003e✔️\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Usage\n\n```dart\nFuture\u003cvoid\u003e initSystemTray() async {\n  String path =\n      Platform.isWindows ? 'assets/app_icon.ico' : 'assets/app_icon.png';\n\n  final AppWindow appWindow = AppWindow();\n  final SystemTray systemTray = SystemTray();\n\n  // We first init the systray menu\n  await systemTray.initSystemTray(\n    title: \"system tray\",\n    iconPath: path,\n  );\n\n  // create context menu\n  final Menu menu = Menu();\n  await menu.buildFrom([\n    MenuItemLabel(label: 'Show', onClicked: (menuItem) =\u003e appWindow.show()),\n    MenuItemLabel(label: 'Hide', onClicked: (menuItem) =\u003e appWindow.hide()),\n    MenuItemLabel(label: 'Exit', onClicked: (menuItem) =\u003e appWindow.close()),\n  ]);\n\n  // set context menu\n  await systemTray.setContextMenu(menu);\n\n  // handle system tray event\n  systemTray.registerSystemTrayEventHandler((eventName) {\n    debugPrint(\"eventName: $eventName\");\n    if (eventName == kSystemTrayEventClick) {\n       Platform.isWindows ? appWindow.show() : systemTray.popUpContextMenu();\n    } else if (eventName == kSystemTrayEventRightClick) {\n       Platform.isWindows ? systemTray.popUpContextMenu() : appWindow.show();\n    }\n  });\n}\n```\n\n## Additional Resources\n\nRecommended library that supports window control:\n\n- [bitsdojo_window](https://pub.dev/packages/bitsdojo_window)\n- [window_size (Google)](https://github.com/google/flutter-desktop-embedding/tree/master/plugins/window_size)\n\n## Q\u0026A\n\n1. Q: If you encounter the following compilation error\n\n   ```C++\n   Undefined symbols for architecture x86_64:\n     \"___gxx_personality_v0\", referenced from:\n         ...\n   ```\n\n   A: add **libc++.tbd**\n\n   ```bash\n   1. open example/macos/Runner.xcodeproj\n   2. add 'libc++.tbd' to TARGET runner 'Link Binary With Libraries'\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantler119%2Fsystem_tray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantler119%2Fsystem_tray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantler119%2Fsystem_tray/lists"}