簡體   English   中英

Flutter 桌面 windows 應用程序圖標上的通知徽章

[英]Flutter desktop windows notification badge on app icon

我好像找不到這個是否可以在應用程序圖標上添加數字? (Windows桌面)

例如,這是 windows 上的電報:

在此處輸入圖像描述

這些徽章是在通知時自動創建的。 windows 中的通知包不多。 你可以試試這個

快速通知:^0.2.1

QuickNotify.notify(
  title: 'My title',
  content: 'My content',
);

您可以使用package:windows_taskbar將徽章(覆蓋圖標)添加到 Flutter Windows 應用程序的任務欄圖標。

不過,您必須自己創建圖標,可能像大多數應用程序(如.ico文件)一樣,可能是“1”、“2”、“3”...“9”和“9+”。

它也很容易使用。

添加 pubspec.yaml

dependencies:
  windows_taskbar: ^1.1.0

設置圖標

WindowsTaskbar.setOverlayIcon(
  ThumbnailToolbarAssetIcon('assets/red_slash.ico'),
  tooltip: 'Stop',
);

不要忘記將圖標文件添加到您的pubspec.yaml資產中。

刪除圖標

WindowsTaskbar.resetOverlayIcon();

注意:我是 package 的開發人員。

windows_taskbar

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM