【发布时间】:2021-01-22 17:50:36
【问题描述】:
我的问题应该很简单,但我卡住了:我需要显示带有标记的地图图像(这就是我使用堆栈的原因),并且可以缩放和平移此图像。唯一的问题是,当我打开应用程序时,图像完全放大了,我必须手动缩小。我尝试阅读文档和谷歌搜索,但只发现不符合我的需求或无法按预期工作的库。
所以,问题很简单:我怎样才能从头看到完全缩小的图像?
这是代码。
return Container(
height: 350,
child: InteractiveViewer(
// TODO the image is automatically zoomed in!
minScale: .1,
maxScale: 1,
constrained: false,
child: Stack(children: [
Image.asset(itinerary.mapImage, fit: BoxFit.fitWidth),
icon(...),
])
)
)
【问题讨论】: