all_image_handler
A smart Flutter image handler package that automatically detects image sources (network, asset, file, memory) and displays them with advanced features like caching, shimmer loading, retry support, and hero animations.
โจ Features
- ๐ Automatic image source detection (Network / Asset / File / Memory)
- โก Fast loading with caching support
- โจ Shimmer loading effect
- ๐ Retry button on load failure
- ๐งฑ Custom error widget support
- ๐ฆธ Hero animation support
- ๐ฏ Clean and simple API
- ๐ฑ Works on Android, iOS, Web, Windows, macOS, Linux
๐ Installation
Add this to your pubspec.yaml:
dependencies:
all_image_handler: ^0.0.1
Then run:
flutter pub get
๐ฆ Import
import 'package:all_image_handler/all_image_handler.dart';
๐ผ๏ธ Basic Usage
AllImage(
image: 'https://example.com/image.jpg',
)
๐ง Auto Detection
No need to specify image type ๐
AllImage(image: 'https://example.com/image.jpg'); // Network
AllImage(image: 'assets/images/logo.png'); // Asset
AllImage(image: file.path); // File
AllImage(image: memoryBytes); // Memory
๐จ Advanced Usage
AllImage(
image: 'https://example.com/image.jpg',
width: 200,
height: 200,
fit: BoxFit.cover,
showShimmer: true,
enableCache: true,
heroTag: 'imageHero',
errorWidget: Icon(Icons.error),
)
๐ Retry on Error
AllImage(
image: 'https://wrong-url.com/image.jpg',
showRetry: true,
)
โจ Shimmer Loading
AllImage(
image: 'https://example.com/image.jpg',
showShimmer: true,
)
๐ฆธ Hero Animation
AllImage(
image: 'https://example.com/image.jpg',
heroTag: 'myImage',
)
โ๏ธ Options Overview
| Property | Type | Description |
|---|---|---|
| image | dynamic | Image source (auto-detected) |
| width | double | Width of image |
| height | double | Height of image |
| fit | BoxFit | Image fit |
| showShimmer | bool | Show shimmer while loading |
| enableCache | bool | Enable caching for network images |
| showRetry | bool | Show retry button on error |
| errorWidget | Widget | Custom error widget |
| heroTag | String | Enable hero animation |
๐ธ Screenshots
๐งช Example
Check the /example folder for a complete working demo.
๐ค Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
๐ License
This project is licensed under the MIT License.
๐จโ๐ป Author
Md Araful Islam
Flutter Developer with 2+ years of experience in building scalable mobile applications, real-time features, and production-ready apps for App Store & Play Store.
๐ LinkedIn: https://linkedin.com/in/your-profile
๐ง Email: rajuslam39@gmail.com
๐ Portfolio: https://araful39.netlify.app/
๐ป GitHub: https://github.com/araful39
โญ Support
If you like this package, please โญ star the repo and share it with others!
