Merge pull request 'Fixed showing notification circular alert' (#184) from notification_curcilar_alert into main

Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/184
This commit is contained in:
a.ghabeli
2025-09-28 11:35:44 +03:30
+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();
}
}