tray_manager
0.9.0, released 9 days ago by leanflutter.dev
Define system tray icons and context menus in Flutter desktop apps.
What it does
Allows Flutter desktop applications for Windows, macOS, and Linux to display an icon in the system tray, complete with tooltips, custom titles, and native context menus. It exposes event listeners for tray icon clicks and menu interactions.
AI-written summary of version 0.9.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building desktop apps that need to run in the background with a system tray icon
- Managing multiple tray icons or dynamic context menus on Windows, macOS, or Linux
Skip it when
- Building mobile or web-only applications
- You require full click handling on Linux tray panels (which control menu behavior natively)
Strengths
- Cross-platform support for Windows, macOS, and Linux
- Supports multiple tray icons simultaneously via the native API
- Includes a legacy bridge for easy migration from older versions
Weaknesses
- Linux system tray depends on desktop environment capabilities (e.g., GNOME requires the AppIndicator extension)
- Some platform-specific methods are ignored or have no effect depending on the operating system
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Linux build machines require GTK 3, X11, and Xi development files (e.g., libgtk-3-dev, libx11-dev, libxi-dev).
import 'package:tray_manager/tray_manager.dart';
final trayIcon = TrayIcon.create()!;
trayIcon.icon = ImageAsset.fromAsset('images/tray_icon.png');
trayIcon.setTooltip('tray_manager');
trayIcon.setVisible(true);Alternatives
Packages that do the same job and could replace tray_manager.
- xdg_desktop_portal
A native Dart implementation of portals for Linux desktop applications.
75Compare - snapd
A Dart client for communicating with the snapd daemon on Linux systems.
74Compare - super_hot_key
Register global system-wide hot keys on macOS and Windows.
65Compare - system_tray
Adds system tray menu and tray icon support to Flutter desktop apps.
50Compare
Works with
Packages commonly used together with tray_manager: ones it builds on, ones built on it, and its own family.
- nativeapitray_manager depends on itDart bindings to native system APIs across desktop and mobile
- nativeapi_fluttertray_manager depends on itFlutter integration for nativeapi, adding widgets and type conversions.
- screen_retrieverSame familyRead desktop screen size, work area, scale factor and cursor position on Windows, macOS and Linux.
- window_managerSame familyFlutter desktop window resizing, moving, showing, hiding via nativeapi.
- hotkey_managerSame familyRegister system-wide and in-app keyboard shortcuts on desktop and Android
- protocol_handlerSame familyRegister and handle custom protocols and deep links in Flutter apps.