crash_safe_image 0.3.0
crash_safe_image: ^0.3.0 copied to clipboard
Crash-safe Flutter image widget with network, asset, file, memory & SVG support. Smart caching, placeholders, error UI, and safe ImageProvider.
0.3.0 2025-01-XX #
Phase 1 Release - Advanced Features
New Features #
- Progressive Loading: Show thumbnail first, then load full image with
thumbnailUrlanduseProgressiveLoadingparameters - Image Transformations: Resize and crop operations with
ImageTransformation.resize()andImageTransformation.crop() - Enhanced Caching: Configurable cache with 4 presets (default, aggressive, conservative, minimal) via
CrashSafeImageCacheConfig- Global cache configuration with
CrashSafeImageCache.configure() - Per-widget cache configuration with
cacheConfigparameter - Cache management:
clear(),remove(),getStats()
- Global cache configuration with
- Hero Animations: Smooth page transitions with
heroTagparameter
Improvements #
- Fixed SVG detection false positives (e.g., image.svg.png)
- Replaced synchronous file operations with async-safe alternatives
- Added path traversal protection for file paths
- Enhanced network URI validation
- Improved type casting safety
- Better error handling in build method
Testing #
- Added 25 new tests (32 total)
- Tests for progressive loading, transformations, caching, and hero animations
- Improved test coverage for edge cases
Dependencies #
- Uses
flutter_cache_managerviacached_network_imagetransitive dependency (no explicit declaration needed)
0.2.1 - 2025-09-14 #
- Fixed:
providercould returnnullin some cases.
Now always returns a safe transparent fallback image (never-null). - Improved: safer behavior in
CircleAvatar/DecorationImageusage, no user-side null checks needed.
0.2.0 - 2025-09-11 #
- Added SVG support via
flutter_svg. - Auto-detects
.svgin network, asset, file, and memory sources. - Provides new factory:
CrashSafeImage.svgString('<svg ...>'). - Unified placeholder/error behavior for raster & SVG.
0.1.0 - 2025-08-31 #
- Initial public release.
- CrashSafeImage widget with network / asset / file / memory support.
- Custom placeholder & error builders.
- Cached network images via
cached_network_image. - Example app and basic widget tests.