fix last message preview. it had a white space in front

This commit is contained in:
Salvatore Giordano
2020-07-08 10:59:48 +02:00
parent eb5517aca3
commit 28aeb1a1a4
2 changed files with 15 additions and 14 deletions
+14 -14
View File
@@ -161,21 +161,21 @@ class ChannelPreview extends StatelessWidget {
if (lastMessage.isDeleted) { if (lastMessage.isDeleted) {
text = 'This message was deleted.'; text = 'This message was deleted.';
} else if (lastMessage.attachments != null) { } else if (lastMessage.attachments != null) {
final prefix = lastMessage.attachments final parts = <String>[
.map((e) { ...lastMessage.attachments.map((e) {
if (e.type == 'image') { if (e.type == 'image') {
return '📷'; return '📷';
} else if (e.type == 'video') { } else if (e.type == 'video') {
return '🎬'; return '🎬';
} else if (e.type == 'giphy') { } else if (e.type == 'giphy') {
return 'GIF'; return '[GIF]';
} }
return null; return null;
}) }).where((e) => e != null),
.where((e) => e != null) lastMessage.text ?? '',
.join(' '); ];
text = '$prefix ${lastMessage.text ?? ''}'; text = parts.join(' ');
} }
return Text( return Text(
+1
View File
@@ -24,6 +24,7 @@ class SendingIndicator extends StatelessWidget {
return Icon( return Icon(
Icons.done, Icons.done,
size: 8, size: 8,
color: IconTheme.of(context).color.withOpacity(0.5),
); );
} }
if (message.status == MessageSendingStatus.SENDING || if (message.status == MessageSendingStatus.SENDING ||