diff --git a/lib/view_models/notification_view_model.dart b/lib/view_models/notification_view_model.dart index fffad77..72b1c88 100644 --- a/lib/view_models/notification_view_model.dart +++ b/lib/view_models/notification_view_model.dart @@ -131,10 +131,13 @@ class NotificationViewModel with ChangeNotifier { notifications: updatedNotifications, ), ); - } - await getNotifications(page: currentPage); - await getUnreadNotifications(); + _unreadNotificationResponse = _unreadNotificationResponse?.copyWith( + data: _unreadNotificationResponse?.data?.copyWith( + notifications: [], + ), + ); + } if (context.mounted) { AppToast.success( diff --git a/lib/views/notification/strings/notification_strings.dart b/lib/views/notification/strings/notification_strings.dart index 767128a..531ce7f 100644 --- a/lib/views/notification/strings/notification_strings.dart +++ b/lib/views/notification/strings/notification_strings.dart @@ -11,7 +11,8 @@ class NotificationStrings { static const String currentPage = 'currentPage'; static const String of = 'of'; static const String totalPages = 'totalPages'; - static const String allNotificationMarkedAsRead = 'All notifications marked as read.'; + static const String allNotificationMarkedAsRead = + 'All notifications marked as read.'; static const String unknownResponse = 'Unknown response'; static const String now = 'Now'; static const String min = 'Min'; diff --git a/lib/views/notification/widgets/notification_card.dart b/lib/views/notification/widgets/notification_card.dart index 34542a6..d291abe 100644 --- a/lib/views/notification/widgets/notification_card.dart +++ b/lib/views/notification/widgets/notification_card.dart @@ -7,6 +7,8 @@ import 'package:tm_app/core/utils/size_config.dart'; import 'package:tm_app/data/services/model/notification_data/notification_data.dart'; import 'package:tm_app/view_models/notification_view_model.dart'; +import '../strings/notification_strings.dart'; + class NotificationCard extends StatelessWidget { final NotificationItem notification; const NotificationCard({required this.notification, super.key}); @@ -49,7 +51,9 @@ class NotificationCard extends StatelessWidget { ), const Spacer(), Visibility( - visible: notification.priority == 'important', + visible: + notification.priority == + NotificationStrings.important, child: Container( width: 86.0.w(), height: 24.0.h(), @@ -59,7 +63,7 @@ class NotificationCard extends StatelessWidget { ), alignment: Alignment.center, child: Text( - 'Important', + NotificationStrings.important, style: TextStyle( fontSize: 12.0.sp(), fontWeight: FontWeight.w500,