我有一个图像容器。当剪辑图像时,某些图像部分会显示在容器之外。
我在容器外部图像部分的右侧添加一张图像。
child: Container(
height: height,
width: width,
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(
width: 2,
color: _isSelected && _showAlternateContainer ? Colors.black : Colors.transparent,
),
),
child: ClipRect(
clipper: MyCustomClipper( clipLeft, clipTop, clipWidth, clipHeight),
child: Image.asset(
image,
width: width,
height: height,
fit: BoxFit.cover,
),
),
),
不知道您的自定义剪裁器,但我猜容器已在此处结束,如图中标记的那样。
您可以提供填充以适应它或减小图像的大小。