flutter_cached_network_image_plus
A Flutter package that provides a custom widget CacheNetworkImagePlus
for loading and caching network images with a shimmer effect.
Features
- Caches and loads network images efficiently.
- Supports a shimmer effect while the image is loading.
- Customizable options such as box fit, dimensions, shimmer colors, and more.
Installation
Add the following dependency to your pubspec.yaml
file:
dependencies:
cached_network_image_plus: ^0.0.4
Usage
Import the package:
import 'package:flutter_cached_network_image_plus/flutter_cached_network_image_plus.dart';
Use the CacheNetworkImagePlus
widget in your Flutter app:
CacheNetworkImagePlus(
imageUrl: 'https://example.com/image.jpg',
width: 300,
height: 300,
// Other optional parameters...
)
Parameters
- imageUrl (required): The URL of the network image.
- width and height: The dimensions of the image.
- Other optional parameters for customization.
Example
CacheNetworkImagePlus(
imageUrl: 'https://example.com/image.jpg',
width: 300,
height: 300,
shimmerDirection: ShimmerDirection.ltr,
shimmerDuration: Duration(milliseconds: 1500),
// Other optional parameters...
)