我正在使用 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, ); }
如下
使用ClipRRect它将完美运行。
ClipRRect
ClipRRect( borderRadius: BorderRadius.circular(8.0), child: Image.network( subject['images']['large'], height: 150.0, width: 100.0, ), )