fix(ui): video breaks bottom photo carousel.

Signed-off-by: xsahil03x <xdsahil@gmail.com>
This commit is contained in:
Sahil Kumar
2022-06-13 14:10:21 +05:30
committed by xsahil03x
parent 97471281f0
commit 64bf65491d
2 changed files with 17 additions and 9 deletions
@@ -225,11 +225,12 @@ class _StreamGalleryFooterState extends State<StreamGalleryFooter> {
if (attachment.type == 'video') {
media = InkWell(
onTap: () => widget.mediaSelectedCallBack!(index),
child: FittedBox(
fit: BoxFit.cover,
child: AspectRatio(
aspectRatio: 1,
child: StreamVideoThumbnailImage(
video: (attachment.file?.path ??
attachment.assetUrl)!,
fit: BoxFit.cover,
),
),
);
@@ -97,8 +97,9 @@ class _StreamVideoThumbnailImageState extends State<StreamVideoThumbnailImage> {
);
}
if (!snapshot.hasData) {
return Container(
constraints: const BoxConstraints.expand(),
return SizedBox(
height: double.maxFinite,
width: double.maxFinite,
child: widget.placeholderBuilder?.call(context) ??
Shimmer.fromColors(
baseColor: _streamChatTheme.colorTheme.disabled,
@@ -106,16 +107,22 @@ class _StreamVideoThumbnailImageState extends State<StreamVideoThumbnailImage> {
child: Image.asset(
'images/placeholder.png',
fit: BoxFit.cover,
height: widget.height,
width: widget.width,
package: 'stream_chat_flutter',
),
),
);
}
return Image.memory(
snapshot.data!,
fit: widget.fit,
height: widget.height,
width: widget.width,
return SizedBox(
height: double.maxFinite,
width: double.maxFinite,
child: Image.memory(
snapshot.data!,
fit: widget.fit,
height: widget.height,
width: widget.width,
),
);
},
),