[英]Cant find the right widget combination, if it exists
I have an Image (which is a map), that I want to always fill its container, but keeping its aspect ratio.我有一个图像(这是一张地图),我想总是填充它的容器,但保持它的纵横比。
I put it inside an InteractiveViewer, so it can be zoomed and panned.我把它放在一个 InteractiveViewer 中,所以它可以缩放和平移。
When the interactiveviewer zoom level is minimum(1) the whole width of the image must fit the container, and if the height does not fit, It should be possible to pan.当interactiveviewer缩放级别最小时(1)图像的整个宽度必须适合容器,如果高度不适合,应该可以平移。
I tried many combinations of widgets, but could not find the right one for this behavior.我尝试了许多小部件组合,但找不到适合这种行为的组合。
Can anyone with more flutter experience help?有更多 flutter 经验的人可以帮忙吗?
Best Regards此致
I was able to solve it by using constrained=false in the InteractiveViewer widget我能够通过在 InteractiveViewer 小部件中使用 constrained=false 来解决它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.