|
@@ -4,6 +4,7 @@ import 'package:zhiying_base_widget/widgets/goods_details/detail_img/bloc/goods_ |
|
|
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/goods_details_img_sk.dart'; |
|
|
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/goods_details_img_sk.dart'; |
|
|
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/model/goods_details_img_model.dart'; |
|
|
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/model/goods_details_img_model.dart'; |
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
|
|
import 'package:shimmer/shimmer.dart'; |
|
|
import 'package:cached_network_image/cached_network_image.dart'; |
|
|
import 'package:cached_network_image/cached_network_image.dart'; |
|
|
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/bloc/goods_details_img_repository.dart'; |
|
|
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/bloc/goods_details_img_repository.dart'; |
|
|
|
|
|
|
|
@@ -111,7 +112,13 @@ class _GoodsDetailsImgWidgetContainerState |
|
|
placeholder: (context, url){ |
|
|
placeholder: (context, url){ |
|
|
return AspectRatio( |
|
|
return AspectRatio( |
|
|
aspectRatio: 1/1, |
|
|
aspectRatio: 1/1, |
|
|
child: Container(color: Colors.white, height: double.infinity, width: double.infinity,), |
|
|
|
|
|
|
|
|
child: _shimmerWidget(height: double.infinity, width: double.infinity,), |
|
|
|
|
|
); |
|
|
|
|
|
}, |
|
|
|
|
|
progressIndicatorBuilder: (context, url ,progress){ |
|
|
|
|
|
return AspectRatio( |
|
|
|
|
|
aspectRatio: 1/1, |
|
|
|
|
|
child: _shimmerWidget(height: double.infinity, width: double.infinity,), |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
), |
|
|
), |
|
@@ -151,4 +158,17 @@ class _GoodsDetailsImgWidgetContainerState |
|
|
], |
|
|
], |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// 骨架视图 |
|
|
|
|
|
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)), |
|
|
|
|
|
), |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
} |