Fixed showing notification circular alert

This commit is contained in:
llsajjad
2025-09-28 11:32:29 +03:30
parent 0471264c56
commit ca78b76abd
+12 -4
View File
@@ -213,21 +213,29 @@ class HomeViewModel with ChangeNotifier {
Future<void> checkUnreadNotifications() async {
final result = await _homeRepository.checkUnreadNotifications();
switch (result) {
case Ok<Map<String, dynamic>>():
final response = result.value;
_hasUnreadNotification = response['success'] == true;
final data = response['data'];
if (data is List && data.isNotEmpty) {
_hasUnreadNotification = true;
} else {
_hasUnreadNotification = false;
}
break;
case Error<Map<String, dynamic>>():
_hasUnreadNotification = false;
break;
break;
}
notifyListeners();
}
void serUnreadNotificationFalse(){
void serUnreadNotificationFalse() {
_hasUnreadNotification = false;
notifyListeners();
}
}