NotificationImageLoader class
Utility for downloading and caching images for rich notifications.
This loader handles:
- Async image download with timeout
- Local caching to avoid repeated downloads
- Graceful failure handling
- Automatic cache cleanup
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
cleanupOldCache(
[Duration maxAge = maxCacheAge]) → Future< void> -
Removes old cached images that exceed
maxAge. -
clearCache(
) → Future< void> - Clears all cached notification images.
-
downloadImage(
String url, {Duration timeout = defaultTimeout}) → Future< String?> -
Downloads an image from
urland returns the local file path.
Constants
- defaultTimeout → const Duration
- Default timeout for image downloads.
- maxCacheAge → const Duration
- Maximum cache age before images are re-downloaded.