smart_image_x library

SmartImageX — one image widget for everything.

Import this single library to access the entire public API:

import 'package:smart_image_x/smart_image_x.dart';

The headline export is SmartImage; everything else (enums, models, configuration, the gallery/viewer widgets and the stand-alone SmartImageTools utilities) is re-exported here so applications never need to reach into src/.

Classes

BlurHashDecoder
Pure-Dart decoder for the BlurHash placeholder format.
BlurHashView
Paints a decoded BlurHashDecoder bitmap, scaled to fill its box.
CacheConfig
Tuning parameters for the two-tier cache.
CacheManager
Orchestrates the two-tier cache (memory → disk) and exposes the public cache-management surface used by SmartImage's static API.
CacheStats
A point-in-time snapshot of cache health and utilisation.
CircularLoader
A determinate or indeterminate circular spinner placeholder.
CompressionRequest
Parameters for a compression request (a single object so the work can run in a background isolate via compute).
DefaultErrorWidget
The default error placeholder, shown when loading fails terminally and the developer supplied neither an errorBuilder nor a fallback.
DownloadProgress
Progress of an in-flight network download, delivered to onProgress.
FallbackIcon
A fallback rendering an IconData centered on a neutral background, used as the penultimate step of the fallback chain.
FormatDetector
Determines the ImageFormat of an image payload.
ImageCompressor
CPU-bound image compression and re-encoding, offloaded to a background isolate so it never janks the UI thread.
ImageMetadata
Decoded structural information about an image payload.
ImageTransformer
CPU-bound pixel transformations, offloaded to a background isolate.
Rect
An integer pixel rectangle for cropping.
ResolvedImageSource
An immutable, fully-classified description of an image origin.
RetryConfig
Configuration for the retry engine that guards remote image fetches.
ShimmerLoader
An animated shimmer-sweep placeholder, theme-aware for light and dark modes.
SkeletonLoader
A static, theme-aware skeleton block — the cheapest placeholder for long lists (no animation, single paint).
SmartImage
The one image widget for everything.
SmartImageCallbacks
An aggregate of every lifecycle callback, threaded through the pipeline so individual stages can fire the relevant hook without each taking a long parameter list.
SmartImageConfig
Process-wide defaults applied to every SmartImage unless overridden at the widget level.
SmartImageGallery
A swipeable, zoomable, full-screen gallery over a list of images.
SmartImageTools
Stand-alone image processing utilities.
SmartImageViewer
A full-screen, zoomable, dismissible viewer for a single image.
SmartLoader
Builds the placeholder widget for a given LoaderType.
SourceDetector
Classifies the loosely-typed image value passed to SmartImage into a strongly-typed ResolvedImageSource.
TransformSpec
A bundle of colour/geometry adjustments applied in a single isolate pass.
ZoomableImage
Wraps any child in pinch-zoom, pan and double-tap-to-zoom gestures using Flutter's built-in InteractiveViewer — no external package required.

Enums

CachePolicy
Strategy that governs how a SmartImage reads from and writes to the two-tier cache (memory + disk).
CompressionFormat
Output encodings supported by the compressor.
ConnectionQuality
Quality buckets reported by the connectivity service and consumed by the adaptive-quality engine.
FlipDirection
Axis for ImageTransformer.flip.
ImageFormat
Concrete image encodings SmartImageX can recognise and render.
ImagePriority
Relative scheduling priority for an image fetch.
ImageSourceType
The kind of origin an image value resolves to.
LoaderType
Built-in placeholder styles shown while an image is loading.
RenderPhase
The display phase of a SmartImage's internal state machine.
SmartImageErrorType
Categories of failure surfaced by the image pipeline.
SmartImageLogLevel
Verbosity of SmartImageX's internal diagnostic logging.
TransitionType
Animation used when an image swaps from its placeholder to the final frame.

Typedefs

OnCacheHit = void Function()
Invoked when the requested bytes were served from cache.
OnCacheMiss = void Function()
Invoked when the requested bytes were not cached and had to be fetched.
OnFallback = void Function()
Invoked when the pipeline falls back from the primary image to a fallback image or icon.
OnLoadError = void Function(SmartImageException error)
Invoked when loading fails terminally (after retries and fallbacks are exhausted) with the categorised error.
OnLoadStart = void Function()
Invoked when loading begins (after source detection, before bytes arrive).
OnLoadSuccess = void Function()
Invoked once the final image has been decoded and is ready to paint.
OnProgress = void Function(DownloadProgress progress)
Invoked with download progress for remote sources.
OnRetry = void Function(int attempt, SmartImageException error)
Invoked before each retry attempt. attempt is 1-based; error is the failure that triggered the retry.

Exceptions / Errors

SmartImageException
The error type passed to errorBuilder and onLoadError.