Sfoglia il codice sorgente

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

tags/0.0.3+1
23028876916@qq.com 4 anni fa
parent
commit
c1a02bd3c1
3 ha cambiato i file con 19 aggiunte e 8 eliminazioni
  1. BIN
     
  2. +18
    -8
      lib/widgets/goods_details/detail_img/goods_details_img.dart
  3. +1
    -0
      pubspec.yaml

BIN
Vedi File


+ 18
- 8
lib/widgets/goods_details/detail_img/goods_details_img.dart Vedi 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 Vedi 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


Caricamento…
Annulla
Salva