utilNetworkImage_imageBuilder static method
Widget
utilNetworkImage_imageBuilder(})
网络图片
Implementation
static Widget utilNetworkImage_imageBuilder(
String url, {
BoxFit? fit = BoxFit.cover,
Widget Function(BuildContext, ImageProvider<Object>)? imageBuilder,
}) {
if (FFEmpty.stringIsEmpty(url) || !url.startsWith("http")) {
return _failWidget();
}
try {
return CachedNetworkImage(
fit: fit,
imageUrl: url,
placeholder: (context, url) {
return _placeholderWidget();
},
errorWidget: (context, url, error) {
return _failWidget();
},
imageBuilder: imageBuilder,
);
} catch (e) {
print("FFImageUtil load image error");
}
return _failWidget();
}