thumbnails: fade to higher quality
This commit is contained in:
parent
65fffdd21a
commit
1400228a43
2 changed files with 12 additions and 2 deletions
|
@ -89,7 +89,17 @@ class _ThumbnailRasterImageState extends State<ThumbnailRasterImage> {
|
||||||
? fastImage
|
? fastImage
|
||||||
: Image(
|
: Image(
|
||||||
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
|
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
|
||||||
return frame == null ? fastImage : child;
|
if (wasSynchronouslyLoaded) return child;
|
||||||
|
return AnimatedSwitcher(
|
||||||
|
duration: const Duration(milliseconds: 200),
|
||||||
|
transitionBuilder: (child, animation) => child == fastImage
|
||||||
|
? child
|
||||||
|
: FadeTransition(
|
||||||
|
opacity: animation,
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
child: frame == null ? fastImage : child,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
image: _sizedThumbnailProvider,
|
image: _sizedThumbnailProvider,
|
||||||
width: extent,
|
width: extent,
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ThumbnailCollection extends StatelessWidget {
|
||||||
final mqSize = mq.item1;
|
final mqSize = mq.item1;
|
||||||
final mqHorizontalPadding = mq.item2;
|
final mqHorizontalPadding = mq.item2;
|
||||||
TileExtentManager.applyTileExtent(mqSize, mqHorizontalPadding, _tileExtentNotifier);
|
TileExtentManager.applyTileExtent(mqSize, mqHorizontalPadding, _tileExtentNotifier);
|
||||||
final cacheExtent = TileExtentManager.extentMaxForSize(mqSize);
|
final cacheExtent = TileExtentManager.extentMaxForSize(mqSize) * 2;
|
||||||
|
|
||||||
// do not replace by Provider.of<CollectionLens>
|
// do not replace by Provider.of<CollectionLens>
|
||||||
// so that view updates on collection filter changes
|
// so that view updates on collection filter changes
|
||||||
|
|
Loading…
Reference in a new issue