Add an icon to clearly indicate that local files are not synced

This commit is contained in:
Ming Ming 2022-09-05 13:05:48 +08:00
parent 04fcbfde94
commit 50849817a6

View file

@ -166,24 +166,40 @@ class PhotoListLocalImageItem extends PhotoListLocalFileItem {
child: FittedBox( child: 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: Image( constraints: BoxConstraints.tight(const Size(128, 128)),
image: ResizeImage.resizeIfNeeded(k.photoThumbSize, null, provider), color: AppTheme.getListItemBackgroundColor(context),
filterQuality: FilterQuality.high, child: Image(
fit: BoxFit.cover, image: ResizeImage.resizeIfNeeded(
errorBuilder: (context, e, stackTrace) { k.photoThumbSize, null, provider),
return Center( filterQuality: FilterQuality.high,
child: Icon( fit: BoxFit.cover,
Icons.image_not_supported, errorBuilder: (context, e, stackTrace) {
size: 64, return Center(
color: Colors.white.withOpacity(.8), child: Icon(
), Icons.image_not_supported,
); size: 64,
}, color: Colors.white.withOpacity(.8),
), ),
);
},
),
),
Container(
// arbitrary size here
constraints: BoxConstraints.tight(const Size(128, 128)),
alignment: AlignmentDirectional.bottomEnd,
padding: const EdgeInsets.all(8),
child: const Icon(
Icons.cloud_off,
size: 20,
color: Colors.white,
),
),
],
), ),
), ),
); );