这是我的代码
Row(
children: [
Expanded(
flex: 1,
child: Text(
"somethinig here..."),
),
Expanded(
child: ClipRect(
child: Wrap(
children: [
SvgPicture.asset(
"assets/3958830.svg",
width: autoHeight(550),
allowDrawingOutsideViewBox: true,
fit: BoxFit.fitHeight,
),
],
),
),
),
],
),
结果:
您可以看到图像是如何裁剪的,我只想裁剪除左侧之外的所有边。
您可以使用 Align 小部件包装图像小部件以轻松地将图像定位在clipper
. 的widthFactor
和heightFactor
特性被用来决定size
的clipper
,并alignment
用于决定所述position
的限幅器`的
使用Align
Widget 的一个很好的例子ClipRect
是
ClipRect(
child: Container(
child: Align(
alignment: Alignment.centerLeft,
widthFactor: 0.6,
heightFactor: 1.0,
child: Image.network(
'https://images.unsplash.com/photo-1473992243898-fa7525e652a5'
),
),
),
);
要了解更多信息,Clippers
请参阅本文
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句