๐Ÿ–ผ Cached Network Image Widget

The Cached Network Image Widget package provides a simple, customizable way to display network images and SVGs in your Flutter applications.
It supports image caching, blurhash placeholders, shimmer loading animations, and SVG color customization โ€” all with minimal setup.

โœจ Features

  • ๐Ÿง  Smart Caching โ€“ Automatically caches network images and SVGs
  • ๐ŸŒˆ BlurHash Placeholders โ€“ Show a blurred preview while loading
  • โšก Shimmer Loading โ€“ Smooth skeleton loading animation
  • ๐ŸŽจ SVG Support โ€“ Load and color SVGs from URLs
  • ๐Ÿงฉ Customizable Styles โ€“ Supports radius, borders, and shapes
  • โŒ Error Handling โ€“ Gracefully handle missing or broken images

โš™๏ธ Installation

Add cached_network_image_widget to your pubspec.yaml file:

dependencies:
  cached_network_image_widget: ^1.0.0

Then run:

```bash
flutter pub get

Import the package:

import 'package:cached_network_image_widget/cached_network_image_widget.dart';

๐Ÿš€ Usage

  1. Display a Cached Network Image
CachedNetworkImageWidget(
	'https://picsum.photos/400/300',
	height: 200,
	width: 300,
	borderRadius: BorderRadius.circular(12),
);
  1. Display a Cached SVG Image
CachedNetworkSvgWidget(
	'https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/android.svg',
	height: 100,
	width: 100,
	color: Colors.green,
);
  1. With BlurHash and Error Handling
CachedNetworkImageWidget(
	'https://example.com/photo-BH_cE3gK-EVH_.jpg', // BlurHash in URL
	height: 250,
	width: double.infinity,
	shape: BoxShape.rectangle,
	border: Border.all(color: Colors.grey.shade300),
	errorBuilder: (context, url, error) => const Icon(Icons.broken_image),
);

๐Ÿ”ง Parameters

Parameter Type Description
imageUrl String Image URL to load
height double? Image height
width double? Image width
borderRadius BorderRadius? Rounded corners
border BoxBorder? Border style
fit BoxFit How the image fits (default: BoxFit.cover)
shape BoxShape Shape (rectangle or circle)
color Color? Tint color (for SVGs)
errorBuilder Widget Function(BuildContext, String, Object)? Custom error widget

๐Ÿ“„ License

๐Ÿงช Example App

You can find a working demo inside the example/ folder.
Run it directly:

cd example
flutter run

๐Ÿชช License

This project is licensed under the MIT License.
ยฉ 2025 Safeen Kurd

๐Ÿ‘ค Author

Safeen Kurd
๐Ÿ“ง safeenkurd96@gmail.com
๐ŸŒ void.krd โ€” safeenkurd.info