feat: Send multiple images at once
This commit is contained in:
parent
fae0436f4e
commit
765583dbbe
7 changed files with 129 additions and 99 deletions
|
|
@ -45,20 +45,8 @@ extension LocalizedBody on Event {
|
|||
String? get sizeString {
|
||||
if (content['info'] is Map<String, dynamic> &&
|
||||
content['info'].containsKey('size')) {
|
||||
num size = content['info']['size'];
|
||||
if (size < 1000000) {
|
||||
size = size / 1000;
|
||||
size = (size * 10).round() / 10;
|
||||
return '${size.toString()} KB';
|
||||
} else if (size < 1000000000) {
|
||||
size = size / 1000000;
|
||||
size = (size * 10).round() / 10;
|
||||
return '${size.toString()} MB';
|
||||
} else {
|
||||
size = size / 1000000000;
|
||||
size = (size * 10).round() / 10;
|
||||
return '${size.toString()} GB';
|
||||
}
|
||||
final size = content['info']['size'];
|
||||
return size.sizeString;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue