clip zoomed image to page size

This commit is contained in:
Thibault Deckers 2020-05-11 11:03:49 +09:00
parent 20acac10ed
commit 868c35773c
2 changed files with 9 additions and 7 deletions

View file

@ -44,12 +44,14 @@ class MultiImagePageState extends State<MultiImagePage> with AutomaticKeepAliveC
onPageChanged: widget.onPageChanged, onPageChanged: widget.onPageChanged,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final entry = entries[index]; final entry = entries[index];
return ImageView( return ClipRect(
child: ImageView(
entry: entry, entry: entry,
heroTag: widget.collection.heroTag(entry), heroTag: widget.collection.heroTag(entry),
onScaleChanged: widget.onScaleChanged, onScaleChanged: widget.onScaleChanged,
onTap: widget.onTap, onTap: widget.onTap,
videoControllers: widget.videoControllers, videoControllers: widget.videoControllers,
),
); );
}, },
itemCount: entries.length, itemCount: entries.length,

View file

@ -109,7 +109,7 @@ class ImageView extends StatelessWidget {
context, context,
imageCache.statusForKey(uriImage).keepAlive ? uriImage : thumbnailProvider, imageCache.statusForKey(uriImage).keepAlive ? uriImage : thumbnailProvider,
), ),
loadFailedChild: EmptyContent( loadFailedChild: const EmptyContent(
icon: AIcons.error, icon: AIcons.error,
text: 'Oops!', text: 'Oops!',
alignment: Alignment.center, alignment: Alignment.center,