malibayram/cached_network_image_builder
一个用于缓存网络图片的组件;通过基本的HTTP请求检查图片是否已存储,从而避免重复下载。
- Stars
- 4
- Forks
- 2
- 最近推送(UTC)
- 2024年1月21日
- 项目状态
- 未归档
语言C++CMakeDartRubySwiftHTMLCKotlinObjective-C
使用的依赖
依赖清单 5 项
- flutter
{"sdk":"flutter"} - http
^1.2.0 - path_provider
^2.1.2 - flutter_test开发依赖
{"sdk":"flutter"} - flutter_lints开发依赖
^3.0.1
原始 README
以下为英文项目原文快照,最新内容请访问 GitHub。
展开 / 收起项目 README
cached_network_image_builder
A widget to cache your network image with downloading it via using basic http request and check it if it has already stored, so doesn't need to download it again.
Thanks to pixabay for free images.
Important note:
- The packages will download the image only once, which means it doesn't listen for changes on the server after downloading it.
How to use
- Basic usage:
CachedNetworkImageBuilder(
url: "https://cdn.pixabay.com/photo/2020/05/17/20/21/cat-5183427_1280.jpg",
builder: (imageFile) {
return Center(child: Image.file(imageFile));
},
),
- More customized usage:
CachedNetworkImageBuilder(
url: "misformatted_url_or_url_that_doesn't_contain_image",
builder: (image) {
return Center(child: Image.file(image));
},
// Optional Placeholder widget until image loaded from url
placeHolder: LinearProgressIndicator(),
// Optional error widget
errorWidget: Image.asset('assets/images/error_image.png'),
// Optional describe your image extensions default values are; jpg, jpeg, gif and png
imageExtensions: ['jpg', 'png'],
),