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:
感謝開源。
如果您使用的是這些開源庫的較舊版本,這會導致不兼容,請更新您的。如果它與我不兼容,請與我聯繫,在適當的情況下,我將更新版本號。