From 4ab1ad941ab217ec01246769f86cabd6a909d89a Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 25 Feb 2026 13:41:22 +0300 Subject: [PATCH] unread message string same as web. --- .../user/notifications/unread_chat_list.dart | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/lib/views/pages/user/notifications/unread_chat_list.dart b/lib/views/pages/user/notifications/unread_chat_list.dart index fb245af3..cb5c325d 100644 --- a/lib/views/pages/user/notifications/unread_chat_list.dart +++ b/lib/views/pages/user/notifications/unread_chat_list.dart @@ -44,8 +44,8 @@ class UnReadChatList extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - messages[index].senderUserName ?? "", - style: AppTextStyles.bodyText.copyWith( + getMessage(messages[index]), + style: AppTextStyles.bodyText2.copyWith( color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, ), ).expanded, @@ -59,10 +59,10 @@ class UnReadChatList extends StatelessWidget { ), ], ), - Text( - messages[index].content ?? "", - style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral10 : const Color(0xFF757575)), - ), + // Text( + // messages[index].content ?? "", + // style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral10 : const Color(0xFF757575)), + // ), ], ).onPress(() { FirebaseNotificationManger.handleMessage(context, { @@ -77,4 +77,21 @@ class UnReadChatList extends StatelessWidget { ); })); } + + String getMessage(UnReadMessage unreadMsg) => "New Message from ${unreadMsg.senderUserName ?? ""} on ${getModuleName(unreadMsg.moduleCode ?? "0")} #${unreadMsg.referenceId ?? ""}"; + + String getModuleName(String moduleCode) { + switch (moduleCode) { + case "1": + return "CM"; + case "2": + return "Gas Refill"; + case "3": + return "Asset Transfer"; + case "6": + return "Task"; + default: + return ""; + } + } }