|
|
@@ -46,13 +46,14 @@ class HomeGoodsItem extends StatelessWidget { |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
margin: EdgeInsets.only(right: 0), |
|
|
|
child: ClipRRect( |
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
topLeft: Radius.circular(7.5), |
|
|
|
topRight: Radius.circular(7.5)), |
|
|
|
child: CachedNetworkImage( |
|
|
|
imageUrl: goods?.goodImage ?? '', |
|
|
|
fit: BoxFit.fitWidth, |
|
|
|
child: ClipRRect(borderRadius: BorderRadius.only(topLeft: Radius.circular(7.5), topRight: Radius.circular(7.5)), |
|
|
|
child: CachedNetworkImage(imageUrl: goods?.goodImage ?? '', fit: BoxFit.fitWidth, |
|
|
|
placeholder: (context, url) { |
|
|
|
return _createShimmerWidget(width: double.infinity); |
|
|
|
}, |
|
|
|
errorWidget: (context, url, error,) { |
|
|
|
return _createShimmerWidget(width: double.infinity); |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
@@ -352,4 +353,16 @@ class HomeGoodsItem extends StatelessWidget { |
|
|
|
style: TextStyle(fontSize: 11, color: HexColor.fromHex('#999999')), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 商品占位骨架视图 |
|
|
|
Widget _createShimmerWidget({double width, double height}) { |
|
|
|
//修改后返回默认图片 |
|
|
|
return Image.asset( |
|
|
|
'assets/images/occupation_map/occupation_map.png', |
|
|
|
package: 'zhiying_base_widget', |
|
|
|
width: width, |
|
|
|
height: height, |
|
|
|
fit: BoxFit.fill, |
|
|
|
); |
|
|
|
} |
|
|
|
} |