Update lib/components/list_items/message.dart, lib/utils/event_extension.dart files

This commit is contained in:
Christian Pauly 2020-05-09 14:38:27 +00:00
parent 9e42e8c275
commit 7f84729974
2 changed files with 4 additions and 3 deletions

View file

@ -55,7 +55,7 @@ class Message extends StatelessWidget {
MainAxisAlignment rowMainAxisAlignment =
ownMessage ? MainAxisAlignment.end : MainAxisAlignment.start;
if ([EventTypes.Message, EventTypes.Sticker].contains(event.type) && event.showThumbnail) {
if (event.showThumbnail) {
color = Theme.of(context).scaffoldBackgroundColor.withOpacity(0.66);
textColor = Theme.of(context).textTheme.bodyText2.color;
} else if (ownMessage) {

View file

@ -19,9 +19,10 @@ extension LocalizedBody on Event {
}
bool get showThumbnail =>
kIsWeb ||
[EventTypes.Message, EventTypes.Sticker].contains(type) &&
(kIsWeb ||
(content['info'] is Map &&
content['info']['size'] < room.client.store.maxFileSize);
content['info']['size'] < room.client.store.maxFileSize));
String get sizeString {
if (content["info"] is Map<String, dynamic> &&