mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +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,29 +17,33 @@ class PhotoListImage extends StatelessWidget {
|
|||
return FittedBox(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
fit: BoxFit.cover,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: previewUrl,
|
||||
httpHeaders: {
|
||||
"Authorization": Api.getAuthorizationHeaderValue(account),
|
||||
},
|
||||
fadeInDuration: const Duration(),
|
||||
filterQuality: FilterQuality.high,
|
||||
errorWidget: (context, url, error) {
|
||||
// where's the preview???
|
||||
return Container(
|
||||
color: AppTheme.getListItemBackgroundColor(context),
|
||||
width: 128,
|
||||
height: 128,
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.image_not_supported,
|
||||
size: 56,
|
||||
color: Colors.white.withOpacity(.8),
|
||||
child: Container(
|
||||
// arbitrary size here
|
||||
constraints: BoxConstraints.tight(const Size(128, 128)),
|
||||
color: AppTheme.getListItemBackgroundColor(context),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: previewUrl,
|
||||
httpHeaders: {
|
||||
"Authorization": Api.getAuthorizationHeaderValue(account),
|
||||
},
|
||||
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(
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.image_not_supported,
|
||||
size: 64,
|
||||
color: Colors.white.withOpacity(.8),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||
);
|
||||
},
|
||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -60,30 +64,32 @@ class PhotoListVideo extends StatelessWidget {
|
|||
return FittedBox(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
fit: BoxFit.cover,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: previewUrl,
|
||||
httpHeaders: {
|
||||
"Authorization": Api.getAuthorizationHeaderValue(account),
|
||||
},
|
||||
fadeInDuration: const Duration(),
|
||||
filterQuality: FilterQuality.high,
|
||||
errorWidget: (context, url, error) {
|
||||
// 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,
|
||||
color: Colors.white.withOpacity(.8),
|
||||
child: Container(
|
||||
// arbitrary size here
|
||||
constraints: BoxConstraints.tight(const Size(128, 128)),
|
||||
color: AppTheme.getListItemBackgroundColor(context),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: previewUrl,
|
||||
httpHeaders: {
|
||||
"Authorization": Api.getAuthorizationHeaderValue(account),
|
||||
},
|
||||
fadeInDuration: const Duration(),
|
||||
filterQuality: FilterQuality.high,
|
||||
errorWidget: (context, url, error) {
|
||||
// no preview for this video. Normal since video preview is disabled
|
||||
// by default
|
||||
return Container(
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.videocam,
|
||||
size: 64,
|
||||
color: Colors.white.withOpacity(.8),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||
);
|
||||
},
|
||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue