loadNetworkImage static method
加载网络图片
Implementation
static Widget loadNetworkImage(String? imgPath, {Key? key,BorderRadius radius:BorderRadius.zero,
String placeholder : "none", double? width, double? height, BoxFit fit: BoxFit.cover,String? package}){
// LogUtil.e('loadImage loadNetworkImage-->imgPath==$imgPath');
return Container(
width: width,
height: height,
child: ClipRRect(
borderRadius: radius,
child: CachedNetworkImage(
key: key,
imageUrl: imgPath??'',
placeholder: (context, url) => (placeholder=='none')?CupertinoActivityIndicator()
:loadAssetImage(placeholder, height: height, width: width, fit: fit,package: package),
errorWidget: (context, url, error) => (placeholder=='none')?Container(child: Icon(Icons.error),):
loadAssetImage(placeholder, height: height, width: width, fit: fit,package: package),
width: width,
height: height,
fit: fit,
)
),
);
}