loadNetImage static method
加载网络图片widget
Implementation
static Widget loadNetImage(
String? url, {
String? domain,
ImageTransformerType type = ImageTransformerType.rect,
double? width,
double? height,
BoxFit fit = BoxFit.cover,
}) {
var domainUrl = domain ?? ImageWidget.domain;
if (url != null && !url.startsWith("http")) {
url = domainUrl + url;
}
return OctoImage(
image: CachedNetworkImageProvider(url ?? ""),
imageBuilder: type == ImageTransformerType.rect
? MyOctoImageTransformer.radiusAvatar()
: MyOctoImageTransformer.circleAvatar(),
errorBuilder: OctoError.icon(color: Colors.red),
fit: fit,
width: width,
height: height,
);
}