我想在画布外绘制小工具,只显示裁剪的部分,即屏幕的大小或我自己的大小,我想动态地做到这一点。例如:sample img
我可以通过使用
UnconstrainedBox(
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
color: Colors.lightBlue,
//width: MediaQuery.of(context).size.width,
//height: MediaQuery.of(context).size.height ,
width: _size.width,
height: _size.height,
child: FittedBox(
alignment: Alignment.bottomCenter,
fit: BoxFit.none,
child: Container(
width: _size.width,
height: _size.height * 2,
child: MyWidget,
),
),
),
),
)
但是使用这个设置只允许我将小部件缩放到3倍,因为对齐坐标在一个轴上只有3个位置。我希望能够将小工具缩放到nx并显示任何部分。请帮帮忙。
发布于 2020-04-18 14:35:54
找到了解决方案,使用对齐(x,y)来缩放和定位小部件;)
https://stackoverflow.com/questions/61284906
复制相似问题