Merge pull request 'fixed notification update fixed' (#164) from fix_notification into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/164
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user