flutter_ok_image
1.0.0
Easy to use this library to build a network image widget, you can build different layouts according to the error/load, also set up the image cache delegate.
ok_image: ^0.4.0import "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 loadImageExperimental: Signatures, return values, parameters and other information may be modified in the future.
onLoadStateChanged: will be call on the load state changed.edit OKImage.buildErrorWidget to config global OKImage errorWidget.
edit OKImage.buildLoadingWidget to config global OKImage loading.
under BSD 3:
Apache 2.0:
thanks to open source.
If you are using older versions of these open source libraries, which cause incompatibility, please update your. If it is incompatible with me, please contact me and I will update the version number when appropriate.