mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-23 23:44:44 +01:00
Tweak layout of photo items
This commit is contained in:
parent
a809136474
commit
2e9bc412f5
1 changed files with 51 additions and 45 deletions
|
@ -17,6 +17,10 @@ class PhotoListImage extends StatelessWidget {
|
|||
return FittedBox(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
fit: BoxFit.cover,
|
||||
child: Container(
|
||||
// arbitrary size here
|
||||
constraints: BoxConstraints.tight(const Size(128, 128)),
|
||||
color: AppTheme.getListItemBackgroundColor(context),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: previewUrl,
|
||||
httpHeaders: {
|
||||
|
@ -25,15 +29,14 @@ class PhotoListImage extends StatelessWidget {
|
|||
fadeInDuration: const Duration(),
|
||||
filterQuality: FilterQuality.high,
|
||||
errorWidget: (context, url, error) {
|
||||
// won't work on web because the image is downloaded by the cache
|
||||
// manager instead
|
||||
// where's the preview???
|
||||
return Container(
|
||||
color: AppTheme.getListItemBackgroundColor(context),
|
||||
width: 128,
|
||||
height: 128,
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.image_not_supported,
|
||||
size: 56,
|
||||
size: 64,
|
||||
color: Colors.white.withOpacity(.8),
|
||||
),
|
||||
),
|
||||
|
@ -41,6 +44,7 @@ class PhotoListImage extends StatelessWidget {
|
|||
},
|
||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -60,6 +64,10 @@ class PhotoListVideo extends StatelessWidget {
|
|||
return FittedBox(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
fit: BoxFit.cover,
|
||||
child: Container(
|
||||
// arbitrary size here
|
||||
constraints: BoxConstraints.tight(const Size(128, 128)),
|
||||
color: AppTheme.getListItemBackgroundColor(context),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: previewUrl,
|
||||
httpHeaders: {
|
||||
|
@ -71,13 +79,10 @@ class PhotoListVideo extends StatelessWidget {
|
|||
// no preview for this video. Normal since video preview is disabled
|
||||
// by default
|
||||
return Container(
|
||||
color: AppTheme.getListItemBackgroundColor(context),
|
||||
width: 128,
|
||||
height: 128,
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.videocam,
|
||||
size: 56,
|
||||
size: 64,
|
||||
color: Colors.white.withOpacity(.8),
|
||||
),
|
||||
),
|
||||
|
@ -85,6 +90,7 @@ class PhotoListVideo extends StatelessWidget {
|
|||
},
|
||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue