feat: add text in case of zero messages in chat

This commit is contained in:
Vick Top 2024-04-18 13:26:04 +02:00
parent 158973cd7a
commit c3b03f6d38
2 changed files with 20 additions and 0 deletions

View file

@ -14,6 +14,9 @@ class ChatTranslations {
this.startTyping = 'Start typing to find a user to chat with.',
this.cancelImagePickerBtn = 'Cancel',
this.messagePlaceholder = 'Write your message here...',
this.writeMessageToStartChat = 'Write a message to start the chat.',
this.writeFirstMessageInGroupChat =
'Write the first message in this group chat.',
this.imageUploading = 'Image is uploading...',
this.deleteChatButton = 'Delete',
this.deleteChatModalTitle = 'Delete chat',
@ -42,6 +45,8 @@ class ChatTranslations {
final String startTyping;
final String cancelImagePickerBtn;
final String messagePlaceholder;
final String writeMessageToStartChat;
final String writeFirstMessageInGroupChat;
final String imageUploading;
final String deleteChatModalTitle;
final String deleteChatModalDescription;

View file

@ -267,6 +267,21 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
reverse: true,
padding: const EdgeInsets.only(top: 24.0),
children: [
if (detailRows.isEmpty)
Center(
child: Text(
(chatModel is GroupChatModel)
? widget.translations
.writeFirstMessageInGroupChat
: widget
.translations.writeMessageToStartChat,
style: const TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w400,
color: Color.fromRGBO(33, 33, 33, 1),
),
),
),
...detailRows,
],
),