diff --git a/packages/flutter_chat_view/lib/src/config/chat_translations.dart b/packages/flutter_chat_view/lib/src/config/chat_translations.dart index 9744f06..3c52e19 100644 --- a/packages/flutter_chat_view/lib/src/config/chat_translations.dart +++ b/packages/flutter_chat_view/lib/src/config/chat_translations.dart @@ -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; diff --git a/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart b/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart index ee0937b..491dac1 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart @@ -267,6 +267,21 @@ class _ChatDetailScreenState extends State { 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, ], ),