Indicate an item is a video

This commit is contained in:
Ming Ming 2021-06-22 13:23:28 +08:00
parent 2e9bc412f5
commit 4079ba39f2

View file

@ -64,32 +64,47 @@ class PhotoListVideo extends StatelessWidget {
return FittedBox( return FittedBox(
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
fit: BoxFit.cover, fit: BoxFit.cover,
child: Container( child: Stack(
// arbitrary size here children: [
constraints: BoxConstraints.tight(const Size(128, 128)), Container(
color: AppTheme.getListItemBackgroundColor(context), // arbitrary size here
child: CachedNetworkImage( constraints: BoxConstraints.tight(const Size(128, 128)),
imageUrl: previewUrl, color: AppTheme.getListItemBackgroundColor(context),
httpHeaders: { child: CachedNetworkImage(
"Authorization": Api.getAuthorizationHeaderValue(account), imageUrl: previewUrl,
}, httpHeaders: {
fadeInDuration: const Duration(), "Authorization": Api.getAuthorizationHeaderValue(account),
filterQuality: FilterQuality.high, },
errorWidget: (context, url, error) { fadeInDuration: const Duration(),
// no preview for this video. Normal since video preview is disabled filterQuality: FilterQuality.high,
// by default errorWidget: (context, url, error) {
return Container( // no preview for this video. Normal since video preview is disabled
child: Center( // by default
child: Icon( return Container(
Icons.videocam, child: Center(
size: 64, child: Icon(
color: Colors.white.withOpacity(.8), Icons.image_not_supported,
), size: 64,
), color: Colors.white.withOpacity(.8),
); ),
}, ),
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet, );
), },
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
),
),
Container(
// arbitrary size here
constraints: BoxConstraints.tight(const Size(128, 128)),
alignment: AlignmentDirectional.topEnd,
padding: const EdgeInsets.all(8),
child: const Icon(
Icons.play_circle_outlined,
size: 24,
color: Colors.white,
),
),
],
), ),
); );
} }