From 35fc032d31bb520e823489397697d0c4b061500f Mon Sep 17 00:00:00 2001 From: Username1548 Date: Fri, 30 May 2025 21:19:49 +0700 Subject: [PATCH] fix(notifications): fixed consultantLeftComment notifications issue --- lib/features/notifications/models/notification_model.dart | 4 +++- .../presentation/widgets/notification_widget.dart | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/features/notifications/models/notification_model.dart b/lib/features/notifications/models/notification_model.dart index a8813247..766f6ddb 100644 --- a/lib/features/notifications/models/notification_model.dart +++ b/lib/features/notifications/models/notification_model.dart @@ -1,3 +1,5 @@ +import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; + sealed class BaseNotificationModel { abstract final NotificationType type; abstract final bool isRead; @@ -127,7 +129,7 @@ class ConsultantLeftCommentNotification implements BaseNotificationModel { factory ConsultantLeftCommentNotification.fromJson(Map json, NotificationType type, {bool? isRead}) { return ConsultantLeftCommentNotification( type: type, - date: json['diary_date'], + date: parseDate(json['diary_date']), isRead: isRead ?? false, ); } diff --git a/lib/features/notifications/presentation/widgets/notification_widget.dart b/lib/features/notifications/presentation/widgets/notification_widget.dart index 848fecc2..4ff0faff 100644 --- a/lib/features/notifications/presentation/widgets/notification_widget.dart +++ b/lib/features/notifications/presentation/widgets/notification_widget.dart @@ -1,5 +1,6 @@ import 'package:eatvio_app/core/theme/custom_text_style.dart'; import 'package:eatvio_app/core/theme/theme_helper.dart'; +import 'package:eatvio_app/core/utils/date_time_utils.dart'; import 'package:eatvio_app/core/widgets/custom_outlined_button.dart'; import 'package:eatvio_app/features/my_finance/presentation/pages/card_settings.dart'; import 'package:eatvio_app/features/notifications/models/notification_model.dart'; @@ -135,7 +136,7 @@ class _ConsultantLeftCommentWidget extends StatelessWidget { return _BaseNotificationWidget( isRead: notification.isRead, - notificationsText: s.consultantLeftComment(notification.date), + notificationsText: s.consultantLeftComment(notification.date.format('dd.MM.yyyy')), ); } }