![](/img/trans.png)
[英]I am new in flutter and trying to change my app icon with Flutter Launcher Icons and getting error 'ERROR: InvalidConfigException' how i can fix this?
[英]How can I change an Icon in flutter when i add a new Entry in my Database?
所以我建立了一个工作实时数据库,我可以添加条目。 现在我想通过在底部导航栏中的图标上添加一个小红点来通知用户每当有新条目添加到数据库中时,当用户单击它时它会再次消失。 关于如何实现这一目标的任何想法?
我建议使用徽章包来实现这一点。 您必须使用自己的状态管理来确保状态更新。 如果用户进入通知屏幕,您将需要触发更新以将通知标记为已读。
return Badge(
showBadge: unreadNotifications > 0,
badgeContent: Text(
'$unreadNotifications',
style: kTextStyle,
),
position: const BadgePosition(
top: -3,
end: 3,
),
child: IconButton(
icon: const Icon(
Icons.notifications,
),
onPressed: () {
Navigator.pushNamed(context, NotificationScreen.id);
},
),
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.