我怎样用一个边界半径把一个图像网络框入容器
Container( width: 100, height: 100, child: Image.network( snapshot.data!, fit: BoxFit.cover, ), ),
wfveoks01#
当您使用Container覆盖clipBehavior并调用decoration时
clipBehavior
decoration
Container( width: 100, height: 100, clipBehavior: Clip.hardEdge, //default is none decoration: BoxDecoration( borderRadius: BorderRadius.circular(12.0), ), child: Image.network( "", fit: BoxFit.cover, ), ),
lo8azlld2#
ClipRRect( borderRadius: BorderRadius.circular(8.0), child: Container( height: 100.0, width: 100.0, child: Image.network( subject['images']['large'], height: 100.0, width: 100.0, ),) )
niwlg2el3#
Container( width: 100, height: 100, child: Image.network( snapshot.data!, fit: BoxFit.cover, width: 100, height: 100, ), ),
huwehgph4#
Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(10)), width: 100, height: 100, child: Image.network( snapshot.data!, fit: BoxFit.cover, ),),
4条答案
按热度按时间wfveoks01#
当您使用Container覆盖
clipBehavior
并调用decoration
时lo8azlld2#
niwlg2el3#
huwehgph4#