[英]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.