svg_cached_network_image 1.0.0+1 copy "svg_cached_network_image: ^1.0.0+1" to clipboard
svg_cached_network_image: ^1.0.0+1 copied to clipboard

cached_network_image support SVG image

svg_cached_network_image #

cached_network_image support SVG image

Cached network image #

pub package

A flutter library to show images from the internet and keep them in the cache directory.

How to use #

The CachedNetworkImage can be used directly or through the ImageProvider. Both the CachedNetworkImage as CachedNetworkImageProvider have minimal support for web. It currently doesn't include caching.

With a placeholder:

CachedNetworkImage(
        imageUrl: "http://via.placeholder.com/350x150",
        placeholder: (context, url) => CircularProgressIndicator(),
        errorWidget: (context, url, error) => Icon(Icons.error),
     ),

Or with a progress indicator:

CachedNetworkImage(
       imageUrl: "http://via.placeholder.com/350x150",
       progressIndicatorBuilder: (context, url, downloadProgress) => 
               CircularProgressIndicator(value: downloadProgress.progress),
       errorWidget: (context, url, error) => Icon(Icons.error),
    ),
Image(image: CachedNetworkImageProvider(url))

When you want to have both the placeholder functionality and want to get the imageprovider to use in another widget you can provide an imageBuilder:

CachedNetworkImage(
  imageUrl: "http://via.placeholder.com/200x150",
  imageBuilder: (context, imageProvider) => Container(
    decoration: BoxDecoration(
      image: DecorationImage(
          image: imageProvider,
          fit: BoxFit.cover,
          colorFilter:
              ColorFilter.mode(Colors.red, BlendMode.colorBurn)),
    ),
  ),
  placeholder: (context, url) => CircularProgressIndicator(),
  errorWidget: (context, url, error) => Icon(Icons.error),
),

How it works #

The cached network images stores and retrieves files using the flutter_cache_manager.

3
likes
15
pub points
0%
popularity

Publisher

unverified uploader

cached_network_image support SVG image

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, flutter_cache_manager, flutter_svg, octo_image

More

Packages that depend on svg_cached_network_image