mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-18 18:33:49 +02:00
feat: add text in case of zero messages in chat
This commit is contained in:
parent
158973cd7a
commit
c3b03f6d38
2 changed files with 20 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue