Browse Source

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

tags/0.0.3+1
23028876916@qq.com 4 years ago
parent
commit
c1a02bd3c1
3 changed files with 19 additions and 8 deletions
  1. BIN
     
  2. +18
    -8
      lib/widgets/goods_details/detail_img/goods_details_img.dart
  3. +1
    -0
      pubspec.yaml

BIN
View File


+ 18
- 8
lib/widgets/goods_details/detail_img/goods_details_img.dart View File

@@ -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 View File

@@ -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…
Cancel
Save