Fixed seen item in notifications

This commit is contained in:
llsajjad
2025-09-28 12:52:13 +03:30
parent 0cbbdb1089
commit 271b253f23
3 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -234,7 +234,7 @@ class HomeViewModel with ChangeNotifier {
notifyListeners();
}
void serUnreadNotificationFalse() {
void setUnreadNotificationFalse() {
_hasUnreadNotification = false;
notifyListeners();
}
+11 -2
View File
@@ -300,8 +300,7 @@ class NotificationViewModel with ChangeNotifier {
NotificationStrings.allNotificationMarkedAsRead,
);
}
final homeViewModel = context.read<HomeViewModel>();
homeViewModel.serUnreadNotificationFalse();
setNotificationFalse(context);
} else {
_errorMessage = message;
if (context.mounted) {
@@ -340,4 +339,14 @@ class NotificationViewModel with ChangeNotifier {
return '${difference.inDays} ${NotificationStrings.daysAgo}';
}
}
void setNotificationFalse(BuildContext context) {
final homeViewModel = context.read<HomeViewModel>();
homeViewModel.setUnreadNotificationFalse();
}
void checkNotifications(BuildContext context) {
final homeViewModel = context.read<HomeViewModel>();
homeViewModel.checkUnreadNotifications();
}
}