Merge pull request #225 from GetStream/file-size-fix

fix: Added file size fix
This commit is contained in:
Salvatore Giordano
2021-01-20 15:36:08 +01:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
@@ -62,7 +62,13 @@ class _FileAttachmentState extends State<FileAttachment> {
child: Container( child: Container(
width: widget.size?.width ?? 100, width: widget.size?.width ?? 100,
height: 56.0, height: 56.0,
color: StreamChatTheme.of(context).colorTheme.white, decoration: BoxDecoration(
color: StreamChatTheme.of(context).colorTheme.white,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: StreamChatTheme.of(context).colorTheme.greyWhisper,
),
),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -1998,7 +1998,7 @@ class MessageInputState extends State<MessageInput> {
_attachments.add(attachment); _attachments.add(attachment);
}); });
if (file.size > _kMaxAttachmentSize) { if (file.size / 1024 > _kMaxAttachmentSize) {
if (attachmentType == 'video') { if (attachmentType == 'video') {
final mediaInfo = await CompressVideoService.compressVideo(file.path); final mediaInfo = await CompressVideoService.compressVideo(file.path);
file = PlatformFile( file = PlatformFile(