system_tray
2.0.3, released 4 years ago by an unverified publisher
Adds system tray menu and tray icon support to Flutter desktop apps.
What it does
Allows Flutter desktop applications on Windows, macOS, and Linux to display a system tray icon, customize its appearance, manage tooltips, and create native context menus. It also supports registering system tray events like clicks, right-clicks, and double-clicks.
AI-written summary of version 2.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building a desktop application in Flutter that needs to run in the background with a system tray icon.
- Providing a native context menu or quick actions from the OS tray/menu bar.
Skip it when
- Targeting mobile or web platforms exclusively, as this package is for desktop platforms.
- Managing complex in-app UI routing or state.
Strengths
- Supports Windows, macOS, and Linux.
- Provides a rich set of tray features including custom icons, tooltips, titles, checkboxes, and submenus.
Weaknesses
- Requires platform-specific prerequisites on Linux (e.g., installing appindicator libraries).
- Some features (like tooltips or titles) have platform limitations and are not supported on all operating systems.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
On Linux, you need to install appindicator dependencies via apt-get.
Future<void> initSystemTray() async {
final SystemTray systemTray = SystemTray();
await systemTray.initSystemTray(
title: "system tray",
iconPath: 'assets/app_icon.png',
);
final Menu menu = Menu();
await menu.buildFrom([
MenuItemLabel(label: 'Exit', onClicked: (menuItem) => {}
]);
await systemTray.setContextMenu(menu);
}Alternatives
Packages that do the same job and could replace system_tray.
- tray_manager
Define system tray icons and context menus in Flutter desktop apps.
93Compare - fullscreen_window
A Flutter plugin to make your window fullscreen and get screen sizes.
53Compare
Works with
Packages commonly used together with system_tray: ones it builds on, ones built on it, and its own family.