Ham*_*edi 2 android material-design flutter flutter-layout flutter-widget
有一种ContinuousRectangleBorder油漆,我可以将其传递给Card或Material小部件的形状参数。
Material(
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 4,
color: theme.primaryColor,
child: image,
borderOnForeground: true,
)
Run Code Online (Sandbox Code Playgroud)
但是在 android 中,如果我将图像传递给小部件,则图像不会作为父级剪辑。裁剪具有相同形状的图像的最佳方法是什么?
尝试这个 :
Material(
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 4,
color: theme.primaryColor,
child: image,
borderOnForeground: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
265 次 |
| 最近记录: |