fix: use shimmer in images
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:video_thumbnail/video_thumbnail.dart';
|
||||
|
||||
import 'stream_svg_icon.dart';
|
||||
@@ -69,12 +71,16 @@ class _VideoThumbnailImageState extends State<VideoThumbnailImage> {
|
||||
}
|
||||
if (!snapshot.hasData) {
|
||||
return widget.placeholderBuilder?.call(context) ??
|
||||
Image.asset(
|
||||
'images/placeholder.png',
|
||||
package: 'stream_chat_flutter',
|
||||
fit: widget.fit,
|
||||
height: widget.height,
|
||||
width: widget.width,
|
||||
Shimmer.fromColors(
|
||||
baseColor:
|
||||
StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
||||
highlightColor:
|
||||
StreamChatTheme.of(context).colorTheme.whiteSmoke,
|
||||
child: Image.asset(
|
||||
'images/placeholder.png',
|
||||
fit: BoxFit.cover,
|
||||
package: 'stream_chat_flutter',
|
||||
),
|
||||
);
|
||||
}
|
||||
return Image.memory(
|
||||
|
||||
Reference in New Issue
Block a user