Fix boxfit

This commit is contained in:
Christian Pauly 2020-05-16 09:16:46 +02:00
parent 266cced637
commit ec0e59baa3
2 changed files with 9 additions and 4 deletions

View file

@ -7,9 +7,14 @@ import 'package:flutter/material.dart';
class ImageBubble extends StatefulWidget { class ImageBubble extends StatefulWidget {
final Event event; final Event event;
final bool tapToView; final bool tapToView;
final BoxFit fit;
const ImageBubble(this.event, {this.tapToView = true, Key key}) const ImageBubble(
: super(key: key); this.event, {
this.tapToView = true,
this.fit = BoxFit.cover,
Key key,
}) : super(key: key);
@override @override
_ImageBubbleState createState() => _ImageBubbleState(); _ImageBubbleState createState() => _ImageBubbleState();
@ -63,7 +68,7 @@ class _ImageBubbleState extends State<ImageBubble> {
tag: widget.event.eventId, tag: widget.event.eventId,
child: Image.memory( child: Image.memory(
_file.bytes, _file.bytes,
fit: BoxFit.cover, fit: widget.fit,
), ),
), ),
); );

View file

@ -43,7 +43,7 @@ class ImageView extends StatelessWidget {
minScale: 1.0, minScale: 1.0,
maxScale: 10.0, maxScale: 10.0,
panLimit: 0.0, panLimit: 0.0,
child: ImageBubble(event, tapToView: false), child: ImageBubble(event, tapToView: false, fit: BoxFit.contain),
), ),
); );
} }