Skip to content

A widget to cache your network image check it if it has already stored with downloading it through basic http request, so doesn't need to download it again.

License

Notifications You must be signed in to change notification settings

yairsts/cached_network_image_builder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 image one time that means it doesn't listen if image changed on server after download it.

How to use

  • Basic usage:
CachedNetworkImageBuilder(
    url: "https://cdn.pixabay.com/photo/2020/05/17/20/21/cat-5183427_1280.jpg",
    builder: (image) {
    return Center(child: Image.file(image));
    },
),
  • 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'],
),

About

A widget to cache your network image check it if it has already stored with downloading it through basic http request, so doesn't need to download it again.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 57.6%
  • Ruby 35.9%
  • Swift 4.5%
  • Kotlin 1.6%
  • Objective-C 0.4%