mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +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
|
/// 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;
|
||||||
|
|
||||||
//Then get information about users
|
//Then get information about users
|
||||||
final usersToGet =
|
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
|
/// 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()
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user