flutter_ok_image
1.0.0
易于使用此库来构建网络图像小部件,您可以根据错误/加载构建不同的布局,还可以设置Image Cache委托。
ok_image : ^0.4.0 import "package:ok_image/ok_image.dart" ; import "package:ok_image/ok_image.dart" ;
createWidget (){
return OKImage (
url : "https://ws1.sinaimg.cn/large/844036b9ly1fxfo76hzd4j20zk0nc48i.jpg" ,
width : 200 ,
height : 200 ,
timeout : Duration (seconds : 20 ),
fit : fit,
);
}url: image net url
width: width
height: height
fit: show BoxFit
followRedirects: whether image redirection is allowed.
loadingWidget: display on loading
errorWidget: display when image load error / timeout.
retry: retry to load image count.
timeout: timeout duration.
onErrorTap: when loadErrorWidget show ,onTap it.
cacheDelegate: you can use the param to delegate loadImage实验:将来可能会修改签名,返回值,参数和其他信息。
onLoadStateChanged: will be call on the load state changed.编辑OKImage.buildErrorWidget以配置全局okimage errorwidget。
编辑OKImage.buildLoadingWidget ,以配置全局okimage加载。
根据BSD 3:
Apache 2.0:
感谢开源。
如果您使用的是这些开源库的较旧版本,这会导致不兼容,请更新您的。如果它与我不兼容,请与我联系,在适当的情况下,我将更新版本号。