Skip to content
pubscout

tray_manager

0.9.0, released 9 days ago by leanflutter.dev

Define system tray icons and context menus in Flutter desktop apps.

$ flutter pub add tray_manager
Source repository

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.

Works with

Packages commonly used together with tray_manager: ones it builds on, ones built on it, and its own family.