diff --git a/lib/src/chat/chat.dart b/lib/src/chat/chat.dart index 88dd9f6b..57981d24 100644 --- a/lib/src/chat/chat.dart +++ b/lib/src/chat/chat.dart @@ -312,7 +312,19 @@ class _ChatState extends State with ChatComposer { bloc: _messagesBloc, builder: (context, state) { if (state is MessagesStateSuccess) { - return buildListItems(state); + if (state.messageIds.length > 0) { + return buildListItems(state); + } else { + return Padding( + padding: const EdgeInsets.all(listItemPaddingBig), + child: Center( + child: Text( + AppLocalizations.of(context).chatEmpty, + textAlign: TextAlign.center, + ), + ), + ); + } } else { return Center( child: CircularProgressIndicator(), diff --git a/lib/src/chat/chat_bloc.dart b/lib/src/chat/chat_bloc.dart index ed1a40ff..6691aaaf 100644 --- a/lib/src/chat/chat_bloc.dart +++ b/lib/src/chat/chat_bloc.dart @@ -98,7 +98,7 @@ class ChatBloc extends Bloc { bool isVerified = await chat.isVerified(); Color color = rgbColorFromInt(colorValue); var chatSummary = chat.get(ChatExtension.chatSummary); - dispatch(ChatLoaded(name, subTitle, color, freshMessageCount, isSelfTalk, _isGroup, chatSummary.preview, chatSummary.timestamp, isVerified)); + dispatch(ChatLoaded(name, subTitle, color, freshMessageCount, isSelfTalk, _isGroup, chatSummary?.preview, chatSummary?.timestamp, isVerified)); } } diff --git a/lib/src/chatlist/chat_list.dart b/lib/src/chatlist/chat_list.dart index ec3083e3..d3c13878 100644 --- a/lib/src/chatlist/chat_list.dart +++ b/lib/src/chatlist/chat_list.dart @@ -88,10 +88,14 @@ class _ChatListState extends State { if (state.chatIds.length > 0) { return buildListItems(state); } else { - return Center( - child: Text(AppLocalizations - .of(context) - .chatListEmpty), + return Padding( + padding: const EdgeInsets.all(listItemPaddingBig), + child: Center( + child: Text( + AppLocalizations.of(context).chatListEmpty, + textAlign: TextAlign.center, + ), + ), ); } } else if (state is! ChatListStateFailure) { diff --git a/lib/src/l10n/localizations.dart b/lib/src/l10n/localizations.dart index 9e9adc9f..6098d6f4 100644 --- a/lib/src/l10n/localizations.dart +++ b/lib/src/l10n/localizations.dart @@ -298,7 +298,7 @@ class AppLocalizations { // Chat list / invite list String get inviteEmptyList => Intl.message('No invites', name: 'inviteEmptyList'); - String get chatListEmpty => Intl.message('No chats', name: 'chatListEmpty'); + String get chatListEmpty => Intl.message('Welcome to OX Coi!\nPlease start a new chat by tapping the pen icon.', name: 'chatListEmpty'); String get chatListDeleteChatsDialogTitleText => Intl.message('Delete chats', name: 'chatListDeleteChatsDialogTitleText'); @@ -313,6 +313,9 @@ class AppLocalizations { String get recordingVideoMessageFailure => Intl.message('Video recording failed, missing permissions', name: 'recordingVideoMessageFailure'); + String get chatEmpty => Intl.message('This is a new chat. Send a message to connect!', name: 'chatEmpty'); + + // Chat profile view String get chatProfileBlockContactInfoText => Intl.message('Do you want to block the contact?', name: 'chatProfileBlockContactInfoText');