mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Indicate an item is a video
This commit is contained in:
parent
2e9bc412f5
commit
4079ba39f2
1 changed files with 41 additions and 26 deletions
|
@ -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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue