added logic of unread notifications

This commit is contained in:
Username1548
2025-05-28 00:30:05 +07:00
parent 963ff78c25
commit b80b4e3a9e
14 changed files with 291 additions and 85 deletions

View File

@@ -202,9 +202,10 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
return badges.Badge(
position: badges.BadgePosition.topEnd(),
badgeAnimation: const badges.BadgeAnimation.fade(),
badgeContent: Text(
(state is NotificationsStateLoaded) ? state.notificationsCount.toString() : '0',
style: const TextStyle(
showBadge: state is NotificationsStateLoaded && state.hasUnreadNotifications,
badgeContent: const Text(
'',
style: TextStyle(
color: Colors.white,
fontSize: 8,
),