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 {
final Event event;
final bool tapToView;
final BoxFit fit;
const ImageBubble(this.event, {this.tapToView = true, Key key})
: super(key: key);
const ImageBubble(
this.event, {
this.tapToView = true,
this.fit = BoxFit.cover,
Key key,
}) : super(key: key);
@override
_ImageBubbleState createState() => _ImageBubbleState();
@ -63,7 +68,7 @@ class _ImageBubbleState extends State<ImageBubble> {
tag: widget.event.eventId,
child: Image.memory(
_file.bytes,
fit: BoxFit.cover,
fit: widget.fit,
),
),
);

View File

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