fix file attachment
This commit is contained in:
@@ -227,7 +227,9 @@ class FileAttachment extends AttachmentWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (message.status == null || message.status == MessageSendingStatus.sent) {
|
if (message != null &&
|
||||||
|
(message.status == null ||
|
||||||
|
message.status == MessageSendingStatus.sent)) {
|
||||||
trailingWidget = IconButton(
|
trailingWidget = IconButton(
|
||||||
icon: StreamSvgIcon.cloudDownload(color: theme.colorTheme.black),
|
icon: StreamSvgIcon.cloudDownload(color: theme.colorTheme.black),
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@@ -253,6 +255,9 @@ class FileAttachment extends AttachmentWidget {
|
|||||||
);
|
);
|
||||||
return attachment.uploadState?.when(
|
return attachment.uploadState?.when(
|
||||||
preparing: () {
|
preparing: () {
|
||||||
|
if (message == null) {
|
||||||
|
return Text('${fileSize(size, 2)}', style: textStyle);
|
||||||
|
}
|
||||||
return UploadProgressIndicator(
|
return UploadProgressIndicator(
|
||||||
uploaded: 0,
|
uploaded: 0,
|
||||||
total: double.maxFinite.toInt(),
|
total: double.maxFinite.toInt(),
|
||||||
|
|||||||
Reference in New Issue
Block a user