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 ""; + } + } }