fix: show personal diet name and consultant notifications

This commit is contained in:
2026-11-06 14:22:55 +03:00
parent ad70d0988e
commit 6c4572af55
26 changed files with 323 additions and 34 deletions

View File

@@ -122,6 +122,9 @@ class NotificationWidget extends StatelessWidget {
PersonalDietIsDefinedToCustomerNotification() => _PersonalDietIsDefinedToCustomerWidget(
notification: notification as PersonalDietIsDefinedToCustomerNotification,
),
PersonalDietIsDefinedToAuthorNotification() => _PersonalDietIsDefinedToAuthorWidget(
notification: notification as PersonalDietIsDefinedToAuthorNotification,
),
// New Widgets
ConsultantEducationUpdatedNotification() => _ConsultantEducationUpdatedWidget(notification: notification as ConsultantEducationUpdatedNotification),
ComplaintRegisteredNotification() => _ComplaintRegisteredWidget(notification: notification as ComplaintRegisteredNotification),
@@ -1273,6 +1276,27 @@ class _PersonalDietIsDefinedToCustomerWidget extends StatelessWidget {
}
}
class _PersonalDietIsDefinedToAuthorWidget extends StatelessWidget {
const _PersonalDietIsDefinedToAuthorWidget({required this.notification});
final PersonalDietIsDefinedToAuthorNotification notification;
@override
Widget build(BuildContext context) {
final userName = notification.userName.isNotEmpty ? notification.userName : 'Пользователь';
final dietName = notification.dietName.isNotEmpty ? ', выбранная диета: «${notification.dietName}»' : '';
return _BaseNotificationWidget(
isRead: notification.isRead,
notificationsText: 'Вы предложили персональную диету пользователю $userName$dietName',
createdAt: notification.createdAt,
onTap: notification.peerSlug.isEmpty
? null
: () {
context.push(RouteConstants.profileScreen, extra: notification.peerSlug);
},
);
}
}
class _ConsultantEducationUpdatedWidget extends StatelessWidget {
const _ConsultantEducationUpdatedWidget({required this.notification});
final ConsultantEducationUpdatedNotification notification;