我正在使用Flutter制作有关电影的信息列表。现在,我希望左侧的封面图像是圆角图片。我做了以下工作, 但是没有用。谢谢!
getItem(var subject) { var row = Container( margin: EdgeInsets.all(8.0), child: Row( children: <Widget>[ Container( width: 100.0, height: 150.0, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8.0)), color: Colors.redAccent, ), child: Image.network( subject['images']['large'], height: 150.0, width: 100.0, ), ), ], ), ); return Card( color: Colors.blueGrey, child: row, ); }
Use ClipRRect it will work perfectly
ClipRRect
ClipRRect( borderRadius: BorderRadius.circular(8.0), child: Image.network( subject['images']['large'], height: 150.0, width: 100.0, ), )