betrayal 1.0.0-dev.7 copy "betrayal: ^1.0.0-dev.7" to clipboard
betrayal: ^1.0.0-dev.7 copied to clipboard

A capable tray icon plugin for Windows. Manage multiple icons, generate their images at runtime and compose them as if they were a regular widget

pub score pub version (including pre-releases) [joke shield1](#) pub publisher

betrayal #

A capable tray icon2 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 #

  • 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

Usage #

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(
      child: TrayIconWidget(
        winIcon: WinIcon.application,
        tooltip: "Here I am!"
        child: FlutterLogo()
      )
    )
  )
);

Please refer to the example subdirectory for more information and code.

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"
4
likes
0
pub points
31%
popularity

Publisher

verified publisherbent.party

A capable tray icon plugin for Windows. Manage multiple icons, generate their images at runtime and compose them as if they were a regular widget

Homepage

License

unknown (LICENSE)

Dependencies

flutter, logging, path

More

Packages that depend on betrayal