mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-12-26 04:48:51 +00:00
Display a notice when there is no messages in a conversation
This commit is contained in:
parent
d6e5b668cc
commit
92054d6e29
@ -140,9 +140,8 @@ class _ConversationScreenState extends State<ConversationScreen> {
|
||||
|
||||
/// Apply new messages [messages] must not be null
|
||||
Future<void> _applyNewMessages(ConversationMessagesList messages) async {
|
||||
|
||||
// We ignore new messages once the area is no longer visible
|
||||
if(!this.mounted) return;
|
||||
if (!this.mounted) return;
|
||||
|
||||
//Then get information about users
|
||||
final usersToGet =
|
||||
@ -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
|
||||
Widget _buildMessagesList() {
|
||||
return Expanded(
|
||||
@ -372,12 +380,10 @@ class _ConversationScreenState extends State<ConversationScreen> {
|
||||
? _buildLoadingOlderMessage()
|
||||
: null,
|
||||
),
|
||||
_buildMessagesList(),
|
||||
_messages.length == 0 ? _buildNoMessagesNotice() : _buildMessagesList(),
|
||||
Divider(),
|
||||
_buildSendMessageForm()
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user