fullscreen: fix placeholder aspect ratio

This commit is contained in:
Thibault Deckers 2020-04-03 10:26:35 +09:00
parent 44b6d30a49
commit 142b4a5ade

View file

@ -54,12 +54,18 @@ class ImageView extends StatelessWidget {
// if the hero tag wraps the whole `PhotoView` and the `loadingBuilder` is not provided,
// there's a black frame between the hero animation and the final image, even when it's cached.
final loadingBuilder = (context) => Image(
image: ThumbnailProvider(
entry: entry,
extent: Constants.thumbnailCacheExtent,
final loadingBuilder = (context) => Center(
child: AspectRatio(
// enforce original aspect ratio, as some thumbnails aspect ratios slightly differ
aspectRatio: entry.displayAspectRatio,
child: Image(
image: ThumbnailProvider(
entry: entry,
extent: Constants.thumbnailCacheExtent,
),
fit: BoxFit.fill,
),
),
fit: BoxFit.contain,
);
Widget child;