[英]Change Flutter local notification icon background color
大家好,我想知道如何更改本地通知图标的背景色/强调色。 我知道改变 firebase 消息图标背景我们使用这个
<meta-data android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/background_color" />
但我找不到 flutter 本地通知的任何内容,它始终是灰色的。 有任何想法吗?
您可以通过在 NotificationDetails 中指定颜色来更改图标颜色。 但要确保图标是单色的并且背景是透明的。
NotificationDetails(
android: AndroidNotificationDetails('id', 'name', 'des',
// Specify the color
color: const Color.fromARGB(255, 255, 0, 0),
importance: Importance.max),
iOS: IOSNotificationDetails(),
);
将您不想显示的图像的所有部分转换为透明像素。 所有颜色和非透明像素均以白色显示
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.