universal_image
1.0.12, released 7 months ago by an unverified publisher
Unified widget to display any image source (asset, network, file, SVG, base64, bytes, icon) across platforms.
What it does
UniversalImage abstracts over different image types and providers, handling format detection, caching and rendering. It integrates flutter_svg for SVGs and extended_image for caching and advanced features.
AI-written summary of version 1.0.12, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a single widget to handle multiple image sources without manual type checks
- Cross‑platform apps (mobile, web, desktop) require consistent image handling
- You want built‑in caching and optional SVG support
Skip it when
- You only need simple network images and prefer a lightweight solution
- Fine‑grained control over caching policies is required beyond what extended_image offers
Strengths
- Supports many formats (JPEG, PNG, GIF, WebP, SVG, base64, bytes, icons)
- Works on all Flutter platforms including web WASM
- Leverages extended_image caching and flutter_svg rendering
- Simple API – just pass the source
Weaknesses
- Adds extra dependencies (flutter_svg, extended_image) increasing bundle size
- Limited customization compared to using extended_image directly
- Documentation is limited to basic examples
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
var img = UniversalImage('https://example.com/pic.png', width:100, height:100, fit:BoxFit.cover);Alternatives
Packages that do the same job and could replace universal_image.
- cached_network_image
Lightweight network image caching without SVG or other source support
91Compare - image
Low‑level image manipulation when you don't need a widget wrapper
96Compare
Works with
Packages commonly used together with universal_image: ones it builds on, ones built on it, and its own family.
- flutter_svguniversal_image depends on itRenders Scalable Vector Graphics (SVG 1.1) and precompiled vector graphics in Flutter.
- extended_imageuniversal_image depends on itExtended image library with caching, placeholders, zoom/pan, slide-out, and crop editor.
- shadcn_uiBuilt on universal_imageFlutter port of the shadcn/ui design system with customizable components.