瀏覽代碼

1224 商品详情图片未加载时换上默认占位图片

tags/0.0.3+1
23028876916@qq.com 4 年之前
父節點
當前提交
c1a02bd3c1
共有 3 個文件被更改,包括 19 次插入8 次删除
  1. 二進制
     
  2. +18
    -8
      lib/widgets/goods_details/detail_img/goods_details_img.dart
  3. +1
    -0
      pubspec.yaml

二進制
查看文件


+ 18
- 8
lib/widgets/goods_details/detail_img/goods_details_img.dart 查看文件

@@ -162,14 +162,24 @@ class _GoodsDetailsImgWidgetContainerState extends State<GoodsDetailsImgWidgetCo

/// 骨架视图
Widget _shimmerWidget({double width, double height, double radius = 0}) {
return Shimmer.fromColors(
baseColor: Colors.grey[300],
highlightColor: Colors.grey[100],
child: Container(
width: width,
height: height,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(radius)),
),
//返回骨架视图
// return Shimmer.fromColors(
// baseColor: Colors.grey[300],
// highlightColor: Colors.grey[100],
// child: Container(
// width: width,
// height: height,
// decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(radius)),
// ),
// );

//修改后返回默认图片
return Image.asset(
'assets/images/occupation_map/occupation_map.png',
package: 'zhiying_base_widget',
width: width,
height: height,
fit: BoxFit.fill,
);
}
}

+ 1
- 0
pubspec.yaml 查看文件

@@ -69,6 +69,7 @@ flutter:
- assets/images/empty/empty.png
- assets/images/qrcode/default_qrcode.png
- assets/images/loading/loading.gif
- assets/images/occupation_map/occupation_map.png
#
# For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages


Loading…
取消
儲存