chore: Follow up fix

This commit is contained in:
Christian Pauly 2022-07-22 11:04:47 +02:00
parent 534c84db7d
commit 4a7b980aea

View File

@ -5,6 +5,7 @@ import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
import 'package:fluffychat/utils/size_string.dart';
import 'matrix_file_extension.dart'; import 'matrix_file_extension.dart';
extension LocalizedBody on Event { extension LocalizedBody on Event {
@ -42,15 +43,10 @@ extension LocalizedBody on Event {
isThumbnailSmallEnough || isThumbnailSmallEnough ||
(content['url'] is String)); (content['url'] is String));
String? get sizeString { String? get sizeString => content
if (content['info'] is Map<String, dynamic> && .tryGetMap<String, dynamic>('info')
content['info'].containsKey('size')) { ?.tryGet<int>('size')
final size = content['info']['size']; ?.sizeString;
return size.sizeString;
} else {
return null;
}
}
static final _downloadAndDecryptFutures = <String, Future<MatrixFile>>{}; static final _downloadAndDecryptFutures = <String, Future<MatrixFile>>{};