mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +01:00
Merge branch 'soru/aspect-ratio' into 'main'
fix: Make sure the aspect ratio of image bubbles stays the same See merge request famedly/fluffychat!448
This commit is contained in:
commit
881830f246
@ -355,6 +355,12 @@ class _ImageBubbleState extends State<ImageBubble> {
|
|||||||
content = getPlaceholderWidget();
|
content = getPlaceholderWidget();
|
||||||
key = 'placeholder';
|
key = 'placeholder';
|
||||||
}
|
}
|
||||||
|
if (widget.maxSize) {
|
||||||
|
content = AspectRatio(
|
||||||
|
aspectRatio: widget.width / widget.height,
|
||||||
|
child: content,
|
||||||
|
);
|
||||||
|
}
|
||||||
return ClipRRect(
|
return ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(widget.radius),
|
borderRadius: BorderRadius.circular(widget.radius),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
@ -365,8 +371,12 @@ class _ImageBubbleState extends State<ImageBubble> {
|
|||||||
duration: Duration(milliseconds: 1000),
|
duration: Duration(milliseconds: 1000),
|
||||||
child: Container(
|
child: Container(
|
||||||
key: ValueKey(key),
|
key: ValueKey(key),
|
||||||
height: widget.maxSize ? widget.height : null,
|
constraints: widget.maxSize
|
||||||
width: widget.maxSize ? widget.width : null,
|
? BoxConstraints.loose(Size(
|
||||||
|
widget.width,
|
||||||
|
widget.height,
|
||||||
|
))
|
||||||
|
: null,
|
||||||
child: content,
|
child: content,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user