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!
