A capable library for managing Windows tray icons in your Flutter app 🦋

Overview

skip to content

A capable tray icon plugin for Windows.

🔗 package on pub.dev
🔗 source on github.com
🔗 dart docs api reference

Manage multiple icons 👨‍👩‍👦‍👦,
generate their images at runtime 🎨
and compose them just like a widget 🎶

Features

pub score pub version (including pre-releases) joke shield pub publisher

  • Control multiple tray icons
  • Many options for setting the tray icons image
    • .ico file either from the file system or the Flutter assets directory
    • Set the pixels directly through an image buffer - you can use this to dynamically create an image via canvas!
    • Use default system icons like the or the elevation prompt 🛡️
  • Widget api - treat the tray icon as part of your UI and compose it in your build methods
demo.mp4

Usage

After you've added betrayal to your dependencies via flutter pub add betrayal and flutter pub get, you can start to use it:

import 'package:betrayal/betrayal.dart';

// ...

@override
Widget build(BuildContext context) => MaterialApp(
  home: Scaffold(
    appBar: AppBar(
      title: const Text("Look at the system tray 👀")
    ),
    body: Center(
      // The icon will be visible aslong as the [TrayIconWidget] will be built
      child: TrayIconWidget(
        winIcon: WinIcon.application,
        tooltip: "Here I am!"
        child: FlutterLogo()
      )
    )
  )
);

If you just want a tray icon, that's pretty much all you need to know.

There is, however, also a quick-guide README.md, four example applications and of course the API docs, if you do want to learn more.

Don't hesitate to file an issue, I'll have a look at it eventually 😊

Development

Style

Use conventionalcommits.org/en/v1.0.0 for commits.
Use dart.dev/guides/language/effective-dartdocumentation for docs.

Overview

  graph LR;
    BetrayalPlugin o----o |connects via platform channel to| betrayal_plugin.cpp
    subgraph dart
    TrayIconWidget -- manages --> TrayIcon -- calls --> BetrayalPlugin
    TrayIcon -- uses --> TrayIconImageDelegate -- calls --> BetrayalPlugin
    BetrayalLogConfig
    end
    subgraph native
    betrayal_plugin.cpp -- holds --> IconManager.hpp
    IconManager.hpp -- provides TrayIcon.hpp to --> betrayal_plugin.cpp
    betrayal_plugin.cpp -- calls --> TrayIcon.hpp
    end
    click BetrayalPlugin "https://github.com/benthillerkus/betrayal/blob/main/lib/src/plugin.dart"
    click TrayIcon "https://github.com/benthillerkus/betrayal/blob/main/lib/src/imperative.dart"
    click TrayIconWidget "https://github.com/benthillerkus/betrayal/blob/main/lib/src/widgets.dart"
    click TrayIconImageDelegate "https://github.com/benthillerkus/betrayal/blob/main/lib/src/image.dart"
    click betrayal_plugin.cpp "https://github.com/benthillerkus/betrayal/blob/main/windows/betrayal_plugin.cpp"
    click IconManager.hpp "https://github.com/benthillerkus/betrayal/blob/main/windows/icon_manager.hpp"
    click TrayIcon.hpp "https://github.com/benthillerkus/betrayal/blob/main/windows/tray_icon.hpp"

Footnotes

  1. This is a lie. Flutter does not support Windows 2000. Betrayal.

Comments
  • chore(main): release 1.0.0-dev.6

    chore(main): release 1.0.0-dev.6

    opened by github-actions[bot] 2
  • chore(main): release 1.2.5

    chore(main): release 1.2.5

    :robot: I have created a release beep boop

    1.2.5 (2022-07-27)

    Documentation

    • readme: improve rendering on pub.dev (167edb4)

    Miscellaneous

    • deps: bump flutter_lints from 1.0.4 to 2.0.1 (#28) (5b36e87)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.2.4

    chore(main): release 1.2.4

    :robot: I have created a release beep boop

    1.2.4 (2022-05-16)

    Documentation

    • demonstrate integration with leanflutter/contextual_menu (9704cf6), closes #4
    • example: fix crash when trying to downscale image on isolate (dacf5ae)
    • example: make context menu usable through leanflutter/window_manager (37d0789)
    • example: remove unused dependency (c1ad065)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.2.3

    chore(main): release 1.2.3

    :robot: I have created a release beep boop

    1.2.3 (2022-04-20)

    Documentation

    • fix typo in generic description for enum extensions (47c01c0)

    Miscellaneous

    • pubspec: slightly reduce cringiness of description (78e47f6), closes #24
    • update deps, format file (03ca002)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.2.2

    chore(main): release 1.2.2

    :robot: I have created a release beep boop

    1.2.2 (2022-04-18)

    Miscellaneous

    • pubspec: fix typo (1210cdc)
    • pubspec: improve metadata for pub.dev (6e9309d)

    Documentation

    • pubspec: add example readme as link to external documentation (1f740bc)
    • readme: improve readability a bit (ce33aff)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.2.1

    chore(main): release 1.2.1

    :robot: I have created a release beep boop

    1.2.1 (2022-04-18)

    Bug Fixes

    • improve code quality for custom ids feature (35583f7)
    • native: let Windows handle all unhandled user type messages (22625a4)

    Documentation

    • example: make add_many example more understandable (5cadfb8)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.2.0

    chore(main): release 1.2.0

    :robot: I have created a release beep boop

    1.2.0 (2022-04-18)

    Features

    • allow setting a custom value for icon id (829c287)

    Bug Fixes

    • don't return default values for preferredImageSize (b2540f2), closes #10

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.1.0

    chore(main): release 1.1.0

    :robot: I have created a release beep boop

    1.1.0 (2022-04-17)

    ⚠ BREAKING CHANGES

    • BetrayalPlugin() and BetrayalLogConfig() have been replaced with .instance respectively.

    Bug Fixes

    Documentation

    • example: add_many visualize all icons as a grid (315aa0f)
    • example: refactor add_many example. (cca1c42)
    • readme: add short section about hot restart (0e52401)

    Miscellaneous

    • branding: improve font kerning in art assets (18fbd94)
    • make singletons explicit (772730e)
    • mark .instances as protected (7d9dafd)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.0.0

    chore(main): release 1.0.0

    :robot: I have created a release beep boop

    1.0.0 (2022-04-15)

    Documentation

    • readme: add demo video (4d95454)
    • readme: use assets to make readme a bit prettier (1a5094f)
    • upload assets (82a5946)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.0.0-dev.7

    chore(main): release 1.0.0-dev.7

    :robot: I have created a release beep boop

    1.0.0-dev.7 (2022-04-14)

    ⚠ BREAKING CHANGES

    Features

    • retrieve the correct icon dimensions (e8fed3b)

    Bug Fixes

    • ensure that setting onTap on a not-yet-realized icon is safe (5d2a1d6)
    • make getter for large image size return "" (f01d655)

    Miscellaneous

    Documentation

    • example: finish renaming into select_image (95db76e)
    • example: improve downscaling quality (0c08f84)
    • example: rename edit_icon into select_image (5e377ea)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore(main): release 1.0.0-dev.5

    chore(main): release 1.0.0-dev.5

    :robot: I have created a release beep boop

    1.0.0-dev.5 (2022-04-10)

    Bug Fixes

    • remove emoji from pubspec.yaml (a24b827)

    Documentation

    • readme: implement further advances in fanciness (5e1f055)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • Try using the new Finalizer to clean up icons before hot reloading

    Try using the new Finalizer to clean up icons before hot reloading

    Currently, you have to call the plugin before runApp, to remove residual icons from the before reloading automatically.

    Instead, the new Finalizers could be used to remove the icons before reloading. Users would straight up not have to worry about this anymore.

    To investigate:

    • [ ] Would it work
    • [ ] Would it be ok to require Dart 2.17 for it?
    enhancement good first issue 
    opened by benthillerkus 0
  • Support more platforms

    Support more platforms

    It may or may not make sense to split this package into pieces, so that other packages can use it more easily for federation.

    I'm also open for patches adding implementations for Linux or Mac, but I don't own a Mac, so I'd be most comfortable if a Mac implementation delegated the work to another plugin that is known to work.

    I may or may not work on Linux support myself at some point, but it doesn't have much priority for me at the moment.

    enhancement help wanted 
    opened by benthillerkus 0
Releases(v1.2.5)
  • v1.2.5(Jul 27, 2022)

  • v1.2.4(May 16, 2022)

  • v1.2.3(Apr 20, 2022)

  • v1.2.2(Apr 18, 2022)

  • v1.2.1(Apr 18, 2022)

  • v1.2.0(Apr 18, 2022)

  • v1.1.0(Apr 17, 2022)

    1.1.0 (2022-04-17)

    ⚠ BREAKING CHANGES

    • BetrayalPlugin() and BetrayalLogConfig() have been replaced with .instance respectively.

    Bug Fixes

    Documentation

    • example: add_many visualize all icons as a grid (315aa0f)
    • example: refactor add_many example. (cca1c42)
    • readme: add short section about hot restart (0e52401)

    Miscellaneous

    • branding: improve font kerning in art assets (18fbd94)
    • make singletons explicit (772730e)
    • mark .instances as protected (7d9dafd)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Apr 15, 2022)

  • v1.0.0-dev.7(Apr 14, 2022)

    1.0.0-dev.7 (2022-04-14)

    ⚠ BREAKING CHANGES

    Features

    • retrieve the correct icon dimensions (e8fed3b)

    Bug Fixes

    • ensure that setting onTap on a not-yet-realized icon is safe (5d2a1d6)
    • make getter for large image size return "" (f01d655)

    Miscellaneous

    Documentation

    • example: finish renaming into select_image (95db76e)
    • example: improve downscaling quality (0c08f84)
    • example: rename edit_icon into select_image (5e377ea)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-dev.6(Apr 12, 2022)

  • v1.0.0-dev.5(Apr 10, 2022)

  • v1.0.0-dev.4(Apr 10, 2022)

  • v1.0.0-dev.3(Apr 10, 2022)

  • v1.0.0-dev.2(Apr 10, 2022)

  • v1.0.0-dev.1(Apr 10, 2022)

    1.0.0-dev.1 (2022-04-10)

    ⚠ BREAKING CHANGES

    • plugin: remove TrayIconData
    • api: make TrayIconImageDelegate named parameter name in setIcon less verbose
    • plugin: image, picture and freeRessources have been removed. Users have to pass a ByteBuffer now instead.
    • plugin: disable image cleanup per default
    • example: turn builder from a positional parameter into an optional named parameter
    • example: the ElementSelector related widgets need to be imported now.
    • example: The Element Selector widget api changed a bit.
    • basically everything 🤏

    Features

    • add logging (89360e9)
    • api: make TrayIconImageDelegate public (64d945f)
    • example: add labels to Selector view (e5b8a24)
    • example: allow subclassing ElementSelectorData to add additional fields (b816880)
    • example: change tray icon when selection changes (8b0fdae)
    • example: hide icon when every Selectable has been removed (6eaaf73)
    • example: make tooltip / label text changeable (786cf5a)
    • example: move example specific logic out of ElementSelector. (16875ea)
    • example: set loaded image as icon image (20f3fcd)
    • introduce widgets api (74c1d31)
    • make logging customizable (439909a)

    Bug Fixes

    • example: animate label out after removing icon (07dcdc6)
    • example: don't hide icon after every removal (5410e5d)
    • example: keep the last element selected, when the current view is the plus icon (d5d03d8)
    • example: make Selectable widget immutable (5faecae)
    • example: select the correct element after removing the selection (9d12e73)
    • example: show tray icon immediately. The user does not have to change their selection first (7ad2993)
    • example: update configuration / dependencies (471c171)
    • plugin: call update on icon after changing tooltip (ed3b9fe)
    • plugin: clear icons on hot restart (bc9484d)
    • plugin: disable image cleanup per default (b0f4447)
    • windows: call icon->update whenever any property is being changed (50ee78e)

    Code Refactoring

    • plugin: remove TrayIconData (743a2b5)

    Miscellaneous Chores

    • api: make TrayIconImageDelegate named parameter name in setIcon less verbose (6195752)
    • example: move the ElementSelector related classes into seperate files (ca93fa8)
    • example: turn builder from a positional parameter into an optional named parameter (3f51b06)
    • make an initial commit (2628331)
    • plugin: delegate setting the icon image to new TrayIconImageDelegate (dd7690e)
    • prepare publishing a preview version (420db07)
    Source code(tar.gz)
    Source code(zip)
Flutter plugin to implement a Boom Menu, with icons, title, subtitle, animated FAB Icons and hide on scrolling.

Flutter Boom Menu Usage The BoomMenu widget is built to be placed in the Scaffold.floatingActionButton argument, replacing the FloatingActionButton wi

Mohanraj 88 Aug 1, 2022
Fluent System Icons are a collection of familiar, friendly and modern icons from Microsoft.

Fluent UI System Icons Fluent UI System Icons are a collection of familiar, friendly and modern icons from Microsoft. Icon List View the full list of

Microsoft 4.3k Dec 29, 2022
A ListView widget capable of pinning a child to the top of the list.

PinnableListView A Flutter ListView widget that allows pinning a ListView child to the top of the list. Demo Getting Started Define the list PinCont

Jan Hrastnik 2 May 17, 2020
A dynamic, Stream-based API for job scheduling in Dart, capable of processing on different triggers.

Pendulum A library for task-scheduling in Dart. Exports a Task class that returns Streams, with a number of versatile options to customize how Tasks a

Aditya Kishore 1 Aug 22, 2020
🍪 Colorful Icons for your Flutter App

Koukicons ?? This package provides +700 Colorful Icons for Flutter Apps. ?? Screenshot ❓ How to use To use this plugin, add koukicons as a dependency

Adem Kouki 139 Oct 20, 2022
Integrate any icons you like to your flutter app

Flutter Tutorial - Icons - Custom & Plugin Icons Integrate any icons you like to your flutter app - Material Icons, Beautiful Icons & Custom Icons. ⚡

Behruz Hurramov 1 Dec 28, 2021
Icons Launcher - A command-line tool that simplifies the task of updating your Flutter app's launcher icon.

Icons Launcher - A command-line tool that simplifies the task of updating your Flutter app's launcher icon. Full flexibility allows you to only update the launcher icon for specific platforms as needed.

Mrr Hak 48 Nov 17, 2022
New trick on how to create your own custom icons in flutter with bottom bar navigation

Customized Bottom Navigation Bar in Flutter | Tech With Sam Customized Bottom Navigation Bar in Flutter - Watch on youtube ✌   App Preview App Screens

Samuel Adekunle 10 Oct 26, 2022
The COCO icon pack with - +600 Editable icons available for your flutter project.

cocoicons The COCO icon pack with - +600 Editable icons available for your flutter project. Made from COCO icon pack. ?? Installation In the dependenc

Samuel Abada 5 Sep 23, 2022
Basic file managing app for Android using Flutter framework

core_file_manager A simple application for managing files on Android devices using Flutter framework core_file_manager Getting Started Running the app

Mohamed Naga 25 Sep 20, 2022
Packup - Flutter app for managing delivered packages in office

Packup Mobile app for Android and iOS with web admin panel, for managing package

Jan Lewandowski 0 Jan 22, 2022
Building a simple Flutter app for understanding the BLoC State Management including: Cubit, Managing Route & showSnackBar.

Building a simple Flutter app for understanding the BLoC State Management including: Cubit, Managing Route & showSnackBar.

TAD 8 Dec 3, 2022
Practice building basic animations in apps along with managing app state by BLoC State Management, Flutter Slider.

Practice building basic animations in apps along with managing app state by BLoC State Management including: Cubit & Animation Widget, Flutter Slider.

TAD 1 Jun 8, 2022
Building a simple Flutter app * Switch Theme * for understanding the BLoC State Management including: Cubit Communications with StreamSubscription & Managing Route.

Building a simple Flutter app * Switch Theme * for understanding the BLoC State Management including: Cubit Communications with StreamSubscription & Managing Route.

TAD 1 Oct 3, 2022
Money_manager - This app helps you with managing Income and Expense

Expense App This app helps you with managing Income and Expense. It is coded in flutter, dart hive. TBH I want to code the same app in Flutter , React

Prince 10 Nov 14, 2022
Flutter file manager - Flutter package for managing files on Android

flutter_file_utils Helper tools for managing files on Android. Getting Started For help getting started with Flutter, view our online documentation. F

Mohamed Naga 35 Nov 11, 2022
Flutter Downloader - A plugin for creating and managing download tasks. Supports iOS and Android.

Flutter Downloader A plugin for creating and managing download tasks. Supports iOS and Android. This plugin is based on WorkManager in Android and NSU

Flutter Community 789 Jan 3, 2023
This package helps developer to sort the flutter/dart packages and plugins alphabetically, This makes it easier when managing too many packages and when working with teams

Package helps to sort the flutter/dart packages and plugins alphabetically, This makes it easier when managing too many packages and when working with

DANCHE 7 Dec 21, 2022
Song Tinder aims to ease the pain of managing song playlists

Song Tinder aims to ease the pain of managing song playlists. This is done by mainly focusing on a Tinder-like swipe card based interface which can be used for anything from sorting your existing playlists to finding new music.

null 5 Nov 17, 2022