简体   繁体   English

Flutter 桌面 windows 应用程序图标上的通知徽章

[英]Flutter desktop windows notification badge on app icon

I can't seem to find this one.我好像找不到这个Is it possible to add the number on the app icon?是否可以在应用程序图标上添加数字? (windows desktop) (Windows桌面)

For example this is Telegram on windows:例如,这是 windows 上的电报:

在此处输入图像描述

These badges are autocreated on notification.这些徽章是在通知时自动创建的。 There arent much packages for notifications in windows. windows 中的通知包不多。 You can give this a try.你可以试试这个

quick_notify: ^0.2.1快速通知:^0.2.1

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

You can use package:windows_taskbar to add badge (overlay icon) to your Flutter Windows app's taskbar icon.您可以使用package:windows_taskbar将徽章(覆盖图标)添加到 Flutter Windows 应用程序的任务栏图标。

You have to create icons yourself though, maybe "1", "2", "3"... "9" & "9+" like most applications (as .ico files).不过,您必须自己创建图标,可能像大多数应用程序(如.ico文件)一样,可能是“1”、“2”、“3”...“9”和“9+”。

It's very easy to use as well.它也很容易使用。

Add in pubspec.yaml添加 pubspec.yaml

dependencies:
  windows_taskbar: ^1.1.0

Set Icon设置图标

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

Don't forget to add the icon file to your pubspec.yaml assets.不要忘记将图标文件添加到您的pubspec.yaml资产中。

Remove Icon删除图标

WindowsTaskbar.resetOverlayIcon();

NOTE : I'm developer of the package.注意:我是 package 的开发人员。

windows_taskbar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter 在推送通知上显示应用程序图标徽章 - Flutter show app icon badge on push notification 应用程序图标徽章 - Firebase 推送通知 /FCM - Flutter - App icon badge - Firebase push notification /FCM - Flutter Flutter - 推送通知到达时在应用程序图标上显示徽章编号 - Flutter - Display badge number on app icon when push notification arrives 如何使用 flutter 在应用程序图标上显示通知标志? - How to show a notification badge on the app icon using flutter? Flutter:主屏幕上 iOS 应用程序图标上的通知徽章计数器未显示(使用 FCM) - Flutter: The notification badge counter on the iOS app icon on the home screen is not showing up (using FCM) 如何更改 flutter 的桌面 windows 应用程序图标? - how to change desktop windows application icon for flutter? Flutter/Firebase 如何增加应用程序图标的徽章编号 - Flutter/Firebase How to increment Badge number of App Icon Flutter - 打开应用程序后如何删除 iOS 通知徽章 - Flutter - How to remove iOS notification badge after opening app 如何删除通知徽章-Flutter - how to remove notification badge -Flutter 收到来自 firebase 云消息传递的通知时,在图标启动器上添加徽章 - Add badge on icon launcher when receiving notification from firebase cloud messaging flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM