1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 21:09:21 +00:00

Display a notice when there is no messages in a conversation

This commit is contained in:
Pierre HUBERT 2019-04-27 18:32:07 +02:00
parent d6e5b668cc
commit 92054d6e29

View File

@ -140,7 +140,6 @@ class _ConversationScreenState extends State<ConversationScreen> {
/// Apply new messages [messages] must not be null /// Apply new messages [messages] must not be null
Future<void> _applyNewMessages(ConversationMessagesList messages) async { Future<void> _applyNewMessages(ConversationMessagesList messages) async {
// We ignore new messages once the area is no longer visible // We ignore new messages once the area is no longer visible
if (!this.mounted) return; if (!this.mounted) return;
@ -267,6 +266,15 @@ class _ConversationScreenState extends State<ConversationScreen> {
); );
} }
/// Notice shown when there is no messages to show
Widget _buildNoMessagesNotice() {
return Expanded(
child: Center(
child: Text(tr("There is no message yet in this converation.")),
),
);
}
/// Messages list /// Messages list
Widget _buildMessagesList() { Widget _buildMessagesList() {
return Expanded( return Expanded(
@ -372,12 +380,10 @@ class _ConversationScreenState extends State<ConversationScreen> {
? _buildLoadingOlderMessage() ? _buildLoadingOlderMessage()
: null, : null,
), ),
_buildMessagesList(), _messages.length == 0 ? _buildNoMessagesNotice() : _buildMessagesList(),
Divider(), Divider(),
_buildSendMessageForm() _buildSendMessageForm()
], ],
); );
} }
} }