ok_image 0.1.0 ok_image: ^0.1.0 copied to clipboard
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.
OKImage #
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.
use #
- add to your pubspec.yaml
ok_image: ^0.1.0
- import
import "package:ok_image/ok_image.dart";
- use
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,
);
}
- params
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
about other library #
This library uses http as a framework for network access.
Using rxdart processing logic
thanks to open source.