feat(llc, ui): add support for thumbUrl in video attachment. (#1362)

* feat(llc, ui): add support for thumbUrl in file attachment.

Signed-off-by: xsahil03x <[email protected]>

* chore(ui): use widget.fit instead of hardcoded fit.

Signed-off-by: xsahil03x <[email protected]>

* fix analysis

Signed-off-by: xsahil03x <[email protected]>
Co-authored-by: Salvatore Giordano <[email protected]>
This commit is contained in:
Sahil Kumar
2022-10-24 11:27:46 +02:00
committed by GitHub
co-authored by Salvatore Giordano
parent 8b6c59929f
commit 1e9e942c46
11 changed files with 101 additions and 65 deletions
@@ -195,7 +195,6 @@ class _FileTypeImage extends StatelessWidget {
shape: _getDefaultShape(context),
child: source.when(
local: () => StreamVideoThumbnailImage(
fit: BoxFit.cover,
video: attachment.file!.path!,
placeholderBuilder: (_) => const Center(
child: SizedBox(
@@ -206,7 +205,6 @@ class _FileTypeImage extends StatelessWidget {
),
),
network: () => StreamVideoThumbnailImage(
fit: BoxFit.cover,
video: attachment.assetUrl!,
placeholderBuilder: (_) => const Center(
child: SizedBox(
@@ -42,9 +42,8 @@ class StreamVideoAttachment extends StreamAttachmentWidget {
context,
StreamVideoThumbnailImage(
video: attachment.file!.path!,
thumbUrl: attachment.thumbUrl,
constraints: constraints,
fit: BoxFit.cover,
errorBuilder: (_, __) => AttachmentError(constraints: constraints),
),
);
},
@@ -56,9 +55,8 @@ class StreamVideoAttachment extends StreamAttachmentWidget {
context,
StreamVideoThumbnailImage(
video: attachment.assetUrl!,
thumbUrl: attachment.thumbUrl,
constraints: constraints,
fit: BoxFit.cover,
errorBuilder: (_, __) => AttachmentError(constraints: constraints),
),
);
},