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